Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-1030

FindBugs only shows first type of defect per Class

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • findbugs-plugin
    • None
    • Platform: All, OS: Linux

      Partly linked to Issue 928 as well.

      Hudson 1.153, FindBugs 1.17, Suse Linux Enterprise 9.3

      We have a project where a number of Classes have multiple warnings per Class.
      However, the Hudson Findbugs report only shows the first type of warning per class.

      For example, Hudson Report:
      FindBugs Warnings of Package com.abm.IS.DBconnection
      Summary
      Total High Priority Normal Priority Low Priority
      1 0 1 0
      Warnings
      Class: cDBconnection, Type: NM_CLASS_NAMING_CONVENTION, Priority: 2, Category:
      BAD_PRACTICE

      Class names should be nouns, in mixed case with the first letter of each
      internal word capitalized. Try to keep your class names simple and descriptive.
      Use whole words-avoid acronyms and abbreviations (unless the abbreviation is
      much more widely used than the long form, such as URL or HTML).

      Snippet from findbugs.xml for cDBconnection:
      <BugInstance type="NM_CLASS_NAMING_CONVENTION" priority="2" abbrev="Nm"
      category="BAD_PRACTICE">

      <Class classname="com.abm.IS.DBconnection.cDBconnection">
      <SourceLine classname="com.abm.IS.DBconnection.cDBconnection" start="48"
      end="184" sourcefile="cDBconnection.java"
      sourcepath="com/abm/IS/DBconnection/cDBconnection.java"/>
      </Class>
      </BugInstance>

      <BugInstance type="SF_SWITCH_FALLTHROUGH" priority="2" abbrev="SF" category="STYLE">

      <Class classname="com.abm.IS.DBconnection.cDBconnection">
      <SourceLine classname="com.abm.IS.DBconnection.cDBconnection" start="48"
      end="184" sourcefile="cDBconnection.java"
      sourcepath="com/abm/IS/DBconnection/cDBconnection.java"/>
      </Class>

      <Method classname="com.abm.IS.DBconnection.cDBconnection"
      name="setDefaultAttributes" signature="(Lcom/abm/IS/cISrecord;)V" isStatic="false">
      <SourceLine classname="com.abm.IS.DBconnection.cDBconnection" start="116"
      end="137" startBytecode="0" endBytecode="261" sourcefile="cDBconnection.java"
      sourcepath="com/abm/IS/DBconnection/cDBconnection.java"/>
      </Method>
      <SourceLine classname="com.abm.IS.DBconnection.cDBconnection" start="119"
      end="121" startBytecode="44" endBytecode="47" sourcefile="cDBconnection.java"
      sourcepath="com/abm/IS/DBconnection/cDBconnection.java"/>
      </BugInstance>

      As you can see from the findbugs.xml, we have two different bugs and two
      different types of bugs for this one class, but the report only is showing the
      first type of bug.

      As mentioned, this is also partly related to Bug 928, as this is only showing
      one bug, and also not showing the exact location of the bug (just the class
      location).

            drulli Ulli Hafner
            davyboyhayes davyboyhayes
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: