Search in sources :

Example 41 with Violation

use of hudson.plugins.violations.model.Violation in project violations-plugin by jenkinsci.

the class OutputFileModel method createLimited.

private void createLimited() throws IOException {
    for (Map.Entry<String, TreeSet<Violation>> e : fileModel.getTypeMap().entrySet()) {
        String type = e.getKey();
        Set<Violation> violations = e.getValue();
        LimitedType limitedType = new LimitedType();
        limitedType.number = violations.size();
        int c = 0;
        for (Violation v : violations) {
            limitedType.violations.add(v);
            addToVMap(v);
            doViolation(v);
            c++;
            if (c >= config.getLimit()) {
                break;
            }
        }
        limitedMap.put(type, limitedType);
    }
}
Also used : Violation(hudson.plugins.violations.model.Violation) TreeSet(java.util.TreeSet) HashMap(java.util.HashMap) TreeMap(java.util.TreeMap) Map(java.util.Map) SortedMap(java.util.SortedMap)

Aggregations

Violation (hudson.plugins.violations.model.Violation)41 FullFileModel (hudson.plugins.violations.model.FullFileModel)12 ViolationsParserTest (hudson.plugins.violations.ViolationsParserTest)8 FullBuildModel (hudson.plugins.violations.model.FullBuildModel)8 Test (org.junit.Test)8 File (java.io.File)6 Map (java.util.Map)3 Element (org.w3c.dom.Element)3 HashMap (java.util.HashMap)2 TreeSet (java.util.TreeSet)2 FilePath (hudson.FilePath)1 AbsoluteFileFinder (hudson.plugins.violations.util.AbsoluteFileFinder)1 IOException2 (hudson.util.IOException2)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 SortedMap (java.util.SortedMap)1 TreeMap (java.util.TreeMap)1 Matcher (java.util.regex.Matcher)1