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

Expose more analysis details via API

    Details

    • Similar Issues:

      Description

      I would like to be able to generate emails that tell users the new (and maybe also fixed) warnings for the reports generated via the static analysis plugin. I didn't see a 'Component' for that, so although this is filed for 'findbugs', I'd really like to see it for pmd and cpd as well.

      I would like to be able to generate a report that includes, for each new/fixed violation:

      The file name.
      A link to the file source.
      The violation details: category, rule, description.

      Basically, everything I see when I go to findbugsResult/new/tab.all/?, which is something like this:

      ----- example ------

      File: I18nContextImpl.java, Line: 47, Type: HE_EQUALS_USE_HASHCODE, Priority: High, Category: BAD_PRACTICE

      cj.internationalization.I18nContextImpl defines equals and uses Object.hashCode()

      This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.

      If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended hashCode implementation to use is:

      public int hashCode()

      { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do }

      --------------------

      If all those bits were in an xml document with nice descriptive tags (and of course the URL for the file details exposed), that would be awesome. Then I could mix and match as our needs evolve. For example, to start with, I would include all the details in the email, but later probably just the summary ("cj.internationalization.I18nContextImpl defines equals and uses Object.hashCode()") as a link to the source code.

      With the file name and path, I should be able to poll the source control to determine who checked in the file last, and therefore who to blame.

      Thanks!

        Attachments

          Activity

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              emmulator emmulator
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: