Checkstyle

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found.

Checkstyle
Stable release 6.10.1 / September 1, 2015 (2015-09-01)
Written in Java
Operating system Cross-platform
Type Static code analysis
License Lesser GNU General Public License
Website <strong%20class= "error"><span%20class="scribunto-error"%20id="mw-scribunto-error-2">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'. http://<strong%20class="error"><span%20class="scribunto-error"%20id="mw-scribunto-error-2">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'.Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).

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

Advantages and limits

The programming style adopted by a software development project can help to comply with good programming practices which improve the code quality, readability, re-usability, and reduce the cost of development. The performed checks mainly limit themselves to the presentation and don't analyze content, and do not confirm the correctness or completeness of the program. In practice, it can be tedious to comply with all the style constraints, some of which could possibly harm the programming stages' dynamic; so, it may be useful to determine which level of check is needed for a certain type of program.

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:

  • Javadoc comments for classes, attributes and methods;
  • Naming conventions of attributes and methods;
  • Limit of the number of function parameters, line lengths;
  • Presence of mandatory headers;
  • The use of packets imports, of classes, of scope modifiers and of instructions blocks;
  • The spaces between some characters;
  • The good practices of class construction;
  • Duplicated code sections;[2]
  • Multiple complexity measurements, among which expressions.

Usage

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

A Checkstyle plug-in can provide new functionalities, like:

  • overload syntax coloring or decorations in code editor;
  • decorate the project explorer to highlight problem-posing resources;
  • add warnings and errors outputs to the outputs.

Thus, the developer can directly access to the code parts highlighted by Checkstyle.

History

Checkstyle, originally developed by Oliver Burn back in 2001, is maintained by a team of several developers around the world.

The current stable release is version 5.7[3] which is targeted towards the Java 7 language.

See also

References

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.

External links

<templatestyles src="Asbox/styles.css"></templatestyles>