| Home | Eclipse plugins -> | | About |
FindBugs
|
|
-vmargs |
change to -> |
-vmargs |
Install FindBugs from any one update site below:
http://findbugs.cs.umd.edu/eclipse (official releases)
http://findbugs.cs.umd.edu/eclipse-candidate (candidate releases and official releases)
http://findbugs.cs.umd.edu/eclipse-daily (all releases, including development ones)
FindBugs analysis can be started by right clicking Java project/package/class:
![]() |
Note: if you have a multi-core workstation, you can select multiple Java projects and run FindBugs analysis in parallel.
FindBugs will use all available cores to run analysis in parallel, which works very well for big workspaces with many projects.
After FindBugs analysis is done, results are available in Bug Explorer view and also shown as label decorations for the project/package/file.
To enable such decorations go to Window->Preferences->General-Appearance->Label Decorations:
![]() |
You can jump from the Package Explorer directly to the related bugs in Bug Explorer by selecting interesting Java element and opening Show In menu.
Bug Explorer view shows up with all the bugs selected which are related to the selected java element:
![]() |
Another possibility is to switch perspective: Window->Open Perspective->FindBugs or via "Ctrl+3 -> FindBugs":
![]() |
Eclipse Properties view follows selection in the Bug Explorer view and shows properties for selected element(s).
In case there are more information available, it uses additional tabs. For example, each bug instance has it's own annotations tab:
![]() |
It is also possible to select multiple elements in the Bug Explorer view.
In this case, Properties view will show summary of bugs reported for the current selection:
![]() |
Elements selected in the Bug Explorer view can be copied to clipboard and then used for review sheets etc:
![]() |
Ok, now we know how to find and export our bugs, but what if there are too many of them?
Bug Explorer view allows flexible filtering and grouping of reported bugs. Let's look how it works:
First, we select bug pattern which we think isn't relevant for us.
Right click on it shows "Toggle Filter" menu.
Select one of two toggle actions:
"This Specific Bug Pattern" action will toggle on/off only one, specific bug pattern
"Bug Pattern Type" action will toggle the whole group of patterns on/off
(selected bug pattern group will be shown empty and in different color):
![]() |
It is of course possible to revert the filtering by using same "Toggle Filter" command again on filtered elements.
Filters configured in the Bug Explorer view are remembered automatically and applied each time view is opened again.
It is also possible to configure ALL available bug patterns and bug pattern types (even not yet reported for the project) and define a custom filter set:
![]() |
Bug Filter Configuration dialog allows to configure ALL available bug pattern types and included bug patterns.
A description is shown for selected pattern type/pattern:
![]() |
![]() |
Another filtering feature supported by Bug Explorer view is standard Eclipse Working Sets:
![]() |
Per default, bugs in Bug Explorer view are ordered first by project and then by bug pattern, but this group order can be easily changed:
![]() |
Beside 6 predefined grouping orders, we can change group visibility and sort order by selecting Group By... view menu.
Bug Group Configuration dialog opens:
![]() |
Last but not least, FindBugs analysis preferences are also configurable.
Since 1.3.8 Eclipse plugin version, FindBugs preferences can be configured per workspace or per project.
1.3.8 plugin version changes the way how FindBugs is configured for new projects: now it follows Eclipse standards and uses workspace preferences.
Of course if user decides to use custom project settings, it is still possible.
![]() |
FindBugs preference page has three tabs which control different aspects of FindBugs plugin behavior.
On the first tab FindBugs detector enablement can be changed.
This is the most important tab for tuning FindBugs analysis performance. In general enabling more detectors leads to longer analysis time.
Depending on the project nature, not all detectors must be enabled.
For example, if project contains Swing UI code, catching cross site scripting issues does not make much sense, so it is ok to disable CrossSiteScripting detector, etc.
![]() |
Second tab allows to customize bug reporter settings for all analyzed classes in the project.
This tab is important to control how much "noise" FindBugs should generate.
![]() |
Third tab is dedicated to advanced reporter settings.
Here you can specify (xml) filter files for fine-grained reporter configuration.
Filter files allows to include or exclude bug reports for particular classes and methods.
In the future FindBugs Eclipse plugin might have more convenient way to define and configure filters rules from the UI.
![]() |
Last changed at: 17.07.09 7:38