Search in sources :

Example 1 with TypeSummary

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();
}
Also used : NumberOnlyBuildLabel(hudson.util.ChartUtil.NumberOnlyBuildLabel) DataSetBuilder(hudson.util.DataSetBuilder) ViolationsReport(hudson.plugins.violations.ViolationsReport) Run(hudson.model.Run) TypeSummary(hudson.plugins.violations.TypeSummary)

Aggregations

Run (hudson.model.Run)1 TypeSummary (hudson.plugins.violations.TypeSummary)1 ViolationsReport (hudson.plugins.violations.ViolationsReport)1 NumberOnlyBuildLabel (hudson.util.ChartUtil.NumberOnlyBuildLabel)1 DataSetBuilder (hudson.util.DataSetBuilder)1