PMD

PMD (Programming Mistake Detector) is an open source static source code analyzer that reports on issues found within application code. PMD includes built-in rule sets and supports the ability to write custom rules.