quarta-feira, 21 de junho de 2017

SW Construction: Checkstyle in Eclipse

The short story

Checkstyle is a static analysis tool with an Eclipse Plugin (it also has a Maven plugin), that allows you to... check style. An excellent article describing how to install, configure for a project and run for reporting (things about style, duh) can be found here:

The Long Story

... made short by Wikipedia: https://en.wikipedia.org/wiki/Checkstyle

Some modules are readily available, saving you lots of time configuring the tool:

"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:
  1. Javadoc comments for classes, attributes and methods;
  2. Naming conventions of attributes and methods;
  3. Limit of the number of function parameters, line lengths;
  4. Presence of mandatory headers;
  5. The use of packets imports, of classes, of scope modifiers and of instructions blocks;
  6. The spaces between some characters;
  7. The good practices of class construction;
  8. Duplicated code sections;
  9. Multiple complexity measurements, among which expressions." (Source: Wikipedia)

Similar tools

If you're into .Net, think FxCop