O'Reilly logo

Jenkins: The Definitive Guide by John Ferguson Smart

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Popular Java and Groovy Code Quality Analysis Tools

There are many open source tools that can help identify poor coding practices.

In the Java world, three static analysis tools have stood the test of time, and are widely used in very complementary ways. Checkstyle excels at checking coding standards and conventions, coding practices, as well as other metrics such code complexity. PMD is a static analysis tool similar to Checkstyle, more focused on coding and design practices. And FindBugs is an innovative tool issued from the ongoing research work of Bill Pugh and his team at the University of Maryland that focuses on identifying potentially dangerous and buggy code. And if you are working with Groovy or Grails, you can use CodeNarc, which checks Groovy coding practices and convention.

All of these tools can be easily integrated into your build process. In the following sections, we will look at how to set up these tools to generate the XML reports that Jenkins can then use for its own reporting.

Checkstyle

Checkstyle is a static analysis tool for Java. Originally designed to enforce a set of highly-configurable coding standards, Checkstyle now also lets you check for poor coding practices, as well as overly complex and duplicated code. Checkstyle is a versatile and flexible tool that should have its place in any Java-based code quality analysis strategy.

Checkstyle supports a very large number of rules, including ones relating to naming conventions, annotations, javadoc comments, class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required