How good you think your code is? How can you be sure it's optimal, bug and bullet proof? Unit Tests? In case the coverage is good, they will tell if your code works, but will it tell if and where your code sucks in general? Let's get down to business.
As Maven is used de facto for Java builds, I assume you're using it. You may have heard of PMD, but have you tried it? If you have, did you know that it has a nice Maven Plugin? A quick way to integrate it:
Add the following to your pom.xml. Sadly, default check rulesets are too friendly, so you may want to try my configuration (even the "too hardcore" block):
To generate a report, simply run:
You may want to build Java cross reference for links to source code to work:
Finally, open the report and see how naughty the code is:
Watch out for Cyclomatic Complexity!