JavaNCSS Metric Results

[ package ] [ object ] [ method ] [ explanation ]

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 33.54.
JavaNCSS web site.

Packages

Packages

[ package ] [ object ] [ method ] [ explanation ]

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.apache.myfaces.tobago.apt.processor 5 78 1184 0 0 35 111
org.apache.myfaces.tobago.apt.generate 8 110 380 0 0 0 144
org.apache.myfaces.tobago.apt 1 3 14 0 0 0 18
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
14 191 1578 0 0 35 273

Objects

Objects

[ package ] [ object ] [ method ] [ explanation ]

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator 396 22 2 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator 269 23 1 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator 168 15 1 0
org.apache.myfaces.tobago.apt.generate.PropertyInfo 140 44 0 0
org.apache.myfaces.tobago.apt.processor.ClassesGenerator 136 10 0 0
org.apache.myfaces.tobago.apt.generate.ComponentInfo 57 18 0 0
org.apache.myfaces.tobago.apt.processor.AbstractGenerator 44 8 1 0
org.apache.myfaces.tobago.apt.generate.ClassInfo 42 11 0 0
org.apache.myfaces.tobago.apt.generate.TagInfo 40 13 0 0
org.apache.myfaces.tobago.apt.generate.ClassUtils 29 6 0 0
org.apache.myfaces.tobago.apt.generate.ComponentPropertyInfo 21 9 0 0
org.apache.myfaces.tobago.apt.generate.Imports 20 6 0 0
org.apache.myfaces.tobago.apt.AnnotationUtils 11 3 0 0
org.apache.myfaces.tobago.apt.generate.RendererInfo 9 3 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.apt.generate.PropertyInfo 140 44 0 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator 269 23 1 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator 396 22 2 0
org.apache.myfaces.tobago.apt.generate.ComponentInfo 57 18 0 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator 168 15 1 0
org.apache.myfaces.tobago.apt.generate.TagInfo 40 13 0 0
org.apache.myfaces.tobago.apt.generate.ClassInfo 42 11 0 0
org.apache.myfaces.tobago.apt.processor.ClassesGenerator 136 10 0 0
org.apache.myfaces.tobago.apt.generate.ComponentPropertyInfo 21 9 0 0
org.apache.myfaces.tobago.apt.processor.AbstractGenerator 44 8 1 0
org.apache.myfaces.tobago.apt.generate.ClassUtils 29 6 0 0
org.apache.myfaces.tobago.apt.generate.Imports 20 6 0 0
org.apache.myfaces.tobago.apt.AnnotationUtils 11 3 0 0
org.apache.myfaces.tobago.apt.generate.RendererInfo 9 3 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
98.71 1,578.00 0.36 13.64 0.00

Methods

Methods

[ package ] [ object ] [ method ] [ explanation ]

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.generate() 66 12 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.addDescription(javax.lang.model.element.Element,Element,Document,boolean) 41 18 0
org.apache.myfaces.tobago.apt.processor.ClassesGenerator.addProperty(ExecutableElement,PropertyInfo) 39 14 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.addAttribute(ExecutableElement,org.jdom2.Element,org.jdom2.Element,Namespace) 38 7 0
org.apache.myfaces.tobago.apt.processor.ClassesGenerator.createTagOrComponent(TypeElement) 37 16 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.createTaglib(Taglib,PackageElement) 34 6 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.createPropertyOrAttributeExtension(String,ExecutableElement,UIComponentTagAttribute,Namespace) 30 5 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.createDescription(UIComponentTag) 30 5 0
org.apache.myfaces.tobago.apt.processor.AbstractGenerator.process(TypeElement,RoundEnvironment) 27 11 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.addElement(TypeElement,org.jdom2.Element,org.jdom2.Element,Namespace) 26 7 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator.addAttributesForTag(TypeElement,String,Element,String,Document) 23 10 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.addTagContent(TypeElement,Element,Document,boolean,Tag) 23 7 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.addFacets(UIComponentTag,Namespace,org.jdom2.Element) 22 4 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.createElementExtension(TypeElement,UIComponentTag,Namespace) 21 3 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator.appendTag(TypeElement,String,Element,Document) 20 9 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.addRendererElement(ComponentInfo,UIComponentTag,org.jdom2.Element,Namespace) 20 3 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.addAttribute(ExecutableElement,Element,Document) 18 6 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.addAttributeType(Element,TagAttribute,UIComponentTagAttribute,Document) 17 7 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator.writeCheckstyleConfig(Document) 16 2 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator.createRegexpModule(String,String,Document) 16 1 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator.getRegExpForUndefinedAttributes(String,String,String) 16 3 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.addConverter(TypeElement,org.jdom2.Element,Namespace) 16 3 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.addValidator(TypeElement,org.jdom2.Element,Namespace) 16 3 0
org.apache.myfaces.tobago.apt.generate.PropertyInfo.fill(PropertyInfo) 15 1 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator.addAttribute(ExecutableElement,String,Element,String,Document) 15 7 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.deprecationComment(String) 14 6 0
org.apache.myfaces.tobago.apt.processor.CheckstyleConfigGenerator.generate() 12 2 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.createComponentElement(ComponentInfo,UIComponentTag,Namespace) 12 1 0
org.apache.myfaces.tobago.apt.processor.FacesConfigGenerator.addClass(UIComponentTagAttribute,org.jdom2.Element) 12 5 0
org.apache.myfaces.tobago.apt.processor.TaglibGenerator.appendTag(TypeElement,Element,Document) 12 4 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,578.00 6.45 2.32 0.00

Explanations

Explanations

[ package ] [ object ] [ method ] [ explanation ]

Non Commenting Source Statements (NCSS)

Statements for JavaNCSS are not statements as specified in the Java Language Specification but include all kinds of declarations too. Roughly spoken, NCSS is approximately equivalent to counting ';' and '{' characters in Java source files.

Not counted are empty statements, empty blocks or semicolons after closing brackets. Of course, comments don't get counted too. Closing brackets also never get counted, the same applies to blocks in general.

Examples
Package declaration package java.lang;
Import declaration import java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declaration public interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declaration public Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
Label declaration fine :

In some cases consecutive semicolons are illegal according to the JLS but JavaNCSS still tolerates them (thought JavaNCSS is still more strict as 'javac'). Nevertheless they are never counted as two statements.

Cyclomatic Complexity Number (CCN)

CCN is also know as McCabe Metric. There exists a much hyped theory behind it based on graph theory, but it all comes down to simply counting 'if', 'for', 'while' statements etc. in a method. Whenever the control flow of a method splits, the "CCN counter" gets incremented by one.

Each method has a minimum value of 1 per default. For each of the following Java keywords/statements this value gets incremented by one:

  • if
  • for
  • while
  • case
  • catch

Also if the control flow of a method returns abortively the CCNvalue will be incremented by one:

  • if
  • for

An ordinary return at the end of method will not be counted.

Note that 'else', 'default', and 'finally' don't increment the CCN value any further. On the other hand, a simple method with a 'switch' statement and a huge block of 'case' statements can have a surprisingly high CCN value (still it has the same value when converting a 'switch' block to an equivalent sequence of 'if' statements).