Fractal | Fractal ADL | Cecilia Examples | Minus
 

JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis.
JavaNCSS web site.

Packages

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

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.objectweb.fractal.cecilia.adl.idl.ast 26 65 147 92 412 1 636
org.objectweb.fractal.cecilia.adl.idl.util 1 18 94 2 11 12 154
org.objectweb.fractal.cecilia.adl.idl 9 18 93 24 110 4 217
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
36 101 334 118 533 17 1007

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.objectweb.fractal.cecilia.adl.idl.util.Util 79 18 0 2
org.objectweb.fractal.cecilia.adl.idl.ast.PrimitiveType 16 2 1 4
org.objectweb.fractal.cecilia.adl.idl.AbstractInterfaceVisitor 11 1 0 1
org.objectweb.fractal.cecilia.adl.idl.IDLParserException 10 4 0 5
org.objectweb.fractal.cecilia.adl.idl.ast.Parameter 9 4 0 5
org.objectweb.fractal.cecilia.adl.idl.ast.TypeContainer 9 8 0 9
org.objectweb.fractal.cecilia.adl.idl.AbstractRecordVisitor 9 1 0 1
org.objectweb.fractal.cecilia.adl.idl.AbstractUnionVisitor 9 1 0 1
org.objectweb.fractal.cecilia.adl.idl.ast.Field 8 6 0 7
org.objectweb.fractal.cecilia.adl.idl.CeciliaIDLConstants 7 0 0 1
org.objectweb.fractal.cecilia.adl.idl.ast.EnumNameValuePair 5 4 0 5
org.objectweb.fractal.cecilia.adl.idl.ast.Method 5 4 0 5
org.objectweb.fractal.cecilia.adl.idl.InterfaceVisitor 5 4 0 5
org.objectweb.fractal.cecilia.adl.idl.ast.RecordDefinitionCollectionContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.ImportContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.EnumDefinition 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.UnionDefinitionCollectionContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.MethodContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.ParameterContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.FieldContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.UnionVisitor 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.RecordVisitor 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.ArrayOf 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.ComplexType 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.Import 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.IDLDefinition 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.IDLDefinitionContainer 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.Package 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.PackageContainer 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.ExtendingDefinition 3 2 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.objectweb.fractal.cecilia.adl.idl.util.Util 79 18 0 2
org.objectweb.fractal.cecilia.adl.idl.ast.TypeContainer 9 8 0 9
org.objectweb.fractal.cecilia.adl.idl.ast.Field 8 6 0 7
org.objectweb.fractal.cecilia.adl.idl.ast.EnumNameValuePair 5 4 0 5
org.objectweb.fractal.cecilia.adl.idl.ast.Method 5 4 0 5
org.objectweb.fractal.cecilia.adl.idl.ast.Parameter 9 4 0 5
org.objectweb.fractal.cecilia.adl.idl.InterfaceVisitor 5 4 0 5
org.objectweb.fractal.cecilia.adl.idl.IDLParserException 10 4 0 5
org.objectweb.fractal.cecilia.adl.idl.ast.RecordDefinitionCollectionContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.ImportContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.EnumDefinition 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.UnionDefinitionCollectionContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.MethodContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.ParameterContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.FieldContainer 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.UnionVisitor 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.RecordVisitor 4 3 0 4
org.objectweb.fractal.cecilia.adl.idl.ast.ArrayOf 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.ComplexType 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.Import 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.PrimitiveType 16 2 1 4
org.objectweb.fractal.cecilia.adl.idl.ast.IDLDefinition 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.IDLDefinitionContainer 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.Package 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.PackageContainer 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.ast.ExtendingDefinition 3 2 0 3
org.objectweb.fractal.cecilia.adl.idl.AbstractRecordVisitor 9 1 0 1
org.objectweb.fractal.cecilia.adl.idl.AbstractInterfaceVisitor 11 1 0 1
org.objectweb.fractal.cecilia.adl.idl.IDLVisitor 2 1 0 2
org.objectweb.fractal.cecilia.adl.idl.AbstractUnionVisitor 9 1 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
6.92 334.00 0.03 2.81 3.28

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.objectweb.fractal.cecilia.adl.idl.util.Util.setContainedType(TypeContainer,Type) 14 6 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.getContainedType(TypeContainer) 10 9 0
org.objectweb.fractal.cecilia.adl.idl.AbstractInterfaceVisitor.visit(IDLDefinition) 10 5 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.isComplexType(Type) 8 6 1
org.objectweb.fractal.cecilia.adl.idl.util.Util.getComplexType(Type) 8 7 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.getMethodByName(MethodContainer,String) 8 7 0
org.objectweb.fractal.cecilia.adl.idl.AbstractRecordVisitor.visit(IDLDefinition) 8 4 0
org.objectweb.fractal.cecilia.adl.idl.AbstractUnionVisitor.visit(IDLDefinition) 8 4 0
org.objectweb.fractal.cecilia.adl.idl.ast.PrimitiveType.PrimitiveTypeEnum.fromIDLTypeName(String) 5 5 1
org.objectweb.fractal.cecilia.adl.idl.util.Util.isPrimitiveType(Type) 4 3 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.isConstField(Field) 4 3 0
org.objectweb.fractal.cecilia.adl.idl.ast.PrimitiveType.PrimitiveTypeEnum.PrimitiveTypeEnum(String,String) 3 1 0
org.objectweb.fractal.cecilia.adl.idl.ast.PrimitiveType.PrimitiveTypeEnum.getIdlTypeName() 2 1 1
org.objectweb.fractal.cecilia.adl.idl.ast.PrimitiveType.PrimitiveTypeEnum.getCType() 2 1 1
org.objectweb.fractal.cecilia.adl.idl.util.Util.getPrimitiveType(PrimitiveType) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.getContainedDefinition(ComplexType) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.setContainedDefinition(ComplexType,IDLDefinition) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.isInParameter(Parameter) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.isOutParameter(Parameter) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.isInOutParameter(Parameter) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.isConstParameter(Parameter) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.hasVarParams(Method) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.setImportedAST(Import,Node) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.util.Util.getImportedAST(Import) 2 1 0
org.objectweb.fractal.cecilia.adl.idl.IDLParserException.IDLParserException() 2 1 1
org.objectweb.fractal.cecilia.adl.idl.IDLParserException.IDLParserException(String,Throwable) 2 1 1
org.objectweb.fractal.cecilia.adl.idl.IDLParserException.IDLParserException(String) 2 1 1
org.objectweb.fractal.cecilia.adl.idl.IDLParserException.IDLParserException(Throwable) 2 1 1
org.objectweb.fractal.cecilia.adl.idl.ast.ArrayOf.getSize() 1 1 1
org.objectweb.fractal.cecilia.adl.idl.ast.ArrayOf.setSize(String) 1 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
334.00 1.90 1.46 0.78

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).

 
2007-2009 © ObjectWeb Consortium  | Last Published: 2009-04-21 13:35  | Version: 2.1.0