PMD scans Java source code and looks for potential problems like: ... here, and you can get an overview of all the rules for e.g. Java at the rulesets index page.
pmd.sourceforge.net