http://pmd.sourceforge.net/
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
Http://www-900.ibm.com/developerWorks/cn/java/J-PMD/index.shtml http://www.onjava.com/pub/a/onjava/2003/02/static_analysis.html