From: Eric P. <de...@us...> - 2004-07-29 18:09:57
|
dep4b 04/07/29 11:09:51 Modified: findbugs plugin.jelly findbugs/src/plugin-test maven.xml project.xml findbugs/xdocs changes.xml navigation.xml Added: findbugs/src/plugin-resources findbugs.jsl Log: Support new xdoc format and pretty "pmd" style report of results Revision Changes Path 1.6 +13 -19 maven-plugins/findbugs/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/plugin.jelly,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- plugin.jelly 29 Jul 2004 16:31:22 -0000 1.5 +++ plugin.jelly 29 Jul 2004 18:09:50 -0000 1.6 @@ -87,8 +87,8 @@ <findbugs classpathref="findbugs.classpath" pluginlistref="findbugs.pluginlist" reportLevel="${maven.findbugs.detail}" - output="xml" - outputFile="${maven.build.dir}/findbugs-raw-report.txt"> + output="xdocs" + outputFile="${maven.build.dir}/findbugs-raw-report.xml"> <j:forEach var="lib" items="${pom.artifacts}"> <auxClasspath path="${lib.path}"/> @@ -111,24 +111,18 @@ <class location="${maven.build.dest}" /> </findbugs> - - <j:set var="genDocs" value="${maven.gen.docs}" /> - <mkdir dir="${genDocs}"/> - <doc:text-xdoc - preamble=" - The following document contains the results of - FindBugs - http://findbugs.sourceforge.net/. - - This isn't formatted like a pretty CheckStyle / JDepend sheet as the FindBugs XML - output is very terse and does not describe what each error type is. We have no desire - to hardcode messages against FindBugs, so we'll wait until FindBugs XML output can be modified - to produce easy to use messages. - " - title="FindBugs Report" - section="FindBugs Results" - output="${genDocs}/findbugs-report.xml" - inputFile="${maven.build.dir}/findbugs-raw-report.txt"/> + <!-- Run JSL to transform the report into XDOC --> + + <echo>Converting the FindBugs report to xdoc ...</echo> + <doc:jsl + input="${maven.build.dir}/findbugs-raw-report.xml" + output="findbugs-report.xml" + stylesheet="${plugin.resources}/findbugs.jsl" + outputMode="xml" + prettyPrint="true" + /> + </goal> <!-- 1.3 +2 -2 maven-plugins/findbugs/src/plugin-test/maven.xml Index: maven.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-test/maven.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- maven.xml 29 Jul 2004 16:31:23 -0000 1.2 +++ maven.xml 29 Jul 2004 18:09:50 -0000 1.3 @@ -16,7 +16,7 @@ </goal> <goal name="test-findbugs"> - <j:set var="expectedFile" value="${maven.build.dir}/findbugs-raw-report.txt"/> + <j:set var="expectedFile" value="${maven.build.dir}/findbugs-raw-report.xml"/> <attainGoal name="findbugs"/> <util:file var="rawReport" name="${maven.build.dir}/test-reports/TEST-net.sf.mavenplugins.findbugs.MockUnitTest.txt" /> @@ -26,7 +26,7 @@ <util:file var="rawReport" name="${expectedFile}" /> <j:if test="${!(rawReport.exists())}"> - <fail>findbugs-raw-report.txt not generated</fail> + <fail>findbugs-raw-report.xml not generated</fail> </j:if> <delete file="${expectedFile}"/> </goal> 1.3 +1 -0 maven-plugins/findbugs/src/plugin-test/project.xml Index: project.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-test/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 29 Jul 2004 16:31:23 -0000 1.2 +++ project.xml 29 Jul 2004 18:09:50 -0000 1.3 @@ -28,5 +28,6 @@ <reports> <report>maven-findbugs-plugin</report> <report>maven-pmd-plugin</report> + <report>maven-jxr-plugin</report> </reports> </project> 1.8 +3 -0 maven-plugins/findbugs/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/xdocs/changes.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- changes.xml 29 Jul 2004 16:31:23 -0000 1.7 +++ changes.xml 29 Jul 2004 18:09:50 -0000 1.8 @@ -8,6 +8,9 @@ <body> <release version="0.8.2" date="29-JULY-2004"> <action dev="epugh" type="add"> + Switch to maven friendly raw report format. Add new "pmd" style report. + </action> + <action dev="epugh" type="add"> add maven.findbugs.detail which can be low, medium, or high to control which errors are displayed. </action> <action dev="epugh" type="add"> 1.4 +2 -0 maven-plugins/findbugs/xdocs/navigation.xml Index: navigation.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/xdocs/navigation.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- navigation.xml 19 Apr 2004 14:08:42 -0000 1.3 +++ navigation.xml 29 Jul 2004 18:09:50 -0000 1.4 @@ -15,8 +15,10 @@ <item name="Tasks" href="/tasks.html"/> </menu> <menu name="Downloads"> + <item name="0.8.2" href="http://maven-plugins.sourceforge.net/maven/plugins/maven-findbugs-plugin-0.8.2.jar"/> <item name="0.7.2" href="http://maven-plugins.sourceforge.net/maven/plugins/maven-findbugs-plugin-0.7.2.jar"/> <item name="0.7.1" href="http://maven-plugins.sourceforge.net/maven/plugins/maven-findbugs-plugin-0.7.1.jar"/> + </menu> </body> 1.1 maven-plugins/findbugs/src/plugin-resources/findbugs.jsl Index: findbugs.jsl =================================================================== <?xml version="1.0"?> <jsl:stylesheet select="$doc" xmlns:j="jelly:core" xmlns:jsl="jelly:jsl" xmlns:util="jelly:util" xmlns:x="jelly:xml" xmlns:doc="doc" xmlns="dummy" trim="false"> <!-- This needs to be instantiated here to be available in the template matches --> <j:useBean var="mavenTool" class="org.apache.maven.util.MavenTool"/> <j:useBean var="htmlescape" class="org.apache.velocity.anakia.Escape"/> <j:useBean var="fileutil" class="org.apache.velocity.texen.util.FileUtil"/> <j:useBean var="pathtool" class="org.apache.maven.util.DVSLPathTool"/> <jsl:template match="BugCollection"> <document> <properties> <title>FindBugs Results</title> </properties> <body> <section name="FindBugs Results"> <p> The following document contains the results of <a href="http://findbugs.sourceforge.net/">FindBugs</a>. </p> </section> <section name="Summary"> <j:set var="fileCount"><x:expr select="count(file)"/></j:set> <j:set var="errorCount"><x:expr select="count(file/BugInstance)"/></j:set> <table> <tr> <th>Files</th> <th>Errors</th> </tr> <tr> <td><doc:formatAsNumber string="${fileCount}" pattern="0"/></td> <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> </tr> </table> </section> <section name="Files"> <table> <tr> <th>Files</th> <th>Violations</th> </tr> <x:set var="files" select="file"/> <!-- x:forEach is busted --> <j:forEach var="file" items="${files}"> <j:set var="name" value="${file.attribute('classname').getValue()}"/> <!--- +1 is for the trailing slash above --> <j:set var="errorCount"><x:expr select="count($file/BugInstance)"/></j:set> <j:if test="${errorCount != 0}"> <tr> <td> <a href="#${name}">${name}</a> </td> <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> </tr> </j:if> </j:forEach> </table> <j:forEach var="file" items="${files}"> <x:set var="errorCount" select="count($file/BugInstance)"/> <j:if test="${errorCount != 0}"> <j:set var="name" value="${file.attribute('classname').getValue()}"/> <subsection name="${name}"> <table> <tr> <th>Violation</th> <th>Line</th> </tr> <x:set var="errors" select="$file/BugInstance"/> <j:forEach var="error" items="${errors}"> <tr> <td> <j:set var="errorMessage" value="${error.attribute('message').getValue()}"/> ${htmlescape.getText(errorMessage)} </td> <td> <j:set var="line" value="${error.attribute('line').getValue()}"/> <util:replace var="jxrName" value="${name}" oldChar="." newChar="/"/> <a href="xref/${jxrName}.html#${line}">${line}</a> </td> </tr> </j:forEach> </table> </subsection> </j:if> </j:forEach> </section> </body> </document> </jsl:template> </jsl:stylesheet> |
From: Eric P. <de...@us...> - 2005-11-01 16:32:45
|
dep4b 05/11/01 08:32:38 Modified: findbugs/src/plugin-resources findbugs.jsl Added: findbugs/src/plugin-test/src/java/net/sf/mavenplugins/findbugs ClassWithInnerClassWithErrorsForFindbugs.java Log: Properly create links to inner classes xref. Revision Changes Path 1.1 maven-plugins/findbugs/src/plugin-test/src/java/net/sf/mavenplugins/findbugs/ClassWithInnerClassWithErrorsForFindbugs.java Index: ClassWithInnerClassWithErrorsForFindbugs.java =================================================================== package net.sf.mavenplugins.findbugs; import java.util.Vector; /** * This is a simple example of a class with an innerclass that findbugs will analyze. It * should return one bug looking like: * "M UuF: Unused field: net.sf.mavenplugins.findbugs.MathUtil.mode:. * * and another bug like * Line * NS: Questionable use of non-short-circuit logic in net.sf.mavenplugins.findbugs.ClassWithErrorsForFindbugs.setValue(double) * * @author Eric Pugh */ public class ClassWithInnerClassWithErrorsForFindbugs{ public class InnerClass { public double unusedVariable; /**This method adds a new number to the data set and re-compute the mean, mean square, minimum and maximum values, and order statistics*/ public void setValue(double x){ double a, b; int size =0; boolean notInserted = true; //Add the value to the data set for (int i = 0; i < size - 1; i++){ a = 0; b = 0; if ((a <= x) & (x >= b)){ } } } } } 1.2 +10 -2 maven-plugins/findbugs/src/plugin-resources/findbugs.jsl Index: findbugs.jsl =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-resources/findbugs.jsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- findbugs.jsl 29 Jul 2004 18:09:51 -0000 1.1 +++ findbugs.jsl 1 Nov 2005 16:32:38 -0000 1.2 @@ -90,8 +90,16 @@ </td> <td> <j:set var="line" value="${error.attribute('line').getValue()}"/> - <util:replace var="jxrName" value="${name}" oldChar="." newChar="/"/> - <a href="xref/${jxrName}.html#${line}">${line}</a> + <util:replace var="jxrName1" value="${name}" oldChar="." newChar="/"/> + <util:tokenize var="jxrName2" delim="\$">${jxrName1}</util:tokenize> + + <j:set var="loopOnceVar" value="TRUE"/> + <j:forEach var="jxrName3" items="${jxrName2}"> + <j:if test="${loopOnceVar=='TRUE'}"> + <a href="xref/${jxrName3}.html#${line}">${line}</a> + <j:set var="loopOnceVar" value="FALSE"/> + </j:if> + </j:forEach> </td> </tr> </j:forEach> |
From: Jeff J. <jef...@us...> - 2006-05-02 05:37:14
|
jeffjensen 06/05/01 22:37:11 Modified: findbugs/src/plugin-resources findbugs.jsl Log: Make error msg a link to the FB site for the violation (opens in new window). Add "priority" column. Patch from Robert Zimmermann #1465572 - thanks! Revision Changes Path 1.3 +11 -5 maven-plugins/findbugs/src/plugin-resources/findbugs.jsl Index: findbugs.jsl =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-resources/findbugs.jsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- findbugs.jsl 1 Nov 2005 16:32:38 -0000 1.2 +++ findbugs.jsl 2 May 2006 05:37:11 -0000 1.3 @@ -80,27 +80,33 @@ <tr> <th>Violation</th> <th>Line</th> + <th>Priority</th> </tr> <x:set var="errors" select="$file/BugInstance"/> <j:forEach var="error" items="${errors}"> <tr> <td> <j:set var="errorMessage" value="${error.attribute('message').getValue()}"/> - ${htmlescape.getText(errorMessage)} + <a alt="Bug Description" title="Bug Description" target="_blank" + href="http://findbugs.sourceforge.net/bugDescriptions.html#${error.attribute('type').getValue()}"> + ${htmlescape.getText(errorMessage)} + </a> </td> <td> <j:set var="line" value="${error.attribute('line').getValue()}"/> - <util:replace var="jxrName1" value="${name}" oldChar="." newChar="/"/> - <util:tokenize var="jxrName2" delim="\$">${jxrName1}</util:tokenize> + <util:replace var="jxrName1" value="${name}" oldChar="." newChar="/"/> + <util:tokenize var="jxrName2" delim="\$">${jxrName1}</util:tokenize> - <j:set var="loopOnceVar" value="TRUE"/> - <j:forEach var="jxrName3" items="${jxrName2}"> + <j:set var="loopOnceVar" value="TRUE"/> + <j:forEach var="jxrName3" items="${jxrName2}"> <j:if test="${loopOnceVar=='TRUE'}"> <a href="xref/${jxrName3}.html#${line}">${line}</a> <j:set var="loopOnceVar" value="FALSE"/> </j:if> </j:forEach> </td> + <td>${error.attribute('priority').getValue()} + </td> </tr> </j:forEach> </table> |