use of hudson.plugins.violations.TypeSummary in project violations-plugin by jenkinsci.
the class SeverityTypeDataSet method buildDataSet.
/**
* Build the data set.
*
* @return the dataset.
*/
public CategoryDataset buildDataSet() {
DataSetBuilder<Row, NumberOnlyBuildLabel> builder = new DataSetBuilder<Row, NumberOnlyBuildLabel>();
for (ViolationsReport r = report; r != null; r = r.previous()) {
if (r.getTypeSummaries() == null) {
continue;
}
TypeSummary t = r.getTypeSummaries().get(type);
if (t == null) {
// Old report
continue;
}
if (t.getSeverityArray() == null || t.getSeverityArray().length != Severity.NUMBER_SEVERITIES) {
// Old report
continue;
}
int[] nums = t.getSeverityArray();
builder.add(nums[Severity.MEDIUM_VALUE] + nums[Severity.MEDIUM_HIGH_VALUE] + nums[Severity.MEDIUM_LOW_VALUE], MEDIUM_ROW, new NumberOnlyBuildLabel((Run) r.getBuild()));
builder.add(nums[Severity.HIGH_VALUE], HIGH_ROW, new NumberOnlyBuildLabel((Run) r.getBuild()));
builder.add(nums[Severity.LOW_VALUE], LOW_ROW, new NumberOnlyBuildLabel((Run) r.getBuild()));
}
return builder.build();
}
Aggregations