hudson.plugins.pmd.PmdHealthDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pmd Show documentation
Show all versions of pmd Show documentation
This plug-in generates the trend report for PMD, an
open source static code analysis program.
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());
}
}
}