Jump to content

Checkstyle

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Janderson4671 (talk | contribs) at 20:22, 17 November 2020 (Changed the wording from "complies" to "is compliant with" because "complies" looks too similar to the word "compiles" and the wiki font has cause confusion with this.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Checkstyle
Stable release
8.34 / June 28, 2020; 4 years ago (2020-06-28)
Repository
Written inJava
Operating systemCross-platform
TypeStatic code analysis
LicenseLesser GNU General Public License
Websitecheckstyle.sourceforge.net Edit this at Wikidata

Checkstyle[1] is a static code analysis tool used in software development for checking if Java source code is compliant with specified coding rules.

Originally developed by Oliver Burn back in 2001, the project is maintained by a team of developers from around the world.

The current stable release is version 8.34[2] which is targeted at the Java 8 language.

Advantages and limits

The programming style adopted by a software development project can help to ensure that the code is compliant with good programming practices which improve the quality, readability, re-usability of the code and may reduce the cost of development. The checks performed by Checkstyle are mainly limited to the presentation of the code. These checks do not confirm the correctness or completeness of the code.

Examples of available modules

Checkstyle defines a set of available modules, each of which provides rules checking with a configurable level of strictness (mandatory, optional...). Each rule can raise notifications, warnings, and errors. For example, Checkstyle can examine the following:

  • Javadoc comments for classes, attributes and methods;
  • Naming conventions of attributes and methods;
  • The number of function parameters;
  • Line lengths;
  • The presence of mandatory headers;
  • The use of imports, and scope modifiers;
  • The spaces between some characters;
  • The practices of class construction;
  • Multiple complexity measurements.

Usage

Checkstyle is available as a JAR file which can run inside a Java VM or as an Apache Ant task. It can also be integrated into an IDE or other tools.

See also

References

  1. ^ "Checkstyle Home Page". 2010. Retrieved 2010-11-02.
  2. ^ "Checkstyle Release Notes". 2020. Retrieved 2020-07-24.