OLD | NEW |
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 12. Data mining of bugs with FindBugs™</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home
" href="index.html" title="FindBugs™ Manual"><link rel="up" href="index.ht
ml" title="FindBugs™ Manual"><link rel="prev" href="rejarForAnalysis.html"
title="Chapter 11. Using rejarForAnalysis"><link rel="next" href="lic
ense.html" title="Chapter 13. 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 12. Data mining of bugs with <span class="application">Fin
dBugs</span>™</th></tr><tr><td width="20%" align="left"><a accesskey="p" h
ref="rejarForAnalysis.html">Prev</a> </td><th width="60%" align="center">&n
bsp;</th><td width="20%" align="right"> <a accesskey="n" href="license.html
">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 1
2. Data mining of bugs with FindBugs™"><div class="titlepage"><div><d
iv><h2 class="title"><a name="datamining"></a>Chapter 12. Data mining
of bugs with <span class="application">FindBugs</span>™</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 12. Data mining of bugs with FindBugs™</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home
" href="index.html" title="FindBugs™ Manual"><link rel="up" href="index.ht
ml" title="FindBugs™ Manual"><link rel="prev" href="rejarForAnalysis.html"
title="Chapter 11. Using rejarForAnalysis"><link rel="next" href="lic
ense.html" title="Chapter 13. 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 12. Data mining of bugs with <span class="application">Fin
dBugs</span>™</th></tr><tr><td width="20%" align="left"><a accesskey="p" h
ref="rejarForAnalysis.html">Prev</a> </td><th width="60%" align="center">&n
bsp;</th><td width="20%" align="right"> <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 12. Dat
a mining of bugs with <span class="application">FindBugs</span>™</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 Loading... |
32 </p><pre class="programlisting"> | 32 </p><pre class="programlisting"> |
33 | 33 |
34 <!-- findbugs task definition --> | 34 <!-- findbugs task definition --> |
35 <property name="findbugs.home" value="/your/path/to/findbugs" /> | 35 <property name="findbugs.home" value="/your/path/to/findbugs" /> |
36 <path id="findbugs.lib"> | 36 <path id="findbugs.lib"> |
37 <fileset dir="${findbugs.home}/lib"> | 37 <fileset dir="${findbugs.home}/lib"> |
38 <include name="findbugs-ant.jar"/> | 38 <include name="findbugs-ant.jar"/> |
39 </fileset> | 39 </fileset> |
40 </path> | 40 </path> |
41 | 41 |
42 </pre><div class="sect1" title="1. Commands"><div class="titlepage"><div><d
iv><h2 class="title" style="clear: both"><a name="commands"></a>1. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. unionBugs"><div class="titlepage"><div>
<div><h3 class="title"><a name="unionBugs"></a>1.1. 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. 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. computeBugHi
story"><div class="titlepage"><div><div><h3 class="title"><a name="computeBugHis
tory"></a>1.2. 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. 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 <taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.Comp
uteBugHistoryTask"> | 74 <taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.Comp
uteBugHistoryTask"> |
75 <classpath refid="findbugs.lib" /> | 75 <classpath refid="findbugs.lib" /> |
76 </taskdef> | 76 </taskdef> |
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"><datafile></code> element. For example: | 80 <code class="literal"><datafile></code> element. For example: |
81 </p><pre class="programlisting"> | 81 </p><pre class="programlisting"> |
82 | 82 |
83 <computeBugHistory home="${findbugs.home}" ...> | 83 <computeBugHistory home="${findbugs.home}" ...> |
84 <datafile name="analyze1.xml"/> | 84 <datafile name="analyze1.xml"/> |
85 <datafile name="analyze2.xml"/> | 85 <datafile name="analyze2.xml"/> |
86 </computeBugHistory> | 86 </computeBugHistory> |
87 | 87 |
88 </pre><div class="table"><a name="computeBugHistoryTable"></a><p class="title"><
b>Table 12.1. 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 <file></td><td align="left">ou
tput="<file>"</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. 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 12.1. 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 <file></td><td align="left">ou
tput="<file>"</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. 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 <taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsT
ask"> | 100 <taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsT
ask"> |
101 <classpath refid="findbugs.lib" /> | 101 <classpath refid="findbugs.lib" /> |
102 </taskdef> | 102 </taskdef> |
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"><datafile></code> element. For
example: | 106 the ant call with a <code class="literal"><datafile></code> element. For
example: |
107 </p><pre class="programlisting"> | 107 </p><pre class="programlisting"> |
108 | 108 |
109 <filterBugs home="${findbugs.home}" ...> | 109 <filterBugs home="${findbugs.home}" ...> |
110 <datafile name="analyze.xml"/> | 110 <datafile name="analyze.xml"/> |
111 </filterBugs> | 111 </filterBugs> |
112 | 112 |
113 </pre><div class="table"><a name="filterOptionsTable"></a><p class="title"><b>Ta
ble 12.2. 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"> </td><td align="left">input="<file>"</td><td align
="left">use file as input</td></tr><tr><td align="left"> </td><td align="le
ft">output="<file>"</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 <filter file></td><td align="left">exclude="<filter file>"</td
><td align="left">exclude bugs matching given filter</td></tr><tr><td align="lef
t">-include <filter file></td><td align="left">include="<filter file>
;"</td><td align="left">include only bugs matching given filter</td></tr><tr><td
align="left">-annotation <text></td><td align="left">annotation="<text
>"</td><td align="left">allow only warnings containing this text in a manual
annotation</td></tr><tr><td align="left">-after <when></td><td align="left
">after="<when>"</td><td align="left">allow only warnings that first occur
red after this version</td></tr><tr><td align="left">-before <when></td><t
d align="left">before="<when>"</td><td align="left">allow only warnings th
at first occurred before this version</td></tr><tr><td align="left">-first <w
hen></td><td align="left">first="<when>"</td><td align="left">allow onl
y warnings that first occurred in this version</td></tr><tr><td align="left">-la
st <when></td><td align="left">last="<when>"</td><td align="left">al
low only warnings that last occurred in this version</td></tr><tr><td align="lef
t">-fixed <when></td><td align="left">fixed="<when>"</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 <whe
n></td><td align="left">present="<when>"</td><td align="left">allow onl
y warnings present in this version</td></tr><tr><td align="left">-absent <whe
n></td><td align="left">absent="<when>"</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 <level></td><td align="left">priority="<level>"</td><td ali
gn="left">allow only warnings with this priority or higher</td></tr><tr><td alig
n="left">-maxRank <rank></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 <pattern></td><td align="left">class="<class>"</td><td alig
n="left">allow only bugs whose primary class name matches this pattern</td></tr>
<tr><td align="left">-bugPattern <pattern></td><td align="left">bugPattern
="<pattern>"</td><td align="left">allow only bugs whose type matches this
pattern</td></tr><tr><td align="left">-category <category></td><td align="
left">category="<category>"</td><td align="left">allow only warnings with
a category that starts with this string</td></tr><tr><td align="left">-designati
on <designation></td><td align="left">designation="<designation>"</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. mineBugHistory"><div class="tit
lepage"><div><div><h3 class="title"><a name="mineBugHistory"></a>1.4. 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 12.2. 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"> </td><td align="left">input="<file>"</td><td align
="left">use file as input</td></tr><tr><td align="left"> </td><td align="le
ft">output="<file>"</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 <filter file></td><td align="left">exclude="<filter file>"</td
><td align="left">exclude bugs matching given filter</td></tr><tr><td align="lef
t">-include <filter file></td><td align="left">include="<filter file>
;"</td><td align="left">include only bugs matching given filter</td></tr><tr><td
align="left">-annotation <text></td><td align="left">annotation="<text
>"</td><td align="left">allow only warnings containing this text in a manual
annotation</td></tr><tr><td align="left">-after <when></td><td align="left
">after="<when>"</td><td align="left">allow only warnings that first occur
red after this version</td></tr><tr><td align="left">-before <when></td><t
d align="left">before="<when>"</td><td align="left">allow only warnings th
at first occurred before this version</td></tr><tr><td align="left">-first <w
hen></td><td align="left">first="<when>"</td><td align="left">allow onl
y warnings that first occurred in this version</td></tr><tr><td align="left">-la
st <when></td><td align="left">last="<when>"</td><td align="left">al
low only warnings that last occurred in this version</td></tr><tr><td align="lef
t">-fixed <when></td><td align="left">fixed="<when>"</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 <whe
n></td><td align="left">present="<when>"</td><td align="left">allow onl
y warnings present in this version</td></tr><tr><td align="left">-absent <whe
n></td><td align="left">absent="<when>"</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 <level></td><td align="left">priority="<level>"</td><td ali
gn="left">allow only warnings with this priority or higher</td></tr><tr><td alig
n="left">-maxRank <rank></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 <pattern></td><td align="left">class="<class>"</td><td alig
n="left">allow only bugs whose primary class name matches this pattern</td></tr>
<tr><td align="left">-bugPattern <pattern></td><td align="left">bugPattern
="<pattern>"</td><td align="left">allow only bugs whose type matches this
pattern</td></tr><tr><td align="left">-category <category></td><td align="
left">category="<category>"</td><td align="left">allow only warnings with
a category that starts with this string</td></tr><tr><td align="left">-designati
on <designation></td><td align="left">designation="<designation>"</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. 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 <taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBug
HistoryTask"> | 119 <taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBug
HistoryTask"> |
120 <classpath refid="findbugs.lib" /> | 120 <classpath refid="findbugs.lib" /> |
121 </taskdef> | 121 </taskdef> |
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"><datafile></code> element. For example: | 126 <code class="literal"><datafile></code> element. For example: |
127 </p><pre class="programlisting"> | 127 </p><pre class="programlisting"> |
128 | 128 |
129 <mineBugHistory home="${findbugs.home}" ...> | 129 <mineBugHistory home="${findbugs.home}" ...> |
130 <datafile name="analyze.xml"/> | 130 <datafile name="analyze.xml"/> |
131 </mineBugHistory> | 131 </mineBugHistory> |
132 | 132 |
133 </pre><div class="table"><a name="mineBugHistoryOptionsTable"></a><p class="titl
e"><b>Table 12.3. 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"> </td><td align="left">input="<file>
;"</td><td align="left">use file as input</td></tr><tr><td align="left"> </
td><td align="left">output="<file>"</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 12.3. 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"> </td><td align="left">input="<file>
;"</td><td align="left">use file as input</td></tr><tr><td align="left"> </
td><td align="left">output="<file>"</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 12.4. 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. defectDensity"><div class="titlepage"><div><div
><h3 class="title"><a name="defectDensity"></a>1.5. 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 12.4. 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. 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 12.5. 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. convertXmlToText"><div class="titlepage"><div><div><h3 class=
"title"><a name="convertXmlToText"></a>1.6. convertXmlToText</h3></div></di
v></div><p> | 145 4 warnings.</p><div class="table"><a name="defectDensityColumns"></a><p class="t
itle"><b>Table 12.5. 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. 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 <taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.Conve
rtXmlToTextTask"> | 153 <taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.Conve
rtXmlToTextTask"> |
154 <classpath refid="findbugs.lib" /> | 154 <classpath refid="findbugs.lib" /> |
155 </taskdef> | 155 </taskdef> |
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. 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"> </td><td align="left">input="<filename>"</td>
<td align="left">use file as input</td></tr><tr><td align="left"> </td><td
align="left">output="<filename>"</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"> </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:<stylesheet>"</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. 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"> </td><td align="left">input="<filename>"</td>
<td align="left">use file as input</td></tr><tr><td align="left"> </td><td
align="left">output="<filename>"</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"> </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:<stylesheet>"</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. setBugDatabaseInfo"><d
iv class="titlepage"><div><div><h3 class="title"><a name="setBugDatabaseInfo"></
a>1.7. 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. 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 <taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.Set
BugDatabaseInfoTask"> | 173 <taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.Set
BugDatabaseInfoTask"> |
174 <classpath refid="findbugs.lib" /> | 174 <classpath refid="findbugs.lib" /> |
175 </taskdef> | 175 </taskdef> |
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"><datafile></code> element. For example: | 180 <code class="literal"><datafile></code> element. For example: |
181 </p><pre class="programlisting"> | 181 </p><pre class="programlisting"> |
182 | 182 |
183 <setBugDatabaseInfo home="${findbugs.home}" ...> | 183 <setBugDatabaseInfo home="${findbugs.home}" ...> |
184 <datafile name="analyze.xml"/> | 184 <datafile name="analyze.xml"/> |
185 </setBugDatabaseInfo> | 185 </setBugDatabaseInfo> |
186 | 186 |
187 </pre><div class="table"><a name="setBugDatabaseInfoOptions"></a><p class="title
"><b>Table 12.7. 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"> </td><td align="left">input="<file>"</td><td align=
"left">use file as input</td></tr><tr><td align="left"> </td><td align="lef
t">output="<file>"</td><td align="left">write output to file</td></tr><tr>
<td align="left">-name <name></td><td align="left">name="<name>"</td
><td align="left">set name for (last) revision</td></tr><tr><td align="left">-ti
mestamp <when></td><td align="left">timestamp="<when>"</td><td align
="left">set timestamp for (last) revision</td></tr><tr><td align="left">-source
<directory></td><td align="left">source="<directory>"</td><td align=
"left">add specified directory to the source search path</td></tr><tr><td align=
"left">-findSource <directory></td><td align="left">findSource="<direct
ory>"</td><td align="left">find and add all relevant source directions contai
ned within specified directory</td></tr><tr><td align="left">-suppress <filte
r file></td><td align="left">suppress="<filter file>"</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. listBugDatabaseI
nfo"><div class="titlepage"><div><div><h3 class="title"><a name="listBugDatabase
Info"></a>1.8. 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 12.7. 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"> </td><td align="left">input="<file>"</td><td align=
"left">use file as input</td></tr><tr><td align="left"> </td><td align="lef
t">output="<file>"</td><td align="left">write output to file</td></tr><tr>
<td align="left">-name <name></td><td align="left">name="<name>"</td
><td align="left">set name for (last) revision</td></tr><tr><td align="left">-ti
mestamp <when></td><td align="left">timestamp="<when>"</td><td align
="left">set timestamp for (last) revision</td></tr><tr><td align="left">-source
<directory></td><td align="left">source="<directory>"</td><td align=
"left">add specified directory to the source search path</td></tr><tr><td align=
"left">-findSource <directory></td><td align="left">findSource="<direct
ory>"</td><td align="left">find and add all relevant source directions contai
ned within specified directory</td></tr><tr><td align="left">-suppress <filte
r file></td><td align="left">suppress="<filter file>"</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. 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 12.8. 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. Examples</h2></div></div></div><div class="
sect2" title="2.1. 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 12.8. 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. Examples</h2></div></div></div><div class="sect2"><div class="titlep
age"><div><div><h3 class="title"><a name="unixscriptsexamples"></a>2.1. 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 Loading... |
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. Incremental history maintenance"
><div class="titlepage"><div><div><h3 class="title"><a name="incrementalhistory"
></a>2.2. 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. 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. Ant example"><div class="tit
lepage"><div><div><h2 class="title" style="clear: both"><a name="antexample"></a
>3. 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. 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 <project name="analyze_asm_util" default="findbugs"> | 312 <project name="analyze_asm_util" default="findbugs"> |
313 <!-- findbugs task definition --> | 313 <!-- findbugs task definition --> |
314 <property name="findbugs.home" value="/Users/ben/Documents/workspace/findb
ugs/findbugs" /> | 314 <property name="findbugs.home" value="/Users/ben/Documents/workspace/findb
ugs/findbugs" /> |
315 <property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en
-Duser.region=EN -Dfindbugs.home=${findbugs.home}" /> | 315 <property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en
-Duser.region=EN -Dfindbugs.home=${findbugs.home}" /> |
316 | 316 |
317 <path id="findbugs.lib"> | 317 <path id="findbugs.lib"> |
318 <fileset dir="${findbugs.home}/lib"> | 318 <fileset dir="${findbugs.home}/lib"> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 <mineBugHistory home="${findbugs.home}" | 412 <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}"/> | 416 output="${hist.summary.file}"/> |
417 </target> | 417 </target> |
418 | 418 |
419 </project> | 419 </project> |
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> </td><td width="20%" align="center"> </td><td wid
th="40%" align="right"> <a accesskey="n" href="license.html">Next</a></td><
/tr><tr><td width="40%" align="left" valign="top">Chapter 11. Using re
jarForAnalysis </td><td width="20%" align="center"><a accesskey="h" href="i
ndex.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter
13. 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> </td><td width="20%" align="center"> </td><td wid
th="40%" align="right"> <a accesskey="n" href="license.html">Next</a></td><
/tr><tr><td width="40%" align="left" valign="top">Chapter 11. Using re
jarForAnalysis </td><td width="20%" align="center"><a accesskey="h" href="i
ndex.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter
13. License</td></tr></table></div></body></html> |
OLD | NEW |