There are several well-known tools for static analysis and quality inspection of code in Java. Among them:
- Checkstyle: Very interesting to validate code conventions and Javadoc. Names, number of parameters in each method, number of lines of code in a method, duplicate code, etc.
- Findbugs: Works at bytecode level. It’s pretty cool to find problems with code (use of
equals
vs ==
), competition, code vulnerability, internationalisation, among others.
- PMD: Tool focused on detecting bad coding practices. Detects problems similar to Findbugs, but at source level (dead code, blocks
catch
empty, etc). Can compute some interesting metrics such as cyclomatic complexity.
- Sonarqube: Tool for code quality inspection. You can use all the above tools, as well as others specialized in coverage testing, unit testing, etc. Have a front end web with reports, charts, code evolution through time, trends, etc.
All these tools can be used outside the IDE (through Ant, Maven, etc).
For your case I would recommend Sonarqube. While there are plugins for the main IDES (IDEA, Netbeans, Eclipse), Sonarqube can easily be used stand-alone and also along with the most common continuous integration tools in the Java world (Jenkins, Hudson, Bamboo, Teamcity, etc).
Thanks! I think your recommendation will suit you perfectly! Thank you!
– Felipe Fonseca