PMD
PMD scans Java source code and looks for potential problems like:
- Empty try/catch/finally/switch blocks
- Unused local variables, parameters and private methods
- Empty if/while statements
- Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
- Classes with high Cyclomatic Complexity measurements
You can get an overview of all the rules at the
Rulesets Index page.
PMD has plugins for JDeveloper, Eclipse, JEdit, JBuilder, Omnicore's CodeGuide, NetBeans/Sun Java Studio Enterprise/Creator, IntelliJ IDEA, TextPad, Maven, Ant,
Gel, JCreator, and Emacs. You can download everything from here.
Support PMD by purchasing PMD Applied, the official book!