Edit sorting of detailed findbugs results


Playing a round with findbugs I noticed that some of the pages can be a little bit longwinding when trying to scroll through them. Depending on the severity of the error, your CV will highlight the details in either red, orange, green or blue. By default the errors will be listed alphabetically, basically by error code abbreviation.

A small change to the code makes the sorting a bit more obvious and will allow you to track any highlighted errors a bit sooner, so you can fix them by priority.

In the {findbugs.home}/webapps/cruisecontrol/xsl directory, open the file findbugs-details.xsl with your favourite text editor, vi in my case. Search for the “generateWarningTable” template.

Change the following code fragment:

<xsl:sort select="@abbrev"/>
<xsl:sort select=""Class/@classname"/>

To the following and save the file:

<xsl:sort select="@priority" data-type="number" order="ascending"/>
<xsl:sort select="@abbrev"/>
<xsl:sort select="Class/@classname"/>

Detailed results will now be displayed by severity.

Leave a Comment

Filed under English, Java, Mac

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s