Checkstyle is a static analysis tool for checking compliance of Java code to standards. It can be configured with various sets of coding standards. It is integrated in various other tools, such as IDEs (like Eclipse, NetBeans or IntelliJ), Maven, Gradle, or the continuous inspection platform SonarQube.
From the official website:
Overview
Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.
Checkstyle is highly configurable and can be made to support almost any coding standard. An example configuration file is supplied supporting the Sun Code Conventions. As well, other sample configuration files are supplied for other well known conventions.
A good example of a report that can be produced using Checkstyle and Maven can be seen here.
Features
Checkstyle can check many aspects of your source code. Historically it's main functionality has been to check code layout issues, but since the internal architecture was changed in version 3, more and more checks for other purposes have been added. Now Checkstyle provides checks that find class design problems, duplicate code, or bug patterns like double checked locking.
For a detailed list of available checks please refer to the Standard Checks page.
Links
- Checkstyle Homepage
- Eclipse-CS: Checkstyle plugin for Eclipse
- Checkstyle-IDEA: Checkstyle plugin for IntelliJ IDEA
- Checkstyle Addons: Additional Checkstyle detectors
- SevNTU Checkstyle: Additional Checkstyle detectors
- Gradle Checkstyle Plugin
- Using Checkstyle in Eclipse Tutorial