Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#385 - Further HTML report improvements #394

Merged
merged 1 commit into from
Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions src/main/resources/findbugs/default.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</style>
</head>

<xsl:variable name="unique-catkey" select="/BugCollection/BugCategory/@category"/>
<xsl:variable name="unique-patternkey" select="/BugCollection/BugPattern/@type"/>

<body>

Expand All @@ -94,24 +94,24 @@
<th align="right">Number</th>
</tr>

<xsl:for-each select="$unique-catkey">
<xsl:for-each select="$unique-patternkey">
<xsl:sort select="." order="ascending"/>
<xsl:variable name="catkey" select="."/>
<xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>
<xsl:variable name="patternkey" select="."/>
<xsl:variable name="patterndesc" select="/BugCollection/BugPattern[@type=$patternkey]/ShortDescription"/>
<xsl:variable name="styleclass">
<xsl:choose><xsl:when test="position() mod 2 = 1">tablerow0</xsl:when>
<xsl:otherwise>tablerow1</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<tr class="{$styleclass}">
<td><a href="#Warnings_{$catkey}"><xsl:value-of select="$catdesc"/> Warnings</a></td>
<td align="right"><xsl:value-of select="count(/BugCollection/BugInstance[(@category=$catkey) and (not(@last))])"/></td>
<td><a href="#Warnings_{$patternkey}"><xsl:value-of select="$patterndesc"/> Warnings</a></td>
<td align="right"><xsl:value-of select="count(/BugCollection/BugInstance[(@type=$patternkey) and (not(@last))])"/></td>
</tr>
</xsl:for-each>

<xsl:variable name="styleclass">
<xsl:choose><xsl:when test="count($unique-catkey) mod 2 = 0">tablerow0</xsl:when>
<xsl:choose><xsl:when test="count($unique-patternkey) mod 2 = 0">tablerow0</xsl:when>
<xsl:otherwise>tablerow1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand All @@ -127,15 +127,14 @@
<p>Click on each warning link to see a full description of the issue, and
details of how to resolve it.</p>

<xsl:for-each select="$unique-catkey">
<xsl:for-each select="$unique-patternkey">
<xsl:sort select="." order="ascending"/>
<xsl:variable name="catkey" select="."/>
<xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>

<xsl:variable name="patternkey" select="."/>
<xsl:variable name="patterndesc" select="/BugCollection/BugPattern[@type=$patternkey]/ShortDescription"/>
<xsl:call-template name="generateWarningTable">
<xsl:with-param name="warningSet" select="/BugCollection/BugInstance[(@category=$catkey) and (not(@last))]"/>
<xsl:with-param name="sectionTitle"><xsl:value-of select="$catdesc"/> Warnings</xsl:with-param>
<xsl:with-param name="sectionId">Warnings_<xsl:value-of select="$catkey"/></xsl:with-param>
<xsl:with-param name="warningSet" select="/BugCollection/BugInstance[(@type=$patternkey) and (not(@last))]"/>
<xsl:with-param name="sectionTitle"><xsl:value-of select="$patterndesc"/> Warnings</xsl:with-param>
<xsl:with-param name="sectionId">Warnings_<xsl:value-of select="$patternkey"/></xsl:with-param>
</xsl:call-template>
</xsl:for-each>

Expand Down
Loading