FindBugs is a great tool to find the potential bug in our code. We can use it in Eclipse, Netbeans, IntelliJ or Hudson, or as a maven task: mvn findbugs:findbugs.
Customization FindBugs Eclipse Plugin
After install findbugs from http://findbugs.cs.umd.edu/eclipse/, we can change its settings in workspace level or project level.
In Report configuration tab, we can make it run automatically, set analysis effort as maximal, enable findbugs cloud, select specific bug categories.
In Plugins and misc. setting tab, we can run findbugs as extra job and cache class files, and we can add findbugs plugins.
One great findbugs plugin we should add: fb-contrib.
In Detector configuration tab, we can enable or disable some detectors.
Bug Group Configuration
When we try to fix potential bugs findbugs reports, we can use findbugs's "Bug Explorer" view, in this view, we can configure how to group bugs.
Two useful configuration:
1. First sort by package, then by class, then by pattern.
Useful when we try to view and fix bugs in one package or class.
2. First sort by pattern, by package, then by class.
Useful when we try to fix same kind of potential bugs.
When we click potential bug reported by findbugs, in "Bug Info" view, we can read the details: why it is considered as a bug and how to fix it.
How Findbugs Looks Like
Reporting in maven 3:
Customization FindBugs Eclipse Plugin
After install findbugs from http://findbugs.cs.umd.edu/eclipse/, we can change its settings in workspace level or project level.
In Report configuration tab, we can make it run automatically, set analysis effort as maximal, enable findbugs cloud, select specific bug categories.
In Plugins and misc. setting tab, we can run findbugs as extra job and cache class files, and we can add findbugs plugins.
One great findbugs plugin we should add: fb-contrib.
In Detector configuration tab, we can enable or disable some detectors.
Bug Group Configuration
When we try to fix potential bugs findbugs reports, we can use findbugs's "Bug Explorer" view, in this view, we can configure how to group bugs.
Two useful configuration:
1. First sort by package, then by class, then by pattern.
Useful when we try to view and fix bugs in one package or class.
2. First sort by pattern, by package, then by class.
Useful when we try to fix same kind of potential bugs.
When we click potential bug reported by findbugs, in "Bug Info" view, we can read the details: why it is considered as a bug and how to fix it.
How Findbugs Looks Like
findbugs:gui, findbugs:gui, findbugs:check