Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: doc/manual/datamining.html

Issue 1232833004: Update findbugs from 3.0.0 to 3.0.1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/findbugs.git@master
Patch Set: rebase again Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « doc/manual/building.html ('k') | doc/manual/eclipse.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html><head> 1 <html><head>
2 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 2 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3 <title>Chapter&nbsp;12.&nbsp;Data mining of bugs with FindBugs&#8482;</title> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home " href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.ht ml" title="FindBugs&#8482; Manual"><link rel="prev" href="rejarForAnalysis.html" title="Chapter&nbsp;11.&nbsp;Using rejarForAnalysis"><link rel="next" href="lic ense.html" title="Chapter&nbsp;13.&nbsp;License"></head><body bgcolor="white" te xt="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader" ><table width="100%" summary="Navigation header"><tr><th colspan="3" align="cent er">Chapter&nbsp;12.&nbsp;Data mining of bugs with <span class="application">Fin dBugs</span>&#8482;</th></tr><tr><td width="20%" align="left"><a accesskey="p" h ref="rejarForAnalysis.html">Prev</a>&nbsp;</td><th width="60%" align="center">&n bsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="license.html ">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;1 2.&nbsp;Data mining of bugs with FindBugs&#8482;"><div class="titlepage"><div><d iv><h2 class="title"><a name="datamining"></a>Chapter&nbsp;12.&nbsp;Data mining of bugs with <span class="application">FindBugs</span>&#8482;</h2></div></div></ div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"> <a href="datamining.html#commands">1. Commands</a></span></dt><dt><span class="s ect1"><a href="datamining.html#examples">2. Examples</a></span></dt><dt><span cl ass="sect1"><a href="datamining.html#antexample">3. Ant example</a></span></dt>< /dl></div><p> 3 <title>Chapter&nbsp;12.&nbsp;Data mining of bugs with FindBugs&#8482;</title> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home " href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.ht ml" title="FindBugs&#8482; Manual"><link rel="prev" href="rejarForAnalysis.html" title="Chapter&nbsp;11.&nbsp;Using rejarForAnalysis"><link rel="next" href="lic ense.html" title="Chapter&nbsp;13.&nbsp;License"></head><body bgcolor="white" te xt="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader" ><table width="100%" summary="Navigation header"><tr><th colspan="3" align="cent er">Chapter&nbsp;12.&nbsp;Data mining of bugs with <span class="application">Fin dBugs</span>&#8482;</th></tr><tr><td width="20%" align="left"><a accesskey="p" h ref="rejarForAnalysis.html">Prev</a>&nbsp;</td><th width="60%" align="center">&n bsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="license.html ">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage "><div><div><h1 class="title"><a name="datamining"></a>Chapter&nbsp;12.&nbsp;Dat a mining of bugs with <span class="application">FindBugs</span>&#8482;</h1></div ></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt ><span class="sect1"><a href="datamining.html#commands">1. Commands</a></span></ dt><dt><span class="sect1"><a href="datamining.html#examples">2. Examples</a></s pan></dt><dt><span class="sect1"><a href="datamining.html#antexample">3. Ant exa mple</a></span></dt></dl></div><p>
4 FindBugs incorporates an ability to perform sophisticated queries on bug 4 FindBugs incorporates an ability to perform sophisticated queries on bug
5 databases and track warnings across multiple versions of code being 5 databases and track warnings across multiple versions of code being
6 studied, allowing you to do things such as seeing when a bug was first introduce d, examining 6 studied, allowing you to do things such as seeing when a bug was first introduce d, examining
7 just the warnings that have been introduced since the last release, or graphing the number 7 just the warnings that have been introduced since the last release, or graphing the number
8 of infinite recursive loops in your code over time.</p><p> 8 of infinite recursive loops in your code over time.</p><p>
9 These techniques all depend upon the XML format used by FindBugs for storing war nings. 9 These techniques all depend upon the XML format used by FindBugs for storing war nings.
10 These XML files usually contain just the warnings from one particular analysis r un, but 10 These XML files usually contain just the warnings from one particular analysis r un, but
11 they can also store the results from analyzing a sequence of software builds or versions. 11 they can also store the results from analyzing a sequence of software builds or versions.
12 </p><p> 12 </p><p>
13 Any FindBugs XML bug database contains a version name and timestamp. 13 Any FindBugs XML bug database contains a version name and timestamp.
(...skipping 18 matching lines...) Expand all
32 </p><pre class="programlisting"> 32 </p><pre class="programlisting">
33 33
34 &lt;!-- findbugs task definition --&gt; 34 &lt;!-- findbugs task definition --&gt;
35 &lt;property name="findbugs.home" value="/your/path/to/findbugs" /&gt; 35 &lt;property name="findbugs.home" value="/your/path/to/findbugs" /&gt;
36 &lt;path id="findbugs.lib"&gt; 36 &lt;path id="findbugs.lib"&gt;
37 &lt;fileset dir="${findbugs.home}/lib"&gt; 37 &lt;fileset dir="${findbugs.home}/lib"&gt;
38 &lt;include name="findbugs-ant.jar"/&gt; 38 &lt;include name="findbugs-ant.jar"/&gt;
39 &lt;/fileset&gt; 39 &lt;/fileset&gt;
40 &lt;/path&gt; 40 &lt;/path&gt;
41 41
42 </pre><div class="sect1" title="1.&nbsp;Commands"><div class="titlepage"><div><d iv><h2 class="title" style="clear: both"><a name="commands"></a>1.&nbsp;Commands </h2></div></div></div><p> 42 </pre><div class="sect1"><div class="titlepage"><div><div><h2 class="title" styl e="clear: both"><a name="commands"></a>1.&nbsp;Commands</h2></div></div></div><p >
43 All tools for FindBugs data mining are can be invoked from the command line, 43 All tools for FindBugs data mining are can be invoked from the command line,
44 and some of the more useful tools can also be invoked from an 44 and some of the more useful tools can also be invoked from an
45 ant build file.</p><p> 45 ant build file.</p><p>
46 Briefly, the command-line tools are:</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html #unionBugs" title="1.1.&nbsp;unionBugs">unionBugs</a></strong></span></span></dt ><dd><p> 46 Briefly, the command-line tools are:</p><div class="variablelist"><dl class="var iablelist"><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#unionBugs" title="1.1.&nbsp;unionBugs">unionBugs</a></stro ng></span></span></dt><dd><p>
47 combine the results from separate analysis of disjoint 47 combine the results from separate analysis of disjoint
48 classes 48 classes
49 </p></dd><dt><span class="term"><span class="command"><stron g><a class="link" href="datamining.html#computeBugHistory" title="1.2.&nbsp;comp uteBugHistory">computeBugHistory</a></strong></span></span></dt><dd><p>Merge bug warnings from multiple versions of 49 </p></dd><dt><span class="term"><span class="command"><stron g><a class="link" href="datamining.html#computeBugHistory" title="1.2.&nbsp;comp uteBugHistory">computeBugHistory</a></strong></span></span></dt><dd><p>Merge bug warnings from multiple versions of
50 analyzed code into 50 analyzed code into
51 a single multiversion bug database. This can either be used 51 a single multiversion bug database. This can either be used
52 to add more versions to an existing multiversion database, 52 to add more versions to an existing multiversion database,
53 or to create a multiversion database from a sequence of single versi on 53 or to create a multiversion database from a sequence of single versi on
54 bug warning databases.</p></dd><dt><span class="term"><span class="c ommand"><strong><a class="link" href="datamining.html#setBugDatabaseInfo" title= "1.7.&nbsp;setBugDatabaseInfo">setBugDatabaseInfo</a></strong></span></span></dt ><dd><p>Set information such as the revision name or 54 bug warning databases.</p></dd><dt><span class="term"><span class="c ommand"><strong><a class="link" href="datamining.html#setBugDatabaseInfo" title= "1.7.&nbsp;setBugDatabaseInfo">setBugDatabaseInfo</a></strong></span></span></dt ><dd><p>Set information such as the revision name or
55 timestamp in an XML bug database</p></dd><dt><span class="term"><span class="com mand"><strong><a class="link" href="datamining.html#listBugDatabaseInfo" title=" 1.8.&nbsp;listBugDatabaseInfo">listBugDatabaseInfo</a></strong></span></span></d t><dd><p>List information such as the revision name and 55 timestamp in an XML bug database</p></dd><dt><span class="term"><span class="com mand"><strong><a class="link" href="datamining.html#listBugDatabaseInfo" title=" 1.8.&nbsp;listBugDatabaseInfo">listBugDatabaseInfo</a></strong></span></span></d t><dd><p>List information such as the revision name and
56 timestamp for a list of XML bug databases</p></dd><dt><span class="term"><span c lass="command"><strong><a class="link" href="datamining.html#filterBugs" title=" 1.3.&nbsp;filterBugs">filterBugs</a></strong></span></span></dt><dd><p>Select a subset of a bug database</p></dd><dt><span class="term"><span class="command"><s trong><a class="link" href="datamining.html#mineBugHistory" title="1.4.&nbsp;min eBugHistory">mineBugHistory</a></strong></span></span></dt><dd><p>Generate a tab ular listing of the number of warnings in each 56 timestamp for a list of XML bug databases</p></dd><dt><span class="term"><span c lass="command"><strong><a class="link" href="datamining.html#filterBugs" title=" 1.3.&nbsp;filterBugs">filterBugs</a></strong></span></span></dt><dd><p>Select a subset of a bug database</p></dd><dt><span class="term"><span class="command"><s trong><a class="link" href="datamining.html#mineBugHistory" title="1.4.&nbsp;min eBugHistory">mineBugHistory</a></strong></span></span></dt><dd><p>Generate a tab ular listing of the number of warnings in each
57 version of a multiversion bug database</p></dd><dt><span class="term"><s pan class="command"><strong><a class="link" href="datamining.html#defectDensity" title="1.5.&nbsp;defectDensity">defectDensity</a></strong></span></span></dt><d d><p>List information about defect density 57 version of a multiversion bug database</p></dd><dt><span class="term"><s pan class="command"><strong><a class="link" href="datamining.html#defectDensity" title="1.5.&nbsp;defectDensity">defectDensity</a></strong></span></span></dt><d d><p>List information about defect density
58 (warnings per 1000 NCSS) 58 (warnings per 1000 NCSS)
59 for the entire project and each class and package</p></ dd><dt><span class="term"><span class="command"><strong><a class="link" href="da tamining.html#convertXmlToText" title="1.6.&nbsp;convertXmlToText">convertXmlToT ext</a></strong></span></span></dt><dd><p>Convert bug warnings in XML format to 59 for the entire project and each class and package</p></ dd><dt><span class="term"><span class="command"><strong><a class="link" href="da tamining.html#convertXmlToText" title="1.6.&nbsp;convertXmlToText">convertXmlToT ext</a></strong></span></span></dt><dd><p>Convert bug warnings in XML format to
60 a textual one-line-per-bug format, or to HTML</p></dd></dl>< /div><div class="sect2" title="1.1.&nbsp;unionBugs"><div class="titlepage"><div> <div><h3 class="title"><a name="unionBugs"></a>1.1.&nbsp;unionBugs</h3></div></d iv></div><p> 60 a textual one-line-per-bug format, or to HTML</p></dd></dl>< /div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a na me="unionBugs"></a>1.1.&nbsp;unionBugs</h3></div></div></div><p>
61 If you have, for example, separately analyzing each jar file used in an application, 61 If you have, for example, separately analyzing each jar file used in an application,
62 you can use this command to combine the separately generated xml bug war ning files into 62 you can use this command to combine the separately generated xml bug war ning files into
63 a single file containing all of the warnings.</p><p>Do <span class="emph asis"><em>not</em></span> use this command to combine results from analyzing dif ferent versions of the same 63 a single file containing all of the warnings.</p><p>Do <span class="emph asis"><em>not</em></span> use this command to combine results from analyzing dif ferent versions of the same
64 file; use <span class="command"><strong>computeBugHistory</strong></ span> instead.</p><p>Specify the xml files on the command line. The result is se nt to standard output.</p></div><div class="sect2" title="1.2.&nbsp;computeBugHi story"><div class="titlepage"><div><div><h3 class="title"><a name="computeBugHis tory"></a>1.2.&nbsp;computeBugHistory</h3></div></div></div><p>Use this command to generate a bug database containing information from different builds or versi ons 64 file; use <span class="command"><strong>computeBugHistory</strong></ span> instead.</p><p>Specify the xml files on the command line. The result is se nt to standard output.</p></div><div class="sect2"><div class="titlepage"><div>< div><h3 class="title"><a name="computeBugHistory"></a>1.2.&nbsp;computeBugHistor y</h3></div></div></div><p>Use this command to generate a bug database containin g information from different builds or versions
65 of software you are analyzing. 65 of software you are analyzing.
66 History is taken from the first file provided as input; any following 66 History is taken from the first file provided as input; any following
67 files should be single version bug databases (if they contain history, the histo ry in those 67 files should be single version bug databases (if they contain history, the histo ry in those
68 files will be ignored).</p><p>By default, output is written to the standard outp ut. 68 files will be ignored).</p><p>By default, output is written to the standard outp ut.
69 </p><p>This functionality may also can be accessed from ant. 69 </p><p>This functionality may also can be accessed from ant.
70 First create a taskdef for <span class="command"><strong>computeBugHistory</stro ng></span> in your 70 First create a taskdef for <span class="command"><strong>computeBugHistory</stro ng></span> in your
71 build file: 71 build file:
72 </p><pre class="programlisting"> 72 </p><pre class="programlisting">
73 73
74 &lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.Comp uteBugHistoryTask"&gt; 74 &lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.Comp uteBugHistoryTask"&gt;
75 &lt;classpath refid="findbugs.lib" /&gt; 75 &lt;classpath refid="findbugs.lib" /&gt;
76 &lt;/taskdef&gt; 76 &lt;/taskdef&gt;
77 77
78 </pre><p>Attributes for this ant task are listed in the following table. 78 </pre><p>Attributes for this ant task are listed in the following table.
79 To specify input files, nest them inside with a 79 To specify input files, nest them inside with a
80 <code class="literal">&lt;datafile&gt;</code> element. For example: 80 <code class="literal">&lt;datafile&gt;</code> element. For example:
81 </p><pre class="programlisting"> 81 </p><pre class="programlisting">
82 82
83 &lt;computeBugHistory home="${findbugs.home}" ...&gt; 83 &lt;computeBugHistory home="${findbugs.home}" ...&gt;
84 &lt;datafile name="analyze1.xml"/&gt; 84 &lt;datafile name="analyze1.xml"/&gt;
85 &lt;datafile name="analyze2.xml"/&gt; 85 &lt;datafile name="analyze2.xml"/&gt;
86 &lt;/computeBugHistory&gt; 86 &lt;/computeBugHistory&gt;
87 87
88 </pre><div class="table"><a name="computeBugHistoryTable"></a><p class="title">< b>Table&nbsp;12.1.&nbsp;Options for computeBugHistory command</b></p><div class= "table-contents"><table summary="Options for computeBugHistory command" border=" 1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr> </thead><tbody><tr><td align="left">-output &lt;file&gt;</td><td align="left">ou tput="&lt;file&gt;"</td><td align="left">save output in the named file (may also be an input file)</td></tr><tr><td align="left">-overrideRevisionNames[:truth]< /td><td align="left">overrideRevisionNames="[true|false]"</td><td align="left">o verride revision names for each version with names computed from the filenames</ td></tr><tr><td align="left">-noPackageMoves[:truth]</td><td align="left">noPack ageMoves="[true|false]"</td><td align="left">if a class has moved to another pac kage, treat warnings in that class as seperate</td></tr><tr><td align="left">-pr eciseMatch[:truth]</td><td align="left">preciseMatch="[true|false]"</td><td alig n="left">require bug patterns to match precisely</td></tr><tr><td align="left">- precisePriorityMatch[:truth]</td><td align="left">precisePriorityMatch="[true|fa lse]"</td><td align="left">consider two warnings as the same only if priorities match exactly</td></tr><tr><td align="left">-quiet[:truth]</td><td align="left"> quiet="[true|false]"</td><td align="left">don't generate any output to standard out unless there is an error</td></tr><tr><td align="left">-withMessages[:truth] </td><td align="left">withMessages="[true|false]"</td><td align="left">include h uman-readable messages describing the warnings in XML output</td></tr></tbody></ table></div></div><br class="table-break"></div><div class="sect2" title="1.3.&n bsp;filterBugs"><div class="titlepage"><div><div><h3 class="title"><a name="filt erBugs"></a>1.3.&nbsp;filterBugs</h3></div></div></div><p>This command is used t o select a subset of warnings from a FindBugs XML warning file 88 </pre><div class="table"><a name="computeBugHistoryTable"></a><p class="title">< b>Table&nbsp;12.1.&nbsp;Options for computeBugHistory command</b></p><div class= "table-contents"><table summary="Options for computeBugHistory command" border=" 1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr> </thead><tbody><tr><td align="left">-output &lt;file&gt;</td><td align="left">ou tput="&lt;file&gt;"</td><td align="left">save output in the named file (may also be an input file)</td></tr><tr><td align="left">-overrideRevisionNames[:truth]< /td><td align="left">overrideRevisionNames="[true|false]"</td><td align="left">o verride revision names for each version with names computed from the filenames</ td></tr><tr><td align="left">-noPackageMoves[:truth]</td><td align="left">noPack ageMoves="[true|false]"</td><td align="left">if a class has moved to another pac kage, treat warnings in that class as seperate</td></tr><tr><td align="left">-pr eciseMatch[:truth]</td><td align="left">preciseMatch="[true|false]"</td><td alig n="left">require bug patterns to match precisely</td></tr><tr><td align="left">- precisePriorityMatch[:truth]</td><td align="left">precisePriorityMatch="[true|fa lse]"</td><td align="left">consider two warnings as the same only if priorities match exactly</td></tr><tr><td align="left">-quiet[:truth]</td><td align="left"> quiet="[true|false]"</td><td align="left">don't generate any output to standard out unless there is an error</td></tr><tr><td align="left">-withMessages[:truth] </td><td align="left">withMessages="[true|false]"</td><td align="left">include h uman-readable messages describing the warnings in XML output</td></tr></tbody></ table></div></div><br class="table-break"></div><div class="sect2"><div class="t itlepage"><div><div><h3 class="title"><a name="filterBugs"></a>1.3.&nbsp;filterB ugs</h3></div></div></div><p>This command is used to select a subset of warnings from a FindBugs XML warning file
89 and write the selected subset to a new FindBugs warning file.</p><p> 89 and write the selected subset to a new FindBugs warning file.</p><p>
90 This command takes a sequence of options, and either zero, one or two 90 This command takes a sequence of options, and either zero, one or two
91 filenames of findbugs xml bug files on the command line.</p><p>If no file names are provided, the command reads from standard input 91 filenames of findbugs xml bug files on the command line.</p><p>If no file names are provided, the command reads from standard input
92 and writes to standard output. If one file name is provided, 92 and writes to standard output. If one file name is provided,
93 it reads from the file and writes to standard output. 93 it reads from the file and writes to standard output.
94 If two file names are provided, it reads from the first and writes the output 94 If two file names are provided, it reads from the first and writes the output
95 to the second file name.</p><p>This functionality may also can be accessed from ant. 95 to the second file name.</p><p>This functionality may also can be accessed from ant.
96 First create a taskdef for <span class="command"><strong>filterBugs</strong></sp an> in your 96 First create a taskdef for <span class="command"><strong>filterBugs</strong></sp an> in your
97 build file: 97 build file:
98 </p><pre class="programlisting"> 98 </p><pre class="programlisting">
99 99
100 &lt;taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsT ask"&gt; 100 &lt;taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsT ask"&gt;
101 &lt;classpath refid="findbugs.lib" /&gt; 101 &lt;classpath refid="findbugs.lib" /&gt;
102 &lt;/taskdef&gt; 102 &lt;/taskdef&gt;
103 103
104 </pre><p>Attributes for this ant task are listed in the following table. 104 </pre><p>Attributes for this ant task are listed in the following table.
105 To specify an input file either use the input attribute or nest it inside 105 To specify an input file either use the input attribute or nest it inside
106 the ant call with a <code class="literal">&lt;datafile&gt;</code> element. For example: 106 the ant call with a <code class="literal">&lt;datafile&gt;</code> element. For example:
107 </p><pre class="programlisting"> 107 </p><pre class="programlisting">
108 108
109 &lt;filterBugs home="${findbugs.home}" ...&gt; 109 &lt;filterBugs home="${findbugs.home}" ...&gt;
110 &lt;datafile name="analyze.xml"/&gt; 110 &lt;datafile name="analyze.xml"/&gt;
111 &lt;/filterBugs&gt; 111 &lt;/filterBugs&gt;
112 112
113 </pre><div class="table"><a name="filterOptionsTable"></a><p class="title"><b>Ta ble&nbsp;12.2.&nbsp;Options for filterBugs command</b></p><div class="table-cont ents"><table summary="Options for filterBugs command" border="1"><colgroup><col> <col><col></colgroup><thead><tr><th align="left">Command-line option</th><th ali gn="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr ><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align ="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="le ft">output="&lt;file&gt;"</td><td align="left">output results to file</td></tr>< tr><td align="left">-not</td><td align="left">not="[true|false]"</td><td align=" left">reverse (all) switches for the filter</td></tr><tr><td align="left">-withS ource[:truth]</td><td align="left">withSource="[true|false]"</td><td align="left ">only warnings for switch source is available</td></tr><tr><td align="left">-ex clude &lt;filter file&gt;</td><td align="left">exclude="&lt;filter file&gt;"</td ><td align="left">exclude bugs matching given filter</td></tr><tr><td align="lef t">-include &lt;filter file&gt;</td><td align="left">include="&lt;filter file&gt ;"</td><td align="left">include only bugs matching given filter</td></tr><tr><td align="left">-annotation &lt;text&gt;</td><td align="left">annotation="&lt;text &gt;"</td><td align="left">allow only warnings containing this text in a manual annotation</td></tr><tr><td align="left">-after &lt;when&gt;</td><td align="left ">after="&lt;when&gt;"</td><td align="left">allow only warnings that first occur red after this version</td></tr><tr><td align="left">-before &lt;when&gt;</td><t d align="left">before="&lt;when&gt;"</td><td align="left">allow only warnings th at first occurred before this version</td></tr><tr><td align="left">-first &lt;w hen&gt;</td><td align="left">first="&lt;when&gt;"</td><td align="left">allow onl y warnings that first occurred in this version</td></tr><tr><td align="left">-la st &lt;when&gt;</td><td align="left">last="&lt;when&gt;"</td><td align="left">al low only warnings that last occurred in this version</td></tr><tr><td align="lef t">-fixed &lt;when&gt;</td><td align="left">fixed="&lt;when&gt;"</td><td align=" left">allow only warnings that last occurred in the previous version (clobbers < code class="option">-last</code>)</td></tr><tr><td align="left">-present &lt;whe n&gt;</td><td align="left">present="&lt;when&gt;"</td><td align="left">allow onl y warnings present in this version</td></tr><tr><td align="left">-absent &lt;whe n&gt;</td><td align="left">absent="&lt;when&gt;"</td><td align="left">allow only warnings absent in this version</td></tr><tr><td align="left">-active[:truth]</ td><td align="left">active="[true|false]"</td><td align="left">allow only warnin gs alive in the last sequence number</td></tr><tr><td align="left">-introducedBy Change[:truth]</td><td align="left">introducedByChange="[true|false]"</td><td al ign="left">allow only warnings introduced by a change of an existing class</td>< /tr><tr><td align="left">-removedByChange[:truth]</td><td align="left">removedBy Change="[true|false]"</td><td align="left">allow only warnings removed by a chan ge of a persisting class</td></tr><tr><td align="left">-newCode[:truth]</td><td align="left">newCode="[true|false]"</td><td align="left">allow only warnings int roduced by the addition of a new class</td></tr><tr><td align="left">-removedCod e[:truth]</td><td align="left">removedCode="[true|false]"</td><td align="left">a llow only warnings removed by removal of a class</td></tr><tr><td align="left">- priority &lt;level&gt;</td><td align="left">priority="&lt;level&gt;"</td><td ali gn="left">allow only warnings with this priority or higher</td></tr><tr><td alig n="left">-maxRank &lt;rank&gt;</td><td align="left">rank="[1..20]"</td><td align ="left">allow only warnings with this rank or lower</td></tr><tr><td align="left ">-class &lt;pattern&gt;</td><td align="left">class="&lt;class&gt;"</td><td alig n="left">allow only bugs whose primary class name matches this pattern</td></tr> <tr><td align="left">-bugPattern &lt;pattern&gt;</td><td align="left">bugPattern ="&lt;pattern&gt;"</td><td align="left">allow only bugs whose type matches this pattern</td></tr><tr><td align="left">-category &lt;category&gt;</td><td align=" left">category="&lt;category&gt;"</td><td align="left">allow only warnings with a category that starts with this string</td></tr><tr><td align="left">-designati on &lt;designation&gt;</td><td align="left">designation="&lt;designation&gt;"</t d><td align="left">allow only warnings with this designation (e.g., -designation SHOULD_FIX)</td></tr><tr><td align="left">-withMessages[:truth] </td><td align= "left">withMessages="[true|false]"</td><td align="left">the generated XML should contain textual messages</td></tr></tbody></table></div></div><br class="table- break"></div><div class="sect2" title="1.4.&nbsp;mineBugHistory"><div class="tit lepage"><div><div><h3 class="title"><a name="mineBugHistory"></a>1.4.&nbsp;mineB ugHistory</h3></div></div></div><p>This command generates a table containing cou nts of the numbers of warnings 113 </pre><div class="table"><a name="filterOptionsTable"></a><p class="title"><b>Ta ble&nbsp;12.2.&nbsp;Options for filterBugs command</b></p><div class="table-cont ents"><table summary="Options for filterBugs command" border="1"><colgroup><col> <col><col></colgroup><thead><tr><th align="left">Command-line option</th><th ali gn="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr ><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align ="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="le ft">output="&lt;file&gt;"</td><td align="left">output results to file</td></tr>< tr><td align="left">-not</td><td align="left">not="[true|false]"</td><td align=" left">reverse (all) switches for the filter</td></tr><tr><td align="left">-withS ource[:truth]</td><td align="left">withSource="[true|false]"</td><td align="left ">only warnings for switch source is available</td></tr><tr><td align="left">-ex clude &lt;filter file&gt;</td><td align="left">exclude="&lt;filter file&gt;"</td ><td align="left">exclude bugs matching given filter</td></tr><tr><td align="lef t">-include &lt;filter file&gt;</td><td align="left">include="&lt;filter file&gt ;"</td><td align="left">include only bugs matching given filter</td></tr><tr><td align="left">-annotation &lt;text&gt;</td><td align="left">annotation="&lt;text &gt;"</td><td align="left">allow only warnings containing this text in a manual annotation</td></tr><tr><td align="left">-after &lt;when&gt;</td><td align="left ">after="&lt;when&gt;"</td><td align="left">allow only warnings that first occur red after this version</td></tr><tr><td align="left">-before &lt;when&gt;</td><t d align="left">before="&lt;when&gt;"</td><td align="left">allow only warnings th at first occurred before this version</td></tr><tr><td align="left">-first &lt;w hen&gt;</td><td align="left">first="&lt;when&gt;"</td><td align="left">allow onl y warnings that first occurred in this version</td></tr><tr><td align="left">-la st &lt;when&gt;</td><td align="left">last="&lt;when&gt;"</td><td align="left">al low only warnings that last occurred in this version</td></tr><tr><td align="lef t">-fixed &lt;when&gt;</td><td align="left">fixed="&lt;when&gt;"</td><td align=" left">allow only warnings that last occurred in the previous version (clobbers < code class="option">-last</code>)</td></tr><tr><td align="left">-present &lt;whe n&gt;</td><td align="left">present="&lt;when&gt;"</td><td align="left">allow onl y warnings present in this version</td></tr><tr><td align="left">-absent &lt;whe n&gt;</td><td align="left">absent="&lt;when&gt;"</td><td align="left">allow only warnings absent in this version</td></tr><tr><td align="left">-active[:truth]</ td><td align="left">active="[true|false]"</td><td align="left">allow only warnin gs alive in the last sequence number</td></tr><tr><td align="left">-introducedBy Change[:truth]</td><td align="left">introducedByChange="[true|false]"</td><td al ign="left">allow only warnings introduced by a change of an existing class</td>< /tr><tr><td align="left">-removedByChange[:truth]</td><td align="left">removedBy Change="[true|false]"</td><td align="left">allow only warnings removed by a chan ge of a persisting class</td></tr><tr><td align="left">-newCode[:truth]</td><td align="left">newCode="[true|false]"</td><td align="left">allow only warnings int roduced by the addition of a new class</td></tr><tr><td align="left">-removedCod e[:truth]</td><td align="left">removedCode="[true|false]"</td><td align="left">a llow only warnings removed by removal of a class</td></tr><tr><td align="left">- priority &lt;level&gt;</td><td align="left">priority="&lt;level&gt;"</td><td ali gn="left">allow only warnings with this priority or higher</td></tr><tr><td alig n="left">-maxRank &lt;rank&gt;</td><td align="left">rank="[1..20]"</td><td align ="left">allow only warnings with this rank or lower</td></tr><tr><td align="left ">-class &lt;pattern&gt;</td><td align="left">class="&lt;class&gt;"</td><td alig n="left">allow only bugs whose primary class name matches this pattern</td></tr> <tr><td align="left">-bugPattern &lt;pattern&gt;</td><td align="left">bugPattern ="&lt;pattern&gt;"</td><td align="left">allow only bugs whose type matches this pattern</td></tr><tr><td align="left">-category &lt;category&gt;</td><td align=" left">category="&lt;category&gt;"</td><td align="left">allow only warnings with a category that starts with this string</td></tr><tr><td align="left">-designati on &lt;designation&gt;</td><td align="left">designation="&lt;designation&gt;"</t d><td align="left">allow only warnings with this designation (e.g., -designation SHOULD_FIX)</td></tr><tr><td align="left">-withMessages[:truth] </td><td align= "left">withMessages="[true|false]"</td><td align="left">the generated XML should contain textual messages</td></tr></tbody></table></div></div><br class="table- break"></div><div class="sect2"><div class="titlepage"><div><div><h3 class="titl e"><a name="mineBugHistory"></a>1.4.&nbsp;mineBugHistory</h3></div></div></div>< p>This command generates a table containing counts of the numbers of warnings
114 in each version of a multiversion bug database.</p><p>This functionality may als o can be accessed from ant. 114 in each version of a multiversion bug database.</p><p>This functionality may als o can be accessed from ant.
115 First create a taskdef for <span class="command"><strong>mineBugHistory</strong> </span> in your 115 First create a taskdef for <span class="command"><strong>mineBugHistory</strong> </span> in your
116 build file: 116 build file:
117 </p><pre class="programlisting"> 117 </p><pre class="programlisting">
118 118
119 &lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBug HistoryTask"&gt; 119 &lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBug HistoryTask"&gt;
120 &lt;classpath refid="findbugs.lib" /&gt; 120 &lt;classpath refid="findbugs.lib" /&gt;
121 &lt;/taskdef&gt; 121 &lt;/taskdef&gt;
122 122
123 </pre><p>Attributes for this ant task are listed in the following table. 123 </pre><p>Attributes for this ant task are listed in the following table.
124 To specify an input file either use the <code class="literal">input</code> 124 To specify an input file either use the <code class="literal">input</code>
125 attribute or nest it inside the ant call with a 125 attribute or nest it inside the ant call with a
126 <code class="literal">&lt;datafile&gt;</code> element. For example: 126 <code class="literal">&lt;datafile&gt;</code> element. For example:
127 </p><pre class="programlisting"> 127 </p><pre class="programlisting">
128 128
129 &lt;mineBugHistory home="${findbugs.home}" ...&gt; 129 &lt;mineBugHistory home="${findbugs.home}" ...&gt;
130 &lt;datafile name="analyze.xml"/&gt; 130 &lt;datafile name="analyze.xml"/&gt;
131 &lt;/mineBugHistory&gt; 131 &lt;/mineBugHistory&gt;
132 132
133 </pre><div class="table"><a name="mineBugHistoryOptionsTable"></a><p class="titl e"><b>Table&nbsp;12.3.&nbsp;Options for mineBugHistory command</b></p><div class ="table-contents"><table summary="Options for mineBugHistory command" border="1" ><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line op tion</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr></ thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt ;"</td><td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</ td><td align="left">output="&lt;file&gt;"</td><td align="left">write output to f ile</td></tr><tr><td align="left">-formatDates</td><td align="left">formatDates= "[true|false]"</td><td align="left">render dates in textual form</td></tr><tr><t d align="left">-noTabs</td><td align="left">noTabs="[true|false]"</td><td align= "left">delimit columns with groups of spaces instead of tabs (see below)</td></t r><tr><td align="left">-summary</td><td align="left">summary="[true|false]"</td> <td align="left">output terse summary of changes over the last ten entries</td>< /tr></tbody></table></div></div><br class="table-break"><p> 133 </pre><div class="table"><a name="mineBugHistoryOptionsTable"></a><p class="titl e"><b>Table&nbsp;12.3.&nbsp;Options for mineBugHistory command</b></p><div class ="table-contents"><table summary="Options for mineBugHistory command" border="1" ><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line op tion</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr></ thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt ;"</td><td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</ td><td align="left">output="&lt;file&gt;"</td><td align="left">write output to f ile</td></tr><tr><td align="left">-formatDates</td><td align="left">formatDates= "[true|false]"</td><td align="left">render dates in textual form</td></tr><tr><t d align="left">-noTabs</td><td align="left">noTabs="[true|false]"</td><td align= "left">delimit columns with groups of spaces instead of tabs (see below)</td></t r><tr><td align="left">-summary</td><td align="left">summary="[true|false]"</td> <td align="left">output terse summary of changes over the last ten entries</td>< /tr></tbody></table></div></div><br class="table-break"><p>
134 The <code class="option">-noTabs</code> output can be easier to read fro m a shell 134 The <code class="option">-noTabs</code> output can be easier to read fro m a shell
135 with a fixed-width font. 135 with a fixed-width font.
136 Because numeric columns are right-justified, spaces may precede the 136 Because numeric columns are right-justified, spaces may precede the
137 first column value. This option also causes <code class="option">-format Dates</code> 137 first column value. This option also causes <code class="option">-format Dates</code>
138 to render dates in terser format without embedded whitespace. 138 to render dates in terser format without embedded whitespace.
139 </p><p>The table is a tab-separated (barring <code class="option">-noTab s</code>) 139 </p><p>The table is a tab-separated (barring <code class="option">-noTab s</code>)
140 table with the following columns:</p><div class="table"><a name="mineBug HistoryColumns"></a><p class="title"><b>Table&nbsp;12.4.&nbsp;Columns in mineBug History output</b></p><div class="table-contents"><table summary="Columns in min eBugHistory output" border="1"><colgroup><col><col></colgroup><thead><tr><th ali gn="left">Title</th><th align="left">Meaning</th></tr></thead><tbody><tr><td ali gn="left">seq</td><td align="left">Sequence number (successive integers, startin g at 0)</td></tr><tr><td align="left">version</td><td align="left">Version name< /td></tr><tr><td align="left">time</td><td align="left">Release timestamp</td></ tr><tr><td align="left">classes</td><td align="left">Number of classes analyzed< /td></tr><tr><td align="left">NCSS</td><td align="left">Non Commenting Source St atements</td></tr><tr><td align="left">added</td><td align="left">Count of new w arnings for a class that existed in the previous version</td></tr><tr><td align= "left">newCode</td><td align="left">Count of new warnings for a class that did n ot exist in the previous version</td></tr><tr><td align="left">fixed</td><td ali gn="left">Count of warnings removed from a class that remains in the current ver sion</td></tr><tr><td align="left">removed</td><td align="left">Count of warning s in the previous version for a class that is not present in the current version </td></tr><tr><td align="left">retained</td><td align="left">Count of warnings t hat were in both the previous and current version</td></tr><tr><td align="left"> dead</td><td align="left">Warnings that were present in earlier versions but in neither the current version or the immediately preceeding version</td></tr><tr>< td align="left">active</td><td align="left">Total warnings present in the curren t version</td></tr></tbody></table></div></div><br class="table-break"></div><di v class="sect2" title="1.5.&nbsp;defectDensity"><div class="titlepage"><div><div ><h3 class="title"><a name="defectDensity"></a>1.5.&nbsp;defectDensity</h3></div ></div></div><p> 140 table with the following columns:</p><div class="table"><a name="mineBug HistoryColumns"></a><p class="title"><b>Table&nbsp;12.4.&nbsp;Columns in mineBug History output</b></p><div class="table-contents"><table summary="Columns in min eBugHistory output" border="1"><colgroup><col><col></colgroup><thead><tr><th ali gn="left">Title</th><th align="left">Meaning</th></tr></thead><tbody><tr><td ali gn="left">seq</td><td align="left">Sequence number (successive integers, startin g at 0)</td></tr><tr><td align="left">version</td><td align="left">Version name< /td></tr><tr><td align="left">time</td><td align="left">Release timestamp</td></ tr><tr><td align="left">classes</td><td align="left">Number of classes analyzed< /td></tr><tr><td align="left">NCSS</td><td align="left">Non Commenting Source St atements</td></tr><tr><td align="left">added</td><td align="left">Count of new w arnings for a class that existed in the previous version</td></tr><tr><td align= "left">newCode</td><td align="left">Count of new warnings for a class that did n ot exist in the previous version</td></tr><tr><td align="left">fixed</td><td ali gn="left">Count of warnings removed from a class that remains in the current ver sion</td></tr><tr><td align="left">removed</td><td align="left">Count of warning s in the previous version for a class that is not present in the current version </td></tr><tr><td align="left">retained</td><td align="left">Count of warnings t hat were in both the previous and current version</td></tr><tr><td align="left"> dead</td><td align="left">Warnings that were present in earlier versions but in neither the current version or the immediately preceeding version</td></tr><tr>< td align="left">active</td><td align="left">Total warnings present in the curren t version</td></tr></tbody></table></div></div><br class="table-break"></div><di v class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="defe ctDensity"></a>1.5.&nbsp;defectDensity</h3></div></div></div><p>
141 This command lists information about defect density (warnings per 1000 NCSS) for the entire project and each class and package. 141 This command lists information about defect density (warnings per 1000 NCSS) for the entire project and each class and package.
142 It can either be invoked with no files specified on the command line (in which c ase it reads from standard input) 142 It can either be invoked with no files specified on the command line (in which c ase it reads from standard input)
143 or with one file specified on the command line.</p><p>It generates a table with the following columns, and with one 143 or with one file specified on the command line.</p><p>It generates a table with the following columns, and with one
144 row for the entire project, and one row for each package or class that contains at least 144 row for the entire project, and one row for each package or class that contains at least
145 4 warnings.</p><div class="table"><a name="defectDensityColumns"></a><p class="t itle"><b>Table&nbsp;12.5.&nbsp;Columns in defectDensity output</b></p><div class ="table-contents"><table summary="Columns in defectDensity output" border="1"><c olgroup><col><col></colgroup><thead><tr><th align="left">Title</th><th align="le ft">Meaning</th></tr></thead><tbody><tr><td align="left">kind</td><td align="lef t">project, package or class</td></tr><tr><td align="left">name</td><td align="l eft">The name of the project, package or class</td></tr><tr><td align="left">den sity</td><td align="left">Number of warnings generated per 1000 lines of NCSS.</ td></tr><tr><td align="left">bugs</td><td align="left">Number of warnings</td></ tr><tr><td align="left">NCSS</td><td align="left">Calculated number of NCSS</td> </tr></tbody></table></div></div><br class="table-break"></div><div class="sect2 " title="1.6.&nbsp;convertXmlToText"><div class="titlepage"><div><div><h3 class= "title"><a name="convertXmlToText"></a>1.6.&nbsp;convertXmlToText</h3></div></di v></div><p> 145 4 warnings.</p><div class="table"><a name="defectDensityColumns"></a><p class="t itle"><b>Table&nbsp;12.5.&nbsp;Columns in defectDensity output</b></p><div class ="table-contents"><table summary="Columns in defectDensity output" border="1"><c olgroup><col><col></colgroup><thead><tr><th align="left">Title</th><th align="le ft">Meaning</th></tr></thead><tbody><tr><td align="left">kind</td><td align="lef t">project, package or class</td></tr><tr><td align="left">name</td><td align="l eft">The name of the project, package or class</td></tr><tr><td align="left">den sity</td><td align="left">Number of warnings generated per 1000 lines of NCSS.</ td></tr><tr><td align="left">bugs</td><td align="left">Number of warnings</td></ tr><tr><td align="left">NCSS</td><td align="left">Calculated number of NCSS</td> </tr></tbody></table></div></div><br class="table-break"></div><div class="sect2 "><div class="titlepage"><div><div><h3 class="title"><a name="convertXmlToText"> </a>1.6.&nbsp;convertXmlToText</h3></div></div></div><p>
146 This command converts a warning collection in XML format to a te xt 146 This command converts a warning collection in XML format to a te xt
147 format with one line per warning, or to HTML. 147 format with one line per warning, or to HTML.
148 </p><p>This functionality may also can be accessed from ant. 148 </p><p>This functionality may also can be accessed from ant.
149 First create a taskdef for <span class="command"><strong>convertXmlToText</stron g></span> in your 149 First create a taskdef for <span class="command"><strong>convertXmlToText</stron g></span> in your
150 build file: 150 build file:
151 </p><pre class="programlisting"> 151 </p><pre class="programlisting">
152 152
153 &lt;taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.Conve rtXmlToTextTask"&gt; 153 &lt;taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.Conve rtXmlToTextTask"&gt;
154 &lt;classpath refid="findbugs.lib" /&gt; 154 &lt;classpath refid="findbugs.lib" /&gt;
155 &lt;/taskdef&gt; 155 &lt;/taskdef&gt;
156 156
157 </pre><p>Attributes for this ant task are listed in the following table.</p><div class="table"><a name="convertXmlToTextTable"></a><p class="title"><b>Table&nbs p;12.6.&nbsp;Options for convertXmlToText command</b></p><div class="table-conte nts"><table summary="Options for convertXmlToText command" border="1"><colgroup> <col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><t h align="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbod y><tr><td align="left">&nbsp;</td><td align="left">input="&lt;filename&gt;"</td> <td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;filename&gt;"</td><td align="left">output results to fi le</td></tr><tr><td align="left">-longBugCodes</td><td align="left">longBugCodes ="[true|false]"</td><td align="left">use the full bug pattern code instead of tw o-letter abbreviation</td></tr><tr><td align="left">&nbsp;</td><td align="left"> format="text"</td><td align="left">generate plain text output with one bug per l ine (command-line default)</td></tr><tr><td align="left">-html[:stylesheet]</td> <td align="left">format="html:&lt;stylesheet&gt;"</td><td align="left">generate output with specified stylesheet (see below), or default.xsl if unspecified</td> </tr></tbody></table></div></div><br class="table-break"><p> 157 </pre><p>Attributes for this ant task are listed in the following table.</p><div class="table"><a name="convertXmlToTextTable"></a><p class="title"><b>Table&nbs p;12.6.&nbsp;Options for convertXmlToText command</b></p><div class="table-conte nts"><table summary="Options for convertXmlToText command" border="1"><colgroup> <col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><t h align="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbod y><tr><td align="left">&nbsp;</td><td align="left">input="&lt;filename&gt;"</td> <td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;filename&gt;"</td><td align="left">output results to fi le</td></tr><tr><td align="left">-longBugCodes</td><td align="left">longBugCodes ="[true|false]"</td><td align="left">use the full bug pattern code instead of tw o-letter abbreviation</td></tr><tr><td align="left">&nbsp;</td><td align="left"> format="text"</td><td align="left">generate plain text output with one bug per l ine (command-line default)</td></tr><tr><td align="left">-html[:stylesheet]</td> <td align="left">format="html:&lt;stylesheet&gt;"</td><td align="left">generate output with specified stylesheet (see below), or default.xsl if unspecified</td> </tr></tbody></table></div></div><br class="table-break"><p>
158 You may specify plain.xsl, default.xsl, fancy.xsl, fancy-hist.xsl, 158 You may specify plain.xsl, default.xsl, fancy.xsl, fancy-hist.xsl,
159 or your own XSL stylesheet for the -html/format option. 159 or your own XSL stylesheet for the -html/format option.
160 Despite the name of this option, you may specify 160 Despite the name of this option, you may specify
161 a stylesheet that emits something other than html. 161 a stylesheet that emits something other than html.
162 When applying a stylesheet other than those included 162 When applying a stylesheet other than those included
163 with FindBugs (listed above), the -html/format option should be used 163 with FindBugs (listed above), the -html/format option should be used
164 with a path or URL to the stylesheet. 164 with a path or URL to the stylesheet.
165 </p></div><div class="sect2" title="1.7.&nbsp;setBugDatabaseInfo"><d iv class="titlepage"><div><div><h3 class="title"><a name="setBugDatabaseInfo"></ a>1.7.&nbsp;setBugDatabaseInfo</h3></div></div></div><p> 165 </p></div><div class="sect2"><div class="titlepage"><div><div><h3 cl ass="title"><a name="setBugDatabaseInfo"></a>1.7.&nbsp;setBugDatabaseInfo</h3></ div></div></div><p>
166 This command sets meta-information in a specified warning collec tion. 166 This command sets meta-information in a specified warning collec tion.
167 It takes the following options: 167 It takes the following options:
168 </p><p>This functionality may also can be accessed from ant. 168 </p><p>This functionality may also can be accessed from ant.
169 First create a taskdef for <span class="command"><strong>setBugDatabaseInfo</str ong></span> in your 169 First create a taskdef for <span class="command"><strong>setBugDatabaseInfo</str ong></span> in your
170 build file: 170 build file:
171 </p><pre class="programlisting"> 171 </p><pre class="programlisting">
172 172
173 &lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.Set BugDatabaseInfoTask"&gt; 173 &lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.Set BugDatabaseInfoTask"&gt;
174 &lt;classpath refid="findbugs.lib" /&gt; 174 &lt;classpath refid="findbugs.lib" /&gt;
175 &lt;/taskdef&gt; 175 &lt;/taskdef&gt;
176 176
177 </pre><p>Attributes for this ant task are listed in the following table. 177 </pre><p>Attributes for this ant task are listed in the following table.
178 To specify an input file either use the <code class="literal">input</code> 178 To specify an input file either use the <code class="literal">input</code>
179 attribute or nest it inside the ant call with a 179 attribute or nest it inside the ant call with a
180 <code class="literal">&lt;datafile&gt;</code> element. For example: 180 <code class="literal">&lt;datafile&gt;</code> element. For example:
181 </p><pre class="programlisting"> 181 </p><pre class="programlisting">
182 182
183 &lt;setBugDatabaseInfo home="${findbugs.home}" ...&gt; 183 &lt;setBugDatabaseInfo home="${findbugs.home}" ...&gt;
184 &lt;datafile name="analyze.xml"/&gt; 184 &lt;datafile name="analyze.xml"/&gt;
185 &lt;/setBugDatabaseInfo&gt; 185 &lt;/setBugDatabaseInfo&gt;
186 186
187 </pre><div class="table"><a name="setBugDatabaseInfoOptions"></a><p class="title "><b>Table&nbsp;12.7.&nbsp;setBugDatabaseInfo Options</b></p><div class="table-c ontents"><table summary="setBugDatabaseInfo Options" border="1"><colgroup><col>< col><col></colgroup><thead><tr><th align="left">Command-line option</th><th alig n="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr> <td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align= "left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="lef t">output="&lt;file&gt;"</td><td align="left">write output to file</td></tr><tr> <td align="left">-name &lt;name&gt;</td><td align="left">name="&lt;name&gt;"</td ><td align="left">set name for (last) revision</td></tr><tr><td align="left">-ti mestamp &lt;when&gt;</td><td align="left">timestamp="&lt;when&gt;"</td><td align ="left">set timestamp for (last) revision</td></tr><tr><td align="left">-source &lt;directory&gt;</td><td align="left">source="&lt;directory&gt;"</td><td align= "left">add specified directory to the source search path</td></tr><tr><td align= "left">-findSource &lt;directory&gt;</td><td align="left">findSource="&lt;direct ory&gt;"</td><td align="left">find and add all relevant source directions contai ned within specified directory</td></tr><tr><td align="left">-suppress &lt;filte r file&gt;</td><td align="left">suppress="&lt;filter file&gt;"</td><td align="le ft">suppress warnings matched by this file (replaces previous suppressions)</td> </tr><tr><td align="left">-withMessages</td><td align="left">withMessages="[true |false]"</td><td align="left">add textual messages to XML</td></tr><tr><td align ="left">-resetSource</td><td align="left">resetSource="[true|false]"</td><td ali gn="left">remove all source search paths</td></tr></tbody></table></div></div><b r class="table-break"></div><div class="sect2" title="1.8.&nbsp;listBugDatabaseI nfo"><div class="titlepage"><div><div><h3 class="title"><a name="listBugDatabase Info"></a>1.8.&nbsp;listBugDatabaseInfo</h3></div></div></div><p>This command ta kes a list of zero or more xml bug database filenames on the command line. 187 </pre><div class="table"><a name="setBugDatabaseInfoOptions"></a><p class="title "><b>Table&nbsp;12.7.&nbsp;setBugDatabaseInfo Options</b></p><div class="table-c ontents"><table summary="setBugDatabaseInfo Options" border="1"><colgroup><col>< col><col></colgroup><thead><tr><th align="left">Command-line option</th><th alig n="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr> <td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align= "left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="lef t">output="&lt;file&gt;"</td><td align="left">write output to file</td></tr><tr> <td align="left">-name &lt;name&gt;</td><td align="left">name="&lt;name&gt;"</td ><td align="left">set name for (last) revision</td></tr><tr><td align="left">-ti mestamp &lt;when&gt;</td><td align="left">timestamp="&lt;when&gt;"</td><td align ="left">set timestamp for (last) revision</td></tr><tr><td align="left">-source &lt;directory&gt;</td><td align="left">source="&lt;directory&gt;"</td><td align= "left">add specified directory to the source search path</td></tr><tr><td align= "left">-findSource &lt;directory&gt;</td><td align="left">findSource="&lt;direct ory&gt;"</td><td align="left">find and add all relevant source directions contai ned within specified directory</td></tr><tr><td align="left">-suppress &lt;filte r file&gt;</td><td align="left">suppress="&lt;filter file&gt;"</td><td align="le ft">suppress warnings matched by this file (replaces previous suppressions)</td> </tr><tr><td align="left">-withMessages</td><td align="left">withMessages="[true |false]"</td><td align="left">add textual messages to XML</td></tr><tr><td align ="left">-resetSource</td><td align="left">resetSource="[true|false]"</td><td ali gn="left">remove all source search paths</td></tr></tbody></table></div></div><b r class="table-break"></div><div class="sect2"><div class="titlepage"><div><div> <h3 class="title"><a name="listBugDatabaseInfo"></a>1.8.&nbsp;listBugDatabaseInf o</h3></div></div></div><p>This command takes a list of zero or more xml bug dat abase filenames on the command line.
188 If zero file names are provided, it reads from standard input and does not gener ate 188 If zero file names are provided, it reads from standard input and does not gener ate
189 a table header.</p><p>There is only one option: <code class="option">-formatDate s</code> renders dates 189 a table header.</p><p>There is only one option: <code class="option">-formatDate s</code> renders dates
190 in textual form. 190 in textual form.
191 </p><p>The output is a table one row per bug database and the following colu mns:</p><div class="table"><a name="listBugDatabaseInfoColumns"></a><p class="ti tle"><b>Table&nbsp;12.8.&nbsp;listBugDatabaseInfo Columns</b></p><div class="tab le-contents"><table summary="listBugDatabaseInfo Columns" border="1"><colgroup>< col><col></colgroup><thead><tr><th align="left">Column</th><th align="left">Mean ing</th></tr></thead><tbody><tr><td align="left">version</td><td align="left">ve rsion name</td></tr><tr><td align="left">time</td><td align="left">Release times tamp</td></tr><tr><td align="left">classes</td><td align="left">Number of classe s analyzed</td></tr><tr><td align="left">NCSS</td><td align="left">Non Commentin g Source Statements analyzed</td></tr><tr><td align="left">total</td><td align=" left">Total number of warnings of all kinds</td></tr><tr><td align="left">high</ td><td align="left">Total number of high priority warnings of all kinds</td></tr ><tr><td align="left">medium</td><td align="left">Total number of medium/normal priority warnings of all kinds</td></tr><tr><td align="left">low</td><td align=" left">Total number of low priority warnings of all kinds</td></tr><tr><td align= "left">filename</td><td align="left">filename of database</td></tr></tbody></tab le></div></div><br class="table-break"></div></div><div class="sect1" title="2.& nbsp;Examples"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples"></a>2.&nbsp;Examples</h2></div></div></div><div class=" sect2" title="2.1.&nbsp;Mining history using proveded shell scrips"><div class=" titlepage"><div><div><h3 class="title"><a name="unixscriptsexamples"></a>2.1.&nb sp;Mining history using proveded shell scrips</h3></div></div></div><p>In all of the following, the commands are given in a directory that contains 191 </p><p>The output is a table one row per bug database and the following colu mns:</p><div class="table"><a name="listBugDatabaseInfoColumns"></a><p class="ti tle"><b>Table&nbsp;12.8.&nbsp;listBugDatabaseInfo Columns</b></p><div class="tab le-contents"><table summary="listBugDatabaseInfo Columns" border="1"><colgroup>< col><col></colgroup><thead><tr><th align="left">Column</th><th align="left">Mean ing</th></tr></thead><tbody><tr><td align="left">version</td><td align="left">ve rsion name</td></tr><tr><td align="left">time</td><td align="left">Release times tamp</td></tr><tr><td align="left">classes</td><td align="left">Number of classe s analyzed</td></tr><tr><td align="left">NCSS</td><td align="left">Non Commentin g Source Statements analyzed</td></tr><tr><td align="left">total</td><td align=" left">Total number of warnings of all kinds</td></tr><tr><td align="left">high</ td><td align="left">Total number of high priority warnings of all kinds</td></tr ><tr><td align="left">medium</td><td align="left">Total number of medium/normal priority warnings of all kinds</td></tr><tr><td align="left">low</td><td align=" left">Total number of low priority warnings of all kinds</td></tr><tr><td align= "left">filename</td><td align="left">filename of database</td></tr></tbody></tab le></div></div><br class="table-break"></div></div><div class="sect1"><div class ="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples"> </a>2.&nbsp;Examples</h2></div></div></div><div class="sect2"><div class="titlep age"><div><div><h3 class="title"><a name="unixscriptsexamples"></a>2.1.&nbsp;Min ing history using proveded shell scrips</h3></div></div></div><p>In all of the f ollowing, the commands are given in a directory that contains
192 directories jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60.</p><p>You can use the command:</p><pre class="screen"> 192 directories jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60.</p><p>You can use the command:</p><pre class="screen">
193 computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -for matDates 193 computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -for matDates
194 </pre><p>to generate the following output:</p><pre class="screen"> 194 </pre><p>to generate the following output:</p><pre class="screen">
195 seq version time classes NCSS added newCode fixed removed retained dead active 195 seq version time classes NCSS added newCode fixed removed retained dead active
196 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 4 0 0 0 0 4 196 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 4 0 0 0 0 4
197 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 4 0 4 197 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 4 0 4
198 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 0 0 2 0 2 0 2 198 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 0 0 2 0 2 0 2
199 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 0 0 1 0 1 2 1 199 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 0 0 1 0 1 2 1
200 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 0 0 1 3 1 200 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 0 0 1 3 1
201 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 0 0 1 3 1 201 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 0 0 1 3 1
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 1 1 1433 197 1433 294 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 1 1 1433 197 1433
295 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 13 12 16 20 1397 199 1422 295 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 13 12 16 20 1397 199 1422
296 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 1422 235 1422 296 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 1422 235 1422
297 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 1 4 7 0 1415 235 1420 297 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 1 4 7 0 1415 235 1420
298 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 6 8 37 0 1383 242 1397 298 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 6 8 37 0 1383 242 1397
299 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 1397 279 1397 299 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 1397 279 1397
300 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 1 1 0 1396 279 1397 300 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 1 1 0 1396 279 1397
301 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 6 0 5 0 1392 280 1398 301 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 6 0 5 0 1392 280 1398
302 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 1398 285 1398 302 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 1398 285 1398
303 44 jdk1.6.0-b61 "Thu Nov 17 01:58:42 EST 2005" 16202 971134 2 0 4 0 1394 285 1396 303 44 jdk1.6.0-b61 "Thu Nov 17 01:58:42 EST 2005" 16202 971134 2 0 4 0 1394 285 1396
304 </pre></div><div class="sect2" title="2.2.&nbsp;Incremental history maintenance" ><div class="titlepage"><div><div><h3 class="title"><a name="incrementalhistory" ></a>2.2.&nbsp;Incremental history maintenance</h3></div></div></div><p> 304 </pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title "><a name="incrementalhistory"></a>2.2.&nbsp;Incremental history maintenance</h3 ></div></div></div><p>
305 If db.xml contains the results of running findbugs over builds b12 - b60, we can update db.xml to include the results of analyzing b61 with the commands: 305 If db.xml contains the results of running findbugs over builds b12 - b60, we can update db.xml to include the results of analyzing b61 with the commands:
306 </p><pre class="screen"> 306 </p><pre class="screen">
307 computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml 307 computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml
308 </pre></div></div><div class="sect1" title="3.&nbsp;Ant example"><div class="tit lepage"><div><div><h2 class="title" style="clear: both"><a name="antexample"></a >3.&nbsp;Ant example</h2></div></div></div><p> 308 </pre></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class= "title" style="clear: both"><a name="antexample"></a>3.&nbsp;Ant example</h2></d iv></div></div><p>
309 Here is a complete ant script example for both running findbugs and running a ch ain of data-mining tools afterward: 309 Here is a complete ant script example for both running findbugs and running a ch ain of data-mining tools afterward:
310 </p><pre class="screen"> 310 </p><pre class="screen">
311 311
312 &lt;project name="analyze_asm_util" default="findbugs"&gt; 312 &lt;project name="analyze_asm_util" default="findbugs"&gt;
313 &lt;!-- findbugs task definition --&gt; 313 &lt;!-- findbugs task definition --&gt;
314 &lt;property name="findbugs.home" value="/Users/ben/Documents/workspace/findb ugs/findbugs" /&gt; 314 &lt;property name="findbugs.home" value="/Users/ben/Documents/workspace/findb ugs/findbugs" /&gt;
315 &lt;property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" /&gt; 315 &lt;property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" /&gt;
316 316
317 &lt;path id="findbugs.lib"&gt; 317 &lt;path id="findbugs.lib"&gt;
318 &lt;fileset dir="${findbugs.home}/lib"&gt; 318 &lt;fileset dir="${findbugs.home}/lib"&gt;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 &lt;mineBugHistory home="${findbugs.home}" 412 &lt;mineBugHistory home="${findbugs.home}"
413 formatDates="true" 413 formatDates="true"
414 noTabs="true" 414 noTabs="true"
415 input="${hist.file}" 415 input="${hist.file}"
416 output="${hist.summary.file}"/&gt; 416 output="${hist.summary.file}"/&gt;
417 &lt;/target&gt; 417 &lt;/target&gt;
418 418
419 &lt;/project&gt; 419 &lt;/project&gt;
420 420
421 </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Naviga tion footer"><tr><td width="40%" align="left"><a accesskey="p" href="rejarForAna lysis.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td wid th="40%" align="right">&nbsp;<a accesskey="n" href="license.html">Next</a></td>< /tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;11.&nbsp;Using re jarForAnalysis&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="i ndex.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter &nbsp;13.&nbsp;License</td></tr></table></div></body></html> 421 </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Naviga tion footer"><tr><td width="40%" align="left"><a accesskey="p" href="rejarForAna lysis.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td wid th="40%" align="right">&nbsp;<a accesskey="n" href="license.html">Next</a></td>< /tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;11.&nbsp;Using re jarForAnalysis&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="i ndex.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter &nbsp;13.&nbsp;License</td></tr></table></div></body></html>
OLDNEW
« no previous file with comments | « doc/manual/building.html ('k') | doc/manual/eclipse.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698