Checkstyle

Checkstyle is a used in software development tool for static code analysis to check the coding style of Java source code.

Area of ​​application

The programming style used in software development projects can improve the software quality, readability and reusability. Thus, the cost of development and maintenance of software can be reduced. Checkstyle can perform a series of automated tests of programming style. These tests can be individually switched on and off, and be configured for programming style defined in the project to be tested. The failure of a test leads, depending on the configuration of the test to an error or warning. Checkstyle can be expanded with its own trials.

Checkstyle is not a tool for the automated detection of programming errors. By identifying undesirable programming styles but can be found with the help of Checkstyle or avoiding programming errors.

Checkstyle is not a tool for automated fix faulty programming styles. For errors in the formatting of the code programs can be used for source code formatting.

Modules

Checkstyle comes with a number of modules which contain tests on specific topics. These modules can be extended with your own modules own examinations.

  • Annotations - checks on the correct use of annotations
  • Block checks - checks of code blocks
  • Class Design - Tests for Software Design
  • Coding - tests of general coding guidelines
  • Duplicate code - checks for the presence of duplicate code
  • Headers - checks on headers of source code files
  • Imports - audits on the use of import
  • Javadoc Comments - Tests for the presence, completeness and formatting of Javadoc comments
  • Metrics - audits of compliance with various software metrics
  • Miscellaneous - Various einordenbare not in the other modules tests
  • Modifiers - checks for correct use of access modifiers
  • Naming Conventions - audits of compliance with the defined naming conventions
  • Regexp - Self configurable using regular expressions testing
  • Size Violations - checks the size of classes, methods, number of parameters, etc.
  • White Space - checks for formatting the code in view space

Use

Checkstyle is delivered as a Java Archive and can run in any Java Virtual Machine and as an Apache Ant task. A number of tools provide plugins for Checkstyle available, among others, Eclipse, Apache Maven and Sonar

History

Checkstyle was originally developed in 2001 by Oliver Burn and is now maintained and developed as open source software by a number of developers.

Alternatives

In the Java environment, usually next to Checkstyle and PMD FindBugs also for purposes similar to Checkstyle be used.

180701
de