Latest News

July 01, 2010

SonarJ 6.0 Released

New dashboard aggregates key metrics in one place

January 18, 2010

SonarJ 5.1 Released

Now with Code Duplicate Search

November 12, 2009

SonarJ Integrates with Codehaus Sonar

Sonar SonarJ Plugin 1.0 Released Today

Quality Rules Based on Metrics

Besides its ability to maintain a logical architecture and to identify cyclic dependencies SonarJ also is able to calculate a bunch of useful metrics:

  • ACD (average component dependency - says a lot about internal coupling)
  • LOC (lines of code - where is the beef?)
  • Cyclomatic complexity (where is the complexity?)
  • Assertion usage
  • Relational cohesion
  • Metrics of Robert C. Martin ( abstractness, instability etc.
  • Many others...

You can define thresholds for all metrics. E.g. you could define an upper bound for cyclomatic complexity of 15. Every developer that tries to create a method with a higher complexity will receive a warning. Then he can try to split the method into several less complex parts.

SonarJ aggregates all the metrics to the higher level. Therefore you can easily find out the cyclomatic complexity of a layer or the lines of code comprising a vertical slice.