http://blog.csdn.net/jdsjlzx/article/details/21472253/
配置FindBugs和常见FindBugs错误 http://blog.csdn.net/aya19880214/article/details/41958445
http://wenku.baidu.com/link?url=r4KX6A37_GW1xHkb7ezYJ-2S_2wQ-E_nB9Yps_mkj35nsKaFnEizt7AqWck_diLRXRIvWquVPZ__9wC8jXFmCNjh6_r6I485H81oTBUQtoe
http://blog.csdn.net/zm_21/article/details/47276581
命令行方式
1
|
./findbugs -textui -low -html -output report.html ./findbugs/outputfiles/
|
常见参数说明:
-home 定义findbugs2软件存放位置
-low 提交警告及任何级别以上报告
-medium 提交中,高级报告(默认)
-high 只提交高级警告
-xml 警告以 xml输出
-html 警告以 html输出
-output 定义输出的文件名
-onlyAnalyze 只分析指定的 class/package
-exclude 忽略指定的 class/package (以xml定义过滤的命名)
-include 只输出指定的 class/package (以xml定义过滤的命名)
过滤规则
示例文件:opencdk_exclude_filter.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<!-- android-support-v4.jar:包过滤 -->
<Match>
<Package name="~android.support.v4.*" />
</Match>
<!-- 类过滤、方法 -->
<Match>
<Class name="com.opencdk.MusicActivity" />
<Method name="getMusicName" />
</Match>
<Match>
<Class name="com.opencdk.VideoActivity" />
</Match>
<!-- Match all doublecheck violations in these methods of "AnotherClass". -->
<Match>
<Class name="com.opencdk.AnotherClass" />
<Or>
<Method name="nonOverloadedMethod" />
<Method name="frob" params="int,java.lang.String" returns="void" />
<Method name="blat" params="" returns="boolean" />
</Or>
<Bug code="DC" />
</Match>
<!-- All bugs in test classes, except for JUnit-specific bugs -->
<Match>
<Class name="~.*.*Test" />
<Not>
<Bug code="IJU" />
</Not>
</Match>
</FindBugsFilter>
|