aboutsummaryrefslogtreecommitdiffstats
path: root/lib/findbugs
diff options
context:
space:
mode:
authorShevek <[email protected]>2008-03-21 23:05:04 +0000
committerShevek <[email protected]>2008-03-21 23:05:04 +0000
commit5ff55648127c8a8e1b9829775045af986e37647c (patch)
treeb28209b1efe12824fbdcabd4ee9073e93ca30636 /lib/findbugs
parentfca34200881fcaf7b84b4210f7a5f40c8925c4d1 (diff)
move stuff into trunk
Diffstat (limited to 'lib/findbugs')
-rw-r--r--lib/findbugs/lib/annotations.jarbin0 -> 10626 bytes
-rw-r--r--lib/findbugs/lib/asm-3.0_RC1.jarbin0 -> 42077 bytes
-rw-r--r--lib/findbugs/lib/asm-analysis-3.0_RC1.jarbin0 -> 17321 bytes
-rw-r--r--lib/findbugs/lib/asm-commons-3.0_RC1.jarbin0 -> 26053 bytes
-rw-r--r--lib/findbugs/lib/asm-tree-3.0_RC1.jarbin0 -> 21011 bytes
-rw-r--r--lib/findbugs/lib/asm-util-3.0_RC1.jarbin0 -> 32049 bytes
-rw-r--r--lib/findbugs/lib/asm-xml-3.0_RC1.jarbin0 -> 51245 bytes
-rw-r--r--lib/findbugs/lib/bcel.jarbin0 -> 646419 bytes
-rw-r--r--lib/findbugs/lib/dom4j-full.jarbin0 -> 513409 bytes
-rw-r--r--lib/findbugs/lib/findbugs-ant.jarbin0 -> 10839 bytes
-rw-r--r--lib/findbugs/lib/findbugs.jarbin0 -> 1234001 bytes
-rw-r--r--lib/findbugs/lib/findbugsGUI.jarbin0 -> 517946 bytes
-rw-r--r--lib/findbugs/plugin/coreplugin.jarbin0 -> 529856 bytes
-rw-r--r--lib/findbugs/xsl/default.xsl284
-rw-r--r--lib/findbugs/xsl/fancy.xsl743
-rw-r--r--lib/findbugs/xsl/plain.xsl202
-rw-r--r--lib/findbugs/xsl/summary.xsl240
17 files changed, 1469 insertions, 0 deletions
diff --git a/lib/findbugs/lib/annotations.jar b/lib/findbugs/lib/annotations.jar
new file mode 100644
index 0000000..238c87e
--- /dev/null
+++ b/lib/findbugs/lib/annotations.jar
Binary files differ
diff --git a/lib/findbugs/lib/asm-3.0_RC1.jar b/lib/findbugs/lib/asm-3.0_RC1.jar
new file mode 100644
index 0000000..68a44ed
--- /dev/null
+++ b/lib/findbugs/lib/asm-3.0_RC1.jar
Binary files differ
diff --git a/lib/findbugs/lib/asm-analysis-3.0_RC1.jar b/lib/findbugs/lib/asm-analysis-3.0_RC1.jar
new file mode 100644
index 0000000..0f56a17
--- /dev/null
+++ b/lib/findbugs/lib/asm-analysis-3.0_RC1.jar
Binary files differ
diff --git a/lib/findbugs/lib/asm-commons-3.0_RC1.jar b/lib/findbugs/lib/asm-commons-3.0_RC1.jar
new file mode 100644
index 0000000..4e1bac2
--- /dev/null
+++ b/lib/findbugs/lib/asm-commons-3.0_RC1.jar
Binary files differ
diff --git a/lib/findbugs/lib/asm-tree-3.0_RC1.jar b/lib/findbugs/lib/asm-tree-3.0_RC1.jar
new file mode 100644
index 0000000..97f17d0
--- /dev/null
+++ b/lib/findbugs/lib/asm-tree-3.0_RC1.jar
Binary files differ
diff --git a/lib/findbugs/lib/asm-util-3.0_RC1.jar b/lib/findbugs/lib/asm-util-3.0_RC1.jar
new file mode 100644
index 0000000..86e20a6
--- /dev/null
+++ b/lib/findbugs/lib/asm-util-3.0_RC1.jar
Binary files differ
diff --git a/lib/findbugs/lib/asm-xml-3.0_RC1.jar b/lib/findbugs/lib/asm-xml-3.0_RC1.jar
new file mode 100644
index 0000000..32a3b3c
--- /dev/null
+++ b/lib/findbugs/lib/asm-xml-3.0_RC1.jar
Binary files differ
diff --git a/lib/findbugs/lib/bcel.jar b/lib/findbugs/lib/bcel.jar
new file mode 100644
index 0000000..b422c1e
--- /dev/null
+++ b/lib/findbugs/lib/bcel.jar
Binary files differ
diff --git a/lib/findbugs/lib/dom4j-full.jar b/lib/findbugs/lib/dom4j-full.jar
new file mode 100644
index 0000000..1efbf7e
--- /dev/null
+++ b/lib/findbugs/lib/dom4j-full.jar
Binary files differ
diff --git a/lib/findbugs/lib/findbugs-ant.jar b/lib/findbugs/lib/findbugs-ant.jar
new file mode 100644
index 0000000..66129af
--- /dev/null
+++ b/lib/findbugs/lib/findbugs-ant.jar
Binary files differ
diff --git a/lib/findbugs/lib/findbugs.jar b/lib/findbugs/lib/findbugs.jar
new file mode 100644
index 0000000..04a7856
--- /dev/null
+++ b/lib/findbugs/lib/findbugs.jar
Binary files differ
diff --git a/lib/findbugs/lib/findbugsGUI.jar b/lib/findbugs/lib/findbugsGUI.jar
new file mode 100644
index 0000000..cbe77b0
--- /dev/null
+++ b/lib/findbugs/lib/findbugsGUI.jar
Binary files differ
diff --git a/lib/findbugs/plugin/coreplugin.jar b/lib/findbugs/plugin/coreplugin.jar
new file mode 100644
index 0000000..813d2b8
--- /dev/null
+++ b/lib/findbugs/plugin/coreplugin.jar
Binary files differ
diff --git a/lib/findbugs/xsl/default.xsl b/lib/findbugs/xsl/default.xsl
new file mode 100644
index 0000000..efa2307
--- /dev/null
+++ b/lib/findbugs/xsl/default.xsl
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ FindBugs - Find bugs in Java programs
+ Copyright (C) 2004,2005 University of Maryland
+ Copyright (C) 2005, Chris Nappin
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-->
+
+<!--
+ A simple XSLT stylesheet to transform FindBugs XML results
+ annotated with messages into HTML.
+
+ If you want to experiment with modifying this stylesheet,
+ or write your own, you need to generate XML output from FindBugs
+ using a special option which lets it know to include
+ human-readable messages in the XML. Invoke the findbugs script
+ as follows:
+
+ findbugs -textui -xml:withMessages -project myProject.fb > results.xml
+
+ Then you can use your favorite XSLT implementation to transform
+ the XML output into HTML. (But don't use xsltproc. It generates well-nigh
+ unreadable output, and generates incorrect output for the
+ <script> element.)
+
+ Authors:
+ David Hovemeyer
+ Chris Nappin (summary table)
+-->
+
+<xsl:stylesheet
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output
+ method="xml"
+ omit-xml-declaration="yes"
+ standalone="yes"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+ indent="yes"
+ encoding="UTF-8"/>
+
+<xsl:variable name="literalNbsp">&amp;nbsp;</xsl:variable>
+
+<!--xsl:key name="bug-category-key" match="/BugCollection/BugInstance" use="@category"/-->
+
+<xsl:variable name="bugTableHeader">
+ <tr class="tableheader">
+ <th align="left">Code<xsl:value-of select="$literalNbsp" disable-output-escaping="yes"/></th>
+ <th align="left">Warning</th>
+ </tr>
+</xsl:variable>
+
+<xsl:template match="/">
+ <html>
+ <head>
+ <title>FindBugs Report</title>
+ <style type="text/css">
+ .tablerow0 {
+ background: #EEEEEE;
+ }
+
+ .tablerow1 {
+ background: white;
+ }
+
+ .detailrow0 {
+ background: #EEEEEE;
+ }
+
+ .detailrow1 {
+ background: white;
+ }
+
+ .tableheader {
+ background: #b9b9fe;
+ font-size: larger;
+ }
+
+ .tablerow0:hover, .tablerow1:hover {
+ background: #aaffaa;
+ }
+
+ .priority-1 {
+ color: red;
+ font-weight: bold;
+ }
+ .priority-2 {
+ color: orange;
+ font-weight: bold;
+ }
+ .priority-3 {
+ color: green;
+ font-weight: bold;
+ }
+ .priority-4 {
+ color: blue;
+ font-weight: bold;
+ }
+ </style>
+ <script type="text/javascript">
+ function toggleRow(elid) {
+ if (document.getElementById) {
+ element = document.getElementById(elid);
+ if (element) {
+ if (element.style.display == 'none') {
+ element.style.display = 'block';
+ //window.status = 'Toggle on!';
+ } else {
+ element.style.display = 'none';
+ //window.status = 'Toggle off!';
+ }
+ }
+ }
+ }
+ </script>
+ </head>
+
+ <xsl:variable name="unique-catkey" select="/BugCollection/BugCategory/@category"/>
+ <!--xsl:variable name="unique-catkey" select="/BugCollection/BugInstance[generate-id() = generate-id(key('bug-category-key',@category))]/@category"/-->
+
+ <body>
+
+ <h1>FindBugs Report</h1>
+
+ <h2>Project Information</h2>
+ <xsl:apply-templates select="/BugCollection/Project"/>
+
+ <h2>Contents</h2>
+ <ul>
+ <xsl:for-each select="$unique-catkey">
+ <xsl:sort select="." order="ascending"/>
+ <xsl:variable name="catkey" select="."/>
+ <xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>
+
+ <li><a href="#Warnings_{$catkey}"><xsl:value-of select="$catdesc"/> Warnings</a></li>
+ </xsl:for-each>
+
+ <li><a href="#Details">Details</a></li>
+ </ul>
+
+ <h1>Summary</h1>
+ <table width="500" cellpadding="5" cellspacing="2">
+ <tr class="tableheader">
+ <th align="left">Warning Type</th>
+ <th align="right">Number</th>
+ </tr>
+
+ <xsl:for-each select="$unique-catkey">
+ <xsl:sort select="." order="ascending"/>
+ <xsl:variable name="catkey" select="."/>
+ <xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>
+ <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])"/></td>
+ </tr>
+ </xsl:for-each>
+
+ <xsl:variable name="styleclass">
+ <xsl:choose><xsl:when test="count($unique-catkey) mod 2 = 0">tablerow0</xsl:when>
+ <xsl:otherwise>tablerow1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <tr class="{$styleclass}">
+ <td><b>Total</b></td>
+ <td align="right"><b><xsl:value-of select="count(/BugCollection/BugInstance)"/></b></td>
+ </tr>
+ </table>
+
+ <h1>Warnings</h1>
+
+ <p>Click on a warning row to see full context information.</p>
+
+ <xsl:for-each select="$unique-catkey">
+ <xsl:sort select="." order="ascending"/>
+ <xsl:variable name="catkey" select="."/>
+ <xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>
+
+ <xsl:call-template name="generateWarningTable">
+ <xsl:with-param name="warningSet" select="/BugCollection/BugInstance[@category=$catkey]"/>
+ <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:call-template>
+ </xsl:for-each>
+
+ <h1><a name="Details">Details</a></h1>
+
+ <xsl:apply-templates select="/BugCollection/BugPattern">
+ <xsl:sort select="@abbrev"/>
+ <xsl:sort select="ShortDescription"/>
+ </xsl:apply-templates>
+
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="Project">
+ <p>Project: <xsl:value-of select="@filename"/></p>
+ <p>FindBugs version: <xsl:value-of select="/BugCollection/@version"/></p>
+
+ <p>Code analyzed:</p>
+ <ul>
+ <xsl:for-each select="./Jar">
+ <li><xsl:value-of select="text()"/></li>
+ </xsl:for-each>
+ </ul>
+</xsl:template>
+
+<xsl:template match="BugInstance">
+ <xsl:variable name="warningId"><xsl:value-of select="generate-id()"/></xsl:variable>
+
+ <tr class="tablerow{position() mod 2}" onclick="toggleRow('{$warningId}');">
+
+ <td>
+ <span><xsl:attribute name="class">priority-<xsl:value-of select="@priority"/></xsl:attribute>
+ <xsl:value-of select="@abbrev"/>
+ </span>
+ </td>
+
+ <td>
+ <xsl:value-of select="LongMessage"/>
+ </td>
+
+ </tr>
+
+ <!-- Add bug annotation elements: Class, Method, Field, SourceLine, Field -->
+ <tr class="detailrow{position() mod 2}">
+ <td/>
+ <td>
+ <p id="{$warningId}" style="display: none;">
+ <a href="#{@type}">Bug type <xsl:value-of select="@type"/> (click for details)</a>
+ <xsl:for-each select="./*/Message">
+ <br/><xsl:value-of select="text()"/>
+ </xsl:for-each>
+ </p>
+ </td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="BugPattern">
+ <h2><a name="{@type}"><xsl:value-of select="@type"/>: <xsl:value-of select="ShortDescription"/></a></h2>
+ <xsl:value-of select="Details" disable-output-escaping="yes"/>
+</xsl:template>
+
+<xsl:template name="generateWarningTable">
+ <xsl:param name="warningSet"/>
+ <xsl:param name="sectionTitle"/>
+ <xsl:param name="sectionId"/>
+
+ <h2><a name="{$sectionId}"><xsl:value-of select="$sectionTitle"/></a></h2>
+ <table class="warningtable" width="100%" cellspacing="0">
+ <xsl:copy-of select="$bugTableHeader"/>
+ <xsl:apply-templates select="$warningSet">
+ <xsl:sort select="@abbrev"/>
+ <xsl:sort select="Class/@classname"/>
+ </xsl:apply-templates>
+ </table>
+</xsl:template>
+
+</xsl:stylesheet>
+
+<!-- vim:set ts=4: -->
diff --git a/lib/findbugs/xsl/fancy.xsl b/lib/findbugs/xsl/fancy.xsl
new file mode 100644
index 0000000..59092a1
--- /dev/null
+++ b/lib/findbugs/xsl/fancy.xsl
@@ -0,0 +1,743 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright (C) 2005, Etienne Giraudy, InStranet Inc
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
+ <xsl:output
+ method="xml" indent="yes"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+ doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+ encoding="UTF-8"/>
+
+ <!--xsl:key name="lbc-category-key" match="/BugCollection/BugInstance" use="@category" /-->
+ <xsl:key name="lbc-code-key" match="/BugCollection/BugInstance" use="concat(@category,@abbrev)" />
+ <xsl:key name="lbc-bug-key" match="/BugCollection/BugInstance" use="concat(@category,@abbrev,@type)" />
+
+ <xsl:key name="lbp-class-bug-type" match="/BugCollection/BugInstance" use="concat(Class/@classname,@type)" />
+
+
+<xsl:template match="/" >
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <title>FindBugs (<xsl:value-of select="/BugCollection/@version" />) Analysis for <xsl:value-of select="/BugCollection/Project/@filename" /></title>
+ <script type="text/javascript">
+ function show(foo) {
+ document.getElementById(foo).style.display="block";
+ }
+ function hide(foo) {
+ document.getElementById(foo).style.display="none";
+ }
+ function toggle(foo) {
+ if( document.getElementById(foo).style.display == "none") {
+ show(foo);
+ } else {
+ if( document.getElementById(foo).style.display == "block") {
+ hide(foo);
+ } else {
+ show(foo);
+ }
+ }
+ }
+ function showmenu(foo) {
+ if( document.getElementById(foo).style.display == "none") {
+ hide("bug-summary");
+ document.getElementById("bug-summary-tab").className="menu-tab";
+ hide("analysis-data");
+ document.getElementById("analysis-data-tab").className="menu-tab";
+ //hide("list-by-bug-type");
+ //document.getElementById("list-by-bug-type-tab").className="menu-tab";
+ hide("list-by-package");
+ document.getElementById("list-by-package-tab").className="menu-tab";
+ hide("list-by-category");
+ document.getElementById("list-by-category-tab").className="menu-tab";
+ document.getElementById(foo+"-tab").className="menu-tab-selected";
+ show(foo);
+ }
+ // else menu already selected!
+ }
+ </script>
+ <style type='text/css'>
+ html, body {
+ background-color: #ffffff;
+ }
+ a, a:link , a:active, a:visited, a:hover {
+ text-decoration: none; color: black;
+ }
+ div, span {
+ vertical-align: top;
+ }
+ p {
+ margin: 0px;
+ }
+ #header {
+ width: 100%;
+ text-align: center;
+ margin-bottom: 5px;
+ font-size: 14pt;
+ color: red;
+ }
+ #menu {
+ margin-bottom: 10px;
+ }
+ #menu ul {
+ margin-left: 0;
+ padding-left: 0;
+ display: inline;
+ }
+ #menu ul li {
+ margin-left: 0;
+ margin-bottom: 0;
+ padding: 2px 15px 5px;
+ border: 1px solid #000;
+ list-style: none;
+ display: inline;
+ }
+ #menu ul li.here {
+ border-bottom: 1px solid #ffc;
+ list-style: none;
+ display: inline;
+ }
+ .menu-tab {
+ background: white;
+ }
+ .menu-tab:hover {
+ background: grey;
+ }
+ .menu-tab-selected {
+ background: #aaaaaa;
+ }
+ #analysis-data ul {
+ margin-left: 15px;
+ }
+ #analyzed-files, #used-libraries, #analysis-error {
+ float: left;
+ margin: 2px;
+ border: 1px black solid;
+ padding: 2px;
+ overflow:auto;
+ }
+ #analyzed-files {
+ width: 25%;
+ }
+ #used-libraries {
+ width: 25%;
+ }
+ #analysis-error {
+ width: 40%;
+ }
+ div.summary {
+ width:100%;
+ text-align:center;
+ }
+ .summary table {
+ border:1px solid black;
+ }
+ .summary th {
+ background: #aaaaaa;
+ color: white;
+ }
+ .summary th, .summary td {
+ padding: 2px 4px 2px 4px;
+ }
+ .summary-name {
+ background: #eeeeee;
+ text-align:left;
+ }
+ .summary-size {
+ background: #eeeeee;
+ text-align:center;
+ }
+ .summary-ratio {
+ background: #eeeeee;
+ text-align:center;
+ }
+ .summary-priority-all {
+ background: #dddddd;
+ text-align:center;
+ }
+ .summary-priority-1 {
+ background: red;
+ text-align:center;
+ }
+ .summary-priority-2 {
+ background: orange;
+ text-align:center;
+ }
+ .summary-priority-3 {
+ background: green;
+ text-align:center;
+ }
+ .summary-priority-4 {
+ background: blue;
+ text-align:center;
+ }
+ .outerbox {
+ border: 1px solid black;
+ margin: 10px;
+ }
+ .outerbox-title {
+ border-bottom: 1px solid #000000; font-size: 12pt; font-weight: bold;
+ background: #cccccc; margin: 0; padding: 0 5px 0 5px;
+ }
+ .title-help {
+ font-weight: normal;
+ }
+ .innerbox-1, .innerbox-2 {
+ margin: 0 0 0 10px;
+ }
+ .innerbox-1-title, .innerbox-2-title {
+ border-bottom: 1px solid #000000; border-left: 1px solid #000000;
+ margin: 0; padding: 0 5px 0 5px;
+ font-size: 12pt; font-weight: bold; background: #cccccc;
+ }
+ .bug-box {
+ border-bottom: 1px solid #000000; border-left: 1px solid #000000;
+ }
+ .bug-priority-1 {
+ background: red; height: 0.5em; width: 1em;
+ margin-right: 0.5em;
+ }
+ .bug-priority-2 {
+ background: orange; height: 0.5em; width: 1em;
+ margin-right: 0.5em;
+ }
+ .bug-priority-3 {
+ background: green; height: 0.5em; width: 1em;
+ margin-right: 0.5em;
+ }
+ .bug-priority-4 {
+ background: blue; height: 0.5em; width: 1em;
+ margin-right: 0.5em;
+ }
+ .bug-type {
+ }
+ .bug-ref {
+ font-size: 10pt; font-weight: bold; padding: 0 0 0 60px;
+ }
+ .bug-descr {
+ font-weight: normal; background: #eeeee0;
+ padding: 0 5px 0 5px; border-bottom: 1px dashed black; margin: 0px;
+ }
+ .bug-details {
+ font-weight: normal; background: #eeeee0;
+ padding: 0 5px 0 5px; margin: 0px;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="header">
+ FindBugs (<xsl:value-of select="/BugCollection/@version" />) Analysis for <xsl:value-of select="/BugCollection/Project/@filename" />
+ </div>
+ <div id="menu">
+ <ul>
+ <li id='bug-summary-tab' class='menu-tab-selected'>
+ <xsl:attribute name="onclick">showmenu('bug-summary');return false;</xsl:attribute>
+ <a href='' onclick='return false;'>Bug Summary</a>
+ </li>
+ <li id='analysis-data-tab' class='menu-tab'>
+ <xsl:attribute name="onclick">showmenu('analysis-data');return false;</xsl:attribute>
+ <a href='' onclick='return false;'>Analysis Information</a>
+ </li>
+ <li id='list-by-category-tab' class='menu-tab'>
+ <xsl:attribute name="onclick">showmenu('list-by-category');return false;</xsl:attribute>
+ <a href='' onclick='return false;'>List bugs by bug category</a>
+ </li>
+ <li id='list-by-package-tab' class='menu-tab'>
+ <xsl:attribute name="onclick">showmenu('list-by-package');return false;</xsl:attribute>
+ <a href='' onclick='return false;'>List bugs by package</a>
+ </li>
+ </ul>
+ </div>
+ <xsl:call-template name="generateSummary" />
+ <xsl:call-template name="analysis-data" />
+ <xsl:call-template name="list-by-category" />
+ <xsl:call-template name="list-by-package" />
+ </body>
+</html>
+</xsl:template>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- generate summary report from stats -->
+<xsl:template name="generateSummary" >
+<div class='summary' id='bug-summary'>
+ <h2>FindBugs Analysis generated at: <xsl:value-of select="/BugCollection/FindBugsSummary/@timestamp" /></h2>
+ <table>
+ <tr>
+ <th>Package</th>
+ <th>Code Size</th>
+ <th>Bugs</th>
+ <th>Bugs p1</th>
+ <th>Bugs p2</th>
+ <th>Bugs p3</th>
+ <th>Bugs Exp.</th>
+ <th>Ratio</th>
+ </tr>
+ <tr>
+ <td class='summary-name'>
+ Overall
+ (<xsl:value-of select="/BugCollection/FindBugsSummary/@num_packages" /> packages),
+ (<xsl:value-of select="/BugCollection/FindBugsSummary/@total_classes" /> classes)
+ </td>
+ <td class='summary-size'><xsl:value-of select="/BugCollection/FindBugsSummary/@total_size" /></td>
+ <td class='summary-priority-all'><xsl:value-of select="/BugCollection/FindBugsSummary/@total_bugs" /></td>
+ <td class='summary-priority-1'><xsl:value-of select="/BugCollection/FindBugsSummary/@priority_1" /></td>
+ <td class='summary-priority-2'><xsl:value-of select="/BugCollection/FindBugsSummary/@priority_2" /></td>
+ <td class='summary-priority-3'><xsl:value-of select="/BugCollection/FindBugsSummary/@priority_3" /></td>
+ <td class='summary-priority-4'><xsl:value-of select="/BugCollection/FindBugsSummary/@priority_4" /></td>
+ <td class='summary-ratio'></td>
+ </tr>
+ <xsl:for-each select="/BugCollection/FindBugsSummary/PackageStats">
+ <xsl:sort select="@package" />
+ <xsl:if test="@total_bugs!='0'" >
+ <tr>
+ <td class='summary-name'><xsl:value-of select="@package" /></td>
+ <td class='summary-size'><xsl:value-of select="@total_size" /></td>
+ <td class='summary-priority-all'><xsl:value-of select="@total_bugs" /></td>
+ <td class='summary-priority-1'><xsl:value-of select="@priority_1" /></td>
+ <td class='summary-priority-2'><xsl:value-of select="@priority_2" /></td>
+ <td class='summary-priority-3'><xsl:value-of select="@priority_3" /></td>
+ <td class='summary-priority-4'><xsl:value-of select="@priority_4" /></td>
+ <td class='summary-ratio'></td>
+<!--
+ <xsl:for-each select="ClassStats">
+ <xsl:if test="@bugs!='0'" >
+ <li>
+ <xsl:value-of select="@class" /> - total: <xsl:value-of select="@bugs" />
+ </li>
+ </xsl:if>
+ </xsl:for-each>
+-->
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </table>
+</div>
+</xsl:template>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- display analysis info -->
+<xsl:template name="analysis-data">
+ <div id='analysis-data' style='display:none;'>
+ <div id='analyzed-files'>
+ Analyzed Files:
+ <ul>
+ <xsl:for-each select="/BugCollection/Project/Jar">
+ <li><xsl:apply-templates /></li>
+ </xsl:for-each>
+ </ul>
+ </div>
+ <div id='used-libraries'>
+ Used Libraries:
+ <ul>
+ <xsl:for-each select="/BugCollection/Project/AuxClasspathEntry">
+ <li><xsl:apply-templates /></li>
+ </xsl:for-each>
+ <xsl:if test="count(/BugCollection/Project/AuxClasspathEntry)=0" >
+ <li>None</li>
+ </xsl:if>
+ </ul>
+ </div>
+ <div id='analysis-error'>
+ Analysis Errors:
+ <ul>
+ <xsl:variable name="error-count"
+ select="count(/BugCollection/Errors/MissingClass)" />
+ <xsl:if test="$error-count=0" >
+ <li>None</li>
+ </xsl:if>
+ <xsl:if test="$error-count>0" >
+ <li>Missing ref classes for analysis:
+ <ul>
+ <xsl:for-each select="/BugCollection/Errors/MissingClass">
+ <li><xsl:apply-templates /></li>
+ </xsl:for-each>
+ </ul>
+ </li>
+ </xsl:if>
+ </ul>
+ </div>
+ </div>
+</xsl:template>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- show priorities helper -->
+<xsl:template name="helpPriorities">
+ <span>
+ <xsl:attribute name="class">bug-priority-1</xsl:attribute>
+ &#160;&#160;
+ </span> P1
+ <span>
+ <xsl:attribute name="class">bug-priority-2</xsl:attribute>
+ &#160;&#160;
+ </span> P2
+ <span>
+ <xsl:attribute name="class">bug-priority-3</xsl:attribute>
+ &#160;&#160;
+ </span> P3
+ <span>
+ <xsl:attribute name="class">bug-priority-4</xsl:attribute>
+ &#160;&#160;
+ </span> Exp.
+</xsl:template>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- display the details of a bug -->
+<xsl:template name="display-bug" >
+ <xsl:param name="bug-type" select="''" />
+ <xsl:param name="bug-id" select="''" />
+ <xsl:param name="which-list" select="''" />
+ <div class="bug-box">
+ <a>
+ <xsl:attribute name="href"></xsl:attribute>
+ <xsl:attribute name="onclick">toggle('<xsl:value-of select="$which-list" />-<xsl:value-of select="@uid" />');return false;</xsl:attribute>
+ <span>
+ <xsl:attribute name="class">bug-priority-<xsl:value-of select="@priority"/></xsl:attribute>
+ &#160;&#160;
+ </span>
+ <span class="bug-type"><xsl:value-of select="@abbrev" />: </span> <xsl:value-of select="Class/Message" />
+ </a>
+ <div style="display:none;">
+ <xsl:attribute name="id"><xsl:value-of select="$which-list" />-<xsl:value-of select="@uid" /></xsl:attribute>
+ <xsl:for-each select="*/Message">
+ <div class="bug-ref"><xsl:apply-templates /></div>
+ </xsl:for-each>
+ <div class="bug-descr">
+ <xsl:value-of select="LongMessage" disable-output-escaping="no" />
+ </div>
+ <div class="bug-details"><xsl:value-of select="/BugCollection/BugPattern[@type=$bug-type]/Details" disable-output-escaping="yes" /></div>
+ </div>
+ </div>
+</xsl:template>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- main template for the list by category -->
+<xsl:template name="list-by-category" >
+ <div id='list-by-category' class='data-box' style='display:none;'>
+ <xsl:call-template name="helpPriorities" />
+ <xsl:variable name="unique-category" select="/BugCollection/BugCategory/@category"/>
+ <!--xsl:variable name="unique-category" select="/BugCollection/BugInstance[generate-id() = generate-id(key('lbc-category-key',@category))]/@category" /-->
+ <xsl:for-each select="$unique-category">
+ <xsl:sort select="." order="ascending" />
+ <xsl:call-template name="categories">
+ <xsl:with-param name="category" select="." />
+ </xsl:call-template>
+ </xsl:for-each>
+ </div>
+</xsl:template>
+
+<xsl:template name="categories" >
+ <xsl:param name="category" select="''" />
+ <xsl:variable name="category-count"
+ select="count(/BugCollection/BugInstance[@category=$category])" />
+ <xsl:variable name="category-count-p1"
+ select="count(/BugCollection/BugInstance[@category=$category and @priority='1'])" />
+ <xsl:variable name="category-count-p2"
+ select="count(/BugCollection/BugInstance[@category=$category and @priority='2'])" />
+ <xsl:variable name="category-count-p3"
+ select="count(/BugCollection/BugInstance[@category=$category and @priority='3'])" />
+ <xsl:variable name="category-count-p4"
+ select="count(/BugCollection/BugInstance[@category=$category and @priority='4'])" />
+ <div class='outerbox'>
+ <div class='outerbox-title'>
+ <a>
+ <xsl:attribute name="href"></xsl:attribute>
+ <xsl:attribute name="onclick">toggle('category-<xsl:value-of select="$category" />');return false;</xsl:attribute>
+ <xsl:value-of select="/BugCollection/BugCategory[@category=$category]/Description" />
+ (<xsl:value-of select="$category-count" />:
+ <span class='title-help'><xsl:value-of select="$category-count-p1" />/<xsl:value-of select="$category-count-p2" />/<xsl:value-of select="$category-count-p3" />/<xsl:value-of select="$category-count-p4" /></span>)
+ </a>
+ </div>
+ <div style="display:none;">
+ <xsl:attribute name="id">category-<xsl:value-of select="$category" /></xsl:attribute>
+ <xsl:call-template name="list-by-category-and-code">
+ <xsl:with-param name="category" select="$category" />
+ </xsl:call-template>
+ </div>
+ </div>
+</xsl:template>
+
+<xsl:template name="list-by-category-and-code" >
+ <xsl:param name="category" select="''" />
+ <xsl:variable name="unique-code" select="/BugCollection/BugInstance[@category=$category and generate-id()= generate-id(key('lbc-code-key',concat(@category,@abbrev)))]/@abbrev" />
+ <xsl:for-each select="$unique-code">
+ <xsl:sort select="." order="ascending" />
+ <xsl:call-template name="codes">
+ <xsl:with-param name="category" select="$category" />
+ <xsl:with-param name="code" select="." />
+ </xsl:call-template>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="codes" >
+ <xsl:param name="category" select="''" />
+ <xsl:param name="code" select="''" />
+ <xsl:variable name="code-count"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code])" />
+ <xsl:variable name="code-count-p1"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @priority='1'])" />
+ <xsl:variable name="code-count-p2"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @priority='2'])" />
+ <xsl:variable name="code-count-p3"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @priority='3'])" />
+ <xsl:variable name="code-count-p4"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @priority='4'])" />
+ <div class='innerbox-1'>
+ <div class="innerbox-1-title">
+ <a>
+ <xsl:attribute name="href"></xsl:attribute>
+ <xsl:attribute name="onclick">toggle('category-<xsl:value-of select="$category" />-and-code-<xsl:value-of select="$code" />');return false;</xsl:attribute>
+ <xsl:value-of select="$code" />: <xsl:value-of select="/BugCollection/BugCode[@abbrev=$code]/Description" />
+ (<xsl:value-of select="$code-count" />:
+ <span class='title-help'><xsl:value-of select="$code-count-p1" />/<xsl:value-of select="$code-count-p2" />/<xsl:value-of select="$code-count-p3" />/<xsl:value-of select="$code-count-p4" /></span>)
+ </a>
+ </div>
+ <div style="display:none;">
+ <xsl:attribute name="id">category-<xsl:value-of select="$category" />-and-code-<xsl:value-of select="$code" /></xsl:attribute>
+ <xsl:call-template name="list-by-category-and-code-and-bug">
+ <xsl:with-param name="category" select="$category" />
+ <xsl:with-param name="code" select="$code" />
+ </xsl:call-template>
+ </div>
+ </div>
+</xsl:template>
+
+<xsl:template name="list-by-category-and-code-and-bug" >
+ <xsl:param name="category" select="''" />
+ <xsl:param name="code" select="''" />
+ <xsl:variable name="unique-bug" select="/BugCollection/BugInstance[@category=$category and @abbrev=$code and generate-id()= generate-id(key('lbc-bug-key',concat(@category,@abbrev,@type)))]/@type" />
+ <xsl:for-each select="$unique-bug">
+ <xsl:sort select="." order="ascending" />
+ <xsl:call-template name="bugs">
+ <xsl:with-param name="category" select="$category" />
+ <xsl:with-param name="code" select="$code" />
+ <xsl:with-param name="bug" select="." />
+ </xsl:call-template>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="bugs" >
+ <xsl:param name="category" select="''" />
+ <xsl:param name="code" select="''" />
+ <xsl:param name="bug" select="''" />
+ <xsl:variable name="bug-count"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @type=$bug])" />
+ <xsl:variable name="bug-count-p1"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @type=$bug and @priority='1'])" />
+ <xsl:variable name="bug-count-p2"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @type=$bug and @priority='2'])" />
+ <xsl:variable name="bug-count-p3"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @type=$bug and @priority='3'])" />
+ <xsl:variable name="bug-count-p4"
+ select="count(/BugCollection/BugInstance[@category=$category and @abbrev=$code and @type=$bug and @priority='4'])" />
+ <div class='innerbox-2'>
+ <div class='innerbox-2-title'>
+ <a>
+ <xsl:attribute name="href"></xsl:attribute>
+ <xsl:attribute name="onclick">toggle('category-<xsl:value-of select="$category" />-and-code-<xsl:value-of select="$code" />-and-bug-<xsl:value-of select="$bug" />');return false;</xsl:attribute>
+ <xsl:attribute name="title"><xsl:value-of select="$bug" /></xsl:attribute>
+ <xsl:value-of select="/BugCollection/BugPattern[@category=$category and @abbrev=$code and @type=$bug]/ShortDescription" />&#160;&#160;
+ (<xsl:value-of select="$bug-count" />:
+ <span class='title-help'><xsl:value-of select="$bug-count-p1" />/<xsl:value-of select="$bug-count-p2" />/<xsl:value-of select="$bug-count-p3" />/<xsl:value-of select="$bug-count-p4" /></span>)
+ </a>
+ </div>
+ <div style="display:none;">
+ <xsl:attribute name="id">category-<xsl:value-of select="$category" />-and-code-<xsl:value-of select="$code" />-and-bug-<xsl:value-of select="$bug" /></xsl:attribute>
+ <xsl:variable name="cat-code-type">category-<xsl:value-of select="$category" />-and-code-<xsl:value-of select="$code" />-and-bug-<xsl:value-of select="$bug" /></xsl:variable>
+ <xsl:for-each select="/BugCollection/BugInstance[@category=$category and @abbrev=$code and @type=$bug]">
+ <xsl:call-template name="display-bug">
+ <xsl:with-param name="bug-type" select="@type" />
+ <xsl:with-param name="bug-id" select="@uid" />
+ <xsl:with-param name="which-list" select="$cat-code-type" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </div>
+ </div>
+</xsl:template>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- main template for the list by package -->
+<xsl:template name="list-by-package" >
+ <div id='list-by-package' class='data-box' style='display:none;'>
+ <xsl:call-template name="helpPriorities" />
+ <xsl:for-each select="/BugCollection/FindBugsSummary/PackageStats[@total_bugs != '0']/@package">
+ <xsl:sort select="." order="ascending" />
+ <xsl:call-template name="packages">
+ <xsl:with-param name="package" select="." />
+ </xsl:call-template>
+ </xsl:for-each>
+ </div>
+</xsl:template>
+
+<xsl:template name="packages" >
+ <xsl:param name="package" select="''" />
+ <xsl:variable name="package-count-p1">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_1 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_1 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_1" />
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="package-count-p2">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_2 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_2 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_2" />
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="package-count-p3">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_3 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_3 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_3" />
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="package-count-p4">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_4 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_4 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@priority_4" />
+ </xsl:if>
+ </xsl:variable>
+
+ <div class='outerbox'>
+ <div class='outerbox-title'>
+ <a>
+ <xsl:attribute name="href"></xsl:attribute>
+ <xsl:attribute name="onclick">toggle('package-<xsl:value-of select="$package" />');return false;</xsl:attribute>
+ <xsl:value-of select="$package" />
+ (<xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/@total_bugs" />:
+ <span class='title-help'><xsl:value-of select="$package-count-p1" />/<xsl:value-of select="$package-count-p2" />/<xsl:value-of select="$package-count-p3" />/<xsl:value-of select="$package-count-p4" /></span>)
+ </a>
+ </div>
+ <div style="display:none;">
+ <xsl:attribute name="id">package-<xsl:value-of select="$package" /></xsl:attribute>
+ <xsl:call-template name="list-by-package-and-class">
+ <xsl:with-param name="package" select="$package" />
+ </xsl:call-template>
+ </div>
+ </div>
+</xsl:template>
+
+<xsl:template name="list-by-package-and-class" >
+ <xsl:param name="package" select="''" />
+ <xsl:for-each select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@bugs != '0']/@class">
+ <xsl:sort select="." order="ascending" />
+ <xsl:call-template name="classes">
+ <xsl:with-param name="package" select="$package" />
+ <xsl:with-param name="class" select="." />
+ </xsl:call-template>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="classes" >
+ <xsl:param name="package" select="''" />
+ <xsl:param name="class" select="''" />
+ <xsl:variable name="class-count"
+ select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@bugs" />
+
+ <xsl:variable name="class-count-p1">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_1 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_1 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_1" />
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="class-count-p2">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_2 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_2 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_2" />
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="class-count-p3">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_3 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_3 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_3" />
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="class-count-p4">
+ <xsl:if test="not(/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_4 != '')">0</xsl:if>
+ <xsl:if test="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_4 != ''">
+ <xsl:value-of select="/BugCollection/FindBugsSummary/PackageStats[@package=$package]/ClassStats[@class=$class and @bugs != '0']/@priority_4" />
+ </xsl:if>
+ </xsl:variable>
+
+
+ <div class='innerbox-1'>
+ <div class="innerbox-1-title">
+ <a>
+ <xsl:attribute name="href"></xsl:attribute>
+ <xsl:attribute name="onclick">toggle('package-<xsl:value-of select="$package" />-and-class-<xsl:value-of select="$class" />');return false;</xsl:attribute>
+ <xsl:value-of select="$class" /> (<xsl:value-of select="$class-count" />:
+ <span class='title-help'><xsl:value-of select="$class-count-p1" />/<xsl:value-of select="$class-count-p2" />/<xsl:value-of select="$class-count-p3" />/<xsl:value-of select="$class-count-p4" /></span>)
+ </a>
+ </div>
+ <div style="display:none;">
+ <xsl:attribute name="id">package-<xsl:value-of select="$package" />-and-class-<xsl:value-of select="$class" /></xsl:attribute>
+ <xsl:call-template name="list-by-package-and-class-and-bug">
+ <xsl:with-param name="package" select="$package" />
+ <xsl:with-param name="class" select="$class" />
+ </xsl:call-template>
+ </div>
+ </div>
+</xsl:template>
+
+
+<xsl:template name="list-by-package-and-class-and-bug" >
+ <xsl:param name="package" select="''" />
+ <xsl:param name="class" select="''" />
+ <xsl:variable name="unique-class-bugs" select="/BugCollection/BugInstance[Class[position()=1 and @classname=$class] and generate-id() = generate-id(key('lbp-class-bug-type',concat(Class/@classname,@type)))]/@type" />
+
+ <xsl:for-each select="$unique-class-bugs">
+ <xsl:sort select="." order="ascending" />
+ <xsl:call-template name="class-bugs">
+ <xsl:with-param name="package" select="$package" />
+ <xsl:with-param name="class" select="$class" />
+ <xsl:with-param name="type" select="." />
+ </xsl:call-template>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="class-bugs" >
+ <xsl:param name="package" select="''" />
+ <xsl:param name="class" select="''" />
+ <xsl:param name="type" select="''" />
+ <xsl:variable name="bug-count"
+ select="count(/BugCollection/BugInstance[@type=$type and Class[position()=1 and @classname=$class]])" />
+ <div class='innerbox-2'>
+ <div class='innerbox-2-title'>
+ <a>
+ <xsl:attribute name="href"></xsl:attribute>
+ <xsl:attribute name="onclick">toggle('package-<xsl:value-of select="$package" />-and-class-<xsl:value-of select="$class" />-and-type-<xsl:value-of select="$type" />');return false;</xsl:attribute>
+ <xsl:attribute name="title"><xsl:value-of select="$type" /></xsl:attribute>
+ <xsl:value-of select="/BugCollection/BugPattern[@type=$type]/ShortDescription" />&#160;&#160;
+ (<xsl:value-of select="$bug-count" />)
+ </a>
+ </div>
+ <div style="display:none;">
+ <xsl:attribute name="id">package-<xsl:value-of select="$package" />-and-class-<xsl:value-of select="$class" />-and-type-<xsl:value-of select="$type" /></xsl:attribute>
+ <xsl:variable name="package-class-type">package-<xsl:value-of select="$package" />-and-class-<xsl:value-of select="$class" />-and-type-<xsl:value-of select="$type" /></xsl:variable>
+ <xsl:for-each select="/BugCollection/BugInstance[@type=$type and Class[position()=1 and @classname=$class]]">
+ <xsl:call-template name="display-bug">
+ <xsl:with-param name="bug-type" select="@type" />
+ <xsl:with-param name="bug-id" select="@uid" />
+ <xsl:with-param name="which-list" select="$package-class-type" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </div>
+ </div>
+</xsl:template>
+
+
+
+</xsl:transform> \ No newline at end of file
diff --git a/lib/findbugs/xsl/plain.xsl b/lib/findbugs/xsl/plain.xsl
new file mode 100644
index 0000000..d9dfaa3
--- /dev/null
+++ b/lib/findbugs/xsl/plain.xsl
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ FindBugs - Find bugs in Java programs
+ Copyright (C) 2004,2005 University of Maryland
+ Copyright (C) 2005, Chris Nappin
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-->
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output
+ method="html"
+ omit-xml-declaration="yes"
+ standalone="yes"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+ indent="yes"
+ encoding="UTF-8"/>
+
+<!--xsl:key name="bug-category-key" match="/BugCollection/BugInstance" use="@category"/-->
+
+<xsl:variable name="bugTableHeader">
+ <tr class="tableheader">
+ <th align="left">Warning</th>
+ <th align="left">Details</th>
+ </tr>
+</xsl:variable>
+
+<xsl:template match="/">
+ <html>
+ <head>
+ <title>FindBugs Report</title>
+ <style type="text/css">
+ .tablerow0 {
+ background: #EEEEEE;
+ }
+
+ .tablerow1 {
+ background: white;
+ }
+
+ .detailrow0 {
+ background: #EEEEEE;
+ }
+
+ .detailrow1 {
+ background: white;
+ }
+
+ .tableheader {
+ background: #b9b9fe;
+ font-size: larger;
+ }
+ </style>
+ </head>
+
+ <xsl:variable name="unique-catkey" select="/BugCollection/BugCategory/@category"/>
+ <!--xsl:variable name="unique-catkey" select="/BugCollection/BugInstance[generate-id() = generate-id(key('bug-category-key',@category))]/@category"/-->
+
+ <body>
+
+ <h1>FindBugs Report</h1>
+
+ <h2>Summary</h2>
+ <table width="500" cellpadding="5" cellspacing="2">
+ <tr class="tableheader">
+ <th align="left">Warning Type</th>
+ <th align="right">Number</th>
+ </tr>
+
+ <xsl:for-each select="$unique-catkey">
+ <xsl:sort select="." order="ascending"/>
+ <xsl:variable name="catkey" select="."/>
+ <xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>
+ <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])"/></td>
+ </tr>
+ </xsl:for-each>
+
+ <xsl:variable name="styleclass">
+ <xsl:choose><xsl:when test="count($unique-catkey) mod 2 = 0">tablerow0</xsl:when>
+ <xsl:otherwise>tablerow1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <tr class="{$styleclass}">
+ <td><b>Total</b></td>
+ <td align="right"><b><xsl:value-of select="count(/BugCollection/BugInstance)"/></b></td>
+ </tr>
+ </table>
+ <p><br/><br/></p>
+
+ <h1>Warnings</h1>
+
+ <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:sort select="." order="ascending"/>
+ <xsl:variable name="catkey" select="."/>
+ <xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>
+
+ <xsl:call-template name="generateWarningTable">
+ <xsl:with-param name="warningSet" select="/BugCollection/BugInstance[@category=$catkey]"/>
+ <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:call-template>
+ </xsl:for-each>
+
+ <p><br/><br/></p>
+ <h1><a name="Details">Warning Types</a></h1>
+
+ <xsl:apply-templates select="/BugCollection/BugPattern">
+ <xsl:sort select="@abbrev"/>
+ <xsl:sort select="ShortDescription"/>
+ </xsl:apply-templates>
+
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="BugInstance">
+ <xsl:variable name="warningId"><xsl:value-of select="generate-id()"/></xsl:variable>
+
+ <tr class="tablerow{position() mod 2}">
+ <td width="20%" valign="top">
+ <a href="#{@type}"><xsl:value-of select="ShortMessage"/></a>
+ </td>
+ <td width="80%">
+ <p><xsl:value-of select="LongMessage"/><br/><br/>
+
+ <!-- add source filename and line number(s), if any -->
+ <xsl:if test="SourceLine">
+ <br/>In file <xsl:value-of select="SourceLine/@sourcefile"/>,
+ <xsl:choose>
+ <xsl:when test="SourceLine/@start = SourceLine/@end">
+ line <xsl:value-of select="SourceLine/@start"/>
+ </xsl:when>
+ <xsl:otherwise>
+ lines <xsl:value-of select="SourceLine/@start"/>
+ to <xsl:value-of select="SourceLine/@end"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:for-each select="./*/Message">
+ <br/><xsl:value-of select="text()"/>
+ </xsl:for-each>
+ </p>
+ </td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="BugPattern">
+ <h2><a name="{@type}"><xsl:value-of select="ShortDescription"/></a></h2>
+ <xsl:value-of select="Details" disable-output-escaping="yes"/>
+ <p><br/><br/></p>
+</xsl:template>
+
+<xsl:template name="generateWarningTable">
+ <xsl:param name="warningSet"/>
+ <xsl:param name="sectionTitle"/>
+ <xsl:param name="sectionId"/>
+
+ <h2><a name="{$sectionId}"><xsl:value-of select="$sectionTitle"/></a></h2>
+ <table class="warningtable" width="100%" cellspacing="2" cellpadding="5">
+ <xsl:copy-of select="$bugTableHeader"/>
+ <xsl:choose>
+ <xsl:when test="count($warningSet) &gt; 0">
+ <xsl:apply-templates select="$warningSet">
+ <xsl:sort select="@abbrev"/>
+ <xsl:sort select="Class/@classname"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <tr><td colspan="2"><p><i>None</i></p></td></tr>
+ </xsl:otherwise>
+ </xsl:choose>
+ </table>
+ <p><br/><br/></p>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/lib/findbugs/xsl/summary.xsl b/lib/findbugs/xsl/summary.xsl
new file mode 100644
index 0000000..6bbe950
--- /dev/null
+++ b/lib/findbugs/xsl/summary.xsl
@@ -0,0 +1,240 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
+
+<xsl:output method="html"/>
+
+<xsl:param name="PAGE.TITLE" select="'Findbugs Summary Statistics'" />
+<xsl:param name="PAGE.FONT" select="'Arial'" />
+<xsl:param name="SUMMARY.HEADER" select="'Findbugs Summary Report'" />
+<xsl:param name="SUMMARY.LABEL" select="'Summary Analysis Generated at: '" />
+<xsl:param name="PACKAGE.HEADER" select="'Bugs By Package'" />
+<xsl:param name="PACKAGE.SORT.LABEL" select="'Sorted by Total Bugs'" />
+<xsl:param name="PACKAGE.LABEL" select="'Analysis of Package: '" />
+<xsl:param name="DEFAULT.PACKAGE.NAME" select="'default package'" />
+<xsl:param name="PACKAGE.BUGCLASS.LABEL" select="'Most Buggy Class in Package with #1 $1:'" />
+<xsl:param name="TOTAL.PACKAGES.LABEL" select="'#1 $1 Analyzed'" />
+
+<xsl:param name="BUGS.SINGLE.LABEL" select="'Bug'" />
+<xsl:param name="BUGS.PULURAL.LABEL" select="'Bugs'" />
+<xsl:param name="PACKAGE.SINGLE.LABEL" select="'Package'" />
+<xsl:param name="PACKAGE.PULURAL.LABEL" select="'Packages'" />
+
+
+<xsl:param name="TABLE.HEADING.TYPE" select="'Type Checked'" />
+<xsl:param name="TABLE.HEADING.COUNT" select="'Count'" />
+<xsl:param name="TABLE.HEADING.BUGS" select="'Bugs'" />
+<xsl:param name="TABLE.HEADING.PERCENT" select="'Percentage'" />
+<xsl:param name="TABLE.ROW.OUTER" select="'Outer Classes'" />
+<xsl:param name="TABLE.ROW.INNER" select="'Inner Classes'" />
+<xsl:param name="TABLE.ROW.INTERFACE" select="'Interfaces'" />
+<xsl:param name="TABLE.ROW.TOTAL" select="'Total'" />
+<xsl:param name="TABLE.WIDTH" select="'90%'" />
+
+<xsl:param name="PERCENTAGE.FORMAT" select="'#0.00%'" />
+
+<!-- This template drives the rest of the output -->
+<xsl:template match="/" >
+ <html>
+ <!-- JEditorPane gets really angry if it sees this -->
+ <!--<head><title><xsl:value-of select="$PAGE.TITLE" /></title></head> -->
+ <body>
+ <h1><center><xsl:value-of select="$SUMMARY.HEADER" /></center></h1>
+ <h2><center><xsl:value-of select="$SUMMARY.LABEL" />
+ <i><xsl:value-of select="//FindBugsSummary/@timestamp" /></i></center></h2>
+ <xsl:apply-templates select="//FindBugsSummary" />
+ <br/>
+ <center>
+ <font face="{$PAGE.FONT}" size="6"><xsl:value-of select="$PACKAGE.HEADER" /></font>
+ <br/><font face="{$PAGE.FONT}" size="4"><i>(<xsl:value-of select="$PACKAGE.SORT.LABEL"/>)</i></font>
+ </center>
+ <xsl:for-each select="//FindBugsSummary/PackageStats">
+ <xsl:sort select="@total_bugs" data-type="number" order="descending" />
+ <xsl:apply-templates select="." />
+ </xsl:for-each>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template name="status_table_row" >
+ <xsl:param name="LABEL" select="''" />
+ <xsl:param name="COUNT" select="1" />
+ <xsl:param name="BUGS" select="0" />
+ <xsl:param name="FONT_SIZE" select="4" />
+ <tr>
+ <td align="left"><font face="{$PAGE.FONT}" size="{$FONT_SIZE}"><xsl:value-of select="$LABEL" /></font></td>
+ <td align="center"><font face="{$PAGE.FONT}" color="green" size="{$FONT_SIZE}"><xsl:value-of select="$COUNT" /></font></td>
+ <td align="center"><font face="{$PAGE.FONT}" color="red" size="{$FONT_SIZE}"><xsl:value-of select="$BUGS" /></font></td>
+ <td align="center"><font face="{$PAGE.FONT}" color="blue" size="{$FONT_SIZE}">
+ <xsl:choose>
+ <xsl:when test="$COUNT &gt; 0">
+ <xsl:value-of select="format-number(number($BUGS div $COUNT), $PERCENTAGE.FORMAT)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="format-number(0, $PERCENTAGE.FORMAT)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </font>
+ </td>
+ </tr>
+</xsl:template>
+
+<xsl:template name="table_header" >
+ <tr>
+ <th><font face="{$PAGE.FONT}" size="4"><xsl:value-of select="$TABLE.HEADING.TYPE"/></font></th>
+ <th><font face="{$PAGE.FONT}" size="4"><xsl:value-of select="$TABLE.HEADING.COUNT"/></font></th>
+ <th><font face="{$PAGE.FONT}" size="4"><xsl:value-of select="$TABLE.HEADING.BUGS"/></font></th>
+ <th><font face="{$PAGE.FONT}" size="4"><xsl:value-of select="$TABLE.HEADING.PERCENT"/></font></th>
+ </tr>
+</xsl:template>
+
+<xsl:template match="FindBugsSummary" >
+ <center><table width="{$TABLE.WIDTH}" border="1">
+ <xsl:call-template name="table_header" />
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.OUTER" />
+ <xsl:with-param name="COUNT" select="count(PackageStats/ClassStats[@interface='false' and substring-after(@class,'$')=''])" />
+ <xsl:with-param name="BUGS" select="sum(PackageStats/ClassStats[@interface='false' and substring-after(@class,'$')='']/@bugs)" />
+ </xsl:call-template>
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.INNER" />
+ <xsl:with-param name="COUNT" select="count(PackageStats/ClassStats[@interface='false' and substring-after(@class,'$')!=''])" />
+ <xsl:with-param name="BUGS" select="sum(PackageStats/ClassStats[@interface='false' and substring-after(@class,'$')!='']/@bugs)" />
+ </xsl:call-template>
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.INTERFACE" />
+ <xsl:with-param name="COUNT" select="count(PackageStats/ClassStats[@interface='true'])" />
+ <xsl:with-param name="BUGS" select="sum(PackageStats/ClassStats[@interface='true']/@bugs)" />
+ </xsl:call-template>
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.TOTAL" />
+ <xsl:with-param name="COUNT" select="@total_classes" />
+ <xsl:with-param name="BUGS" select="@total_bugs"/>
+ <xsl:with-param name="FONT_SIZE" select="5"/>
+ </xsl:call-template>
+ <xsl:variable name="num_packages" select="count(PackageStats)" />
+ <tr><td align="center" colspan="4"><font face="{$PAGE.FONT}" size="4">
+ <xsl:call-template name='string_format'>
+ <xsl:with-param name="COUNT" select="$num_packages"/>
+ <xsl:with-param name="STRING" select="$TOTAL.PACKAGES.LABEL"/>
+ <xsl:with-param name="SINGLE" select="$PACKAGE.SINGLE.LABEL"/>
+ <xsl:with-param name="PULURAL" select="$PACKAGE.PULURAL.LABEL"/>
+ </xsl:call-template>
+ </font></td>
+ </tr>
+ </table></center>
+</xsl:template>
+
+
+<xsl:template name='string_format'>
+ <xsl:param name="COUNT" select="1"/>
+ <xsl:param name="STRING" select="''"/>
+ <xsl:param name="SINGLE" select="''"/>
+ <xsl:param name="PULURAL" select="''"/>
+ <xsl:variable name="count_str" select="concat(substring-before($STRING,'#1'), $COUNT, substring-after($STRING,'#1'))" />
+
+ <xsl:choose>
+ <xsl:when test="$COUNT &gt; 1">
+ <xsl:value-of select="concat(substring-before($count_str,'$1'), $PULURAL, substring-after($count_str,'$1'))" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(substring-before($count_str,'$1'), $SINGLE, substring-after($count_str,'$1'))" />
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match="PackageStats" >
+ <xsl:variable name="package-name">
+ <xsl:choose>
+ <xsl:when test="@package = ''">
+ <xsl:value-of select="$DEFAULT.PACKAGE.NAME"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@package"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="package-prefix">
+ <xsl:choose>
+ <xsl:when test="@package = ''">
+ <xsl:text></xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(@package,'.')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <center><h2><xsl:value-of select="$PACKAGE.LABEL"/><i><font color='green'><xsl:value-of select="$package-name" /></font></i></h2></center>
+ <center><table width="{$TABLE.WIDTH}" border="1">
+ <xsl:call-template name="table_header" />
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.OUTER" />
+ <xsl:with-param name="COUNT" select="count(ClassStats[@interface='false' and substring-after(@class,'$')=''])" />
+ <xsl:with-param name="BUGS" select="sum(ClassStats[@interface='false' and substring-after(@class,'$')='']/@bugs)" />
+ </xsl:call-template>
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.INNER" />
+ <xsl:with-param name="COUNT" select="count(ClassStats[@interface='false' and substring-after(@class,'$')!=''])" />
+ <xsl:with-param name="BUGS" select="sum(ClassStats[@interface='false' and substring-after(@class,'$')!='']/@bugs)" />
+ </xsl:call-template>
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.INTERFACE" />
+ <xsl:with-param name="COUNT" select="count(ClassStats[@interface='true'])" />
+ <xsl:with-param name="BUGS" select="sum(ClassStats[@interface='true']/@bugs)" />
+ </xsl:call-template>
+
+ <xsl:call-template name="status_table_row">
+ <xsl:with-param name="LABEL" select="$TABLE.ROW.TOTAL" />
+ <xsl:with-param name="COUNT" select="@total_types" />
+ <xsl:with-param name="BUGS" select="@total_bugs" />
+ <xsl:with-param name="FONT_SIZE" select="5"/>
+ </xsl:call-template>
+
+ </table>
+ <xsl:if test="@total_bugs &gt; 0">
+ <table width="{$TABLE.WIDTH}" border="0">
+ <xsl:variable name="max_bugs">
+ <xsl:for-each select="ClassStats">
+ <xsl:sort select="@bugs" data-type="number" order="descending"/>
+ <xsl:if test="position()=1">
+ <xsl:value-of select="@bugs"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <tr>
+ <td align="left" colspan="2">
+ <font face="{$PAGE.FONT}" size="4">
+ <xsl:call-template name='string_format'>
+ <xsl:with-param name="COUNT" select="$max_bugs"/>
+ <xsl:with-param name="STRING" select="$PACKAGE.BUGCLASS.LABEL"/>
+ <xsl:with-param name="SINGLE" select="$BUGS.SINGLE.LABEL"/>
+ <xsl:with-param name="PULURAL" select="$BUGS.PULURAL.LABEL"/>
+ </xsl:call-template>
+ </font>
+ </td>
+ </tr>
+
+ <xsl:for-each select="ClassStats">
+ <xsl:if test="@bugs = $max_bugs">
+ <tr>
+ <td>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</td>
+ <td align="left"><font face="{$PAGE.FONT}" color="red" size="4"><i><xsl:value-of select="$package-prefix"/><xsl:value-of select="@class" /></i></font></td>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+
+ </table>
+ </xsl:if>
+ </center>
+ <br/>
+</xsl:template>
+
+</xsl:stylesheet>