All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.plugins.pmd.PmdHealthDescriptor Maven / Gradle / Ivy

Go to download

This plug-in generates the trend report for PMD, an open source static code analysis program.

There is a newer version: 3.34-h-1
Show newest version
package hudson.plugins.pmd;

import hudson.plugins.analysis.core.AbstractHealthDescriptor;
import hudson.plugins.analysis.core.HealthDescriptor;
import hudson.plugins.analysis.util.model.AnnotationProvider;

import org.jvnet.localizer.Localizable;

/**
 * A health descriptor for PMD build results.
 *
 * @author Ulli Hafner
 */
public class PmdHealthDescriptor extends AbstractHealthDescriptor {
    /** Unique ID of this class. */
    private static final long serialVersionUID = -3404826986876607396L;

    /**
     * Creates a new instance of {@link PmdHealthDescriptor} based on the
     * values of the specified descriptor.
     *
     * @param healthDescriptor the descriptor to copy the values from
     */
    public PmdHealthDescriptor(final HealthDescriptor healthDescriptor) {
        super(healthDescriptor);
    }

    @Override
    protected Localizable createDescription(final AnnotationProvider result) {
        if (result.getNumberOfAnnotations() == 0) {
            return Messages._PMD_ResultAction_HealthReportNoItem();
        }
        else if (result.getNumberOfAnnotations() == 1) {
            return Messages._PMD_ResultAction_HealthReportSingleItem();
        }
        else {
            return Messages._PMD_ResultAction_HealthReportMultipleItem(result.getNumberOfAnnotations());
        }
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy