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.molwind.util 6 109 836 23 181 142 726
org.molwind.graph 7 49 256 48 293 57 164
org.molwind.model 15 73 247 47 318 13 501
org.molwind.view 7 34 142 21 138 1 231
org.molwind.io 5 20 69 19 121 0 114
org.molwind 1 4 11 5 37 0 19
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
41 289 1561 163 1088 213 1755

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.molwind.util.Stringx 417 50 0 11
org.molwind.util.MolwindServerConfiguration 262 31 0 4
org.molwind.graph.DefaultEntityGraph 121 14 2 12
org.molwind.util.MolwindLogger 100 24 0 1
org.molwind.model.BaseRelationship 54 12 0 3
org.molwind.view.Tiles 43 9 0 1
org.molwind.model.LayeredPosition 42 11 0 2
org.molwind.model.BaseWorldEntity 39 8 0 3
org.molwind.view.AbstractTile 33 10 0 3
org.molwind.graph.DefaultEntityEdge 31 10 0 10
org.molwind.io.ImageFileCache 31 10 0 9
org.molwind.graph.DefaultEntityVertex 27 8 0 5
org.molwind.model.PlacedWorldEntity 24 9 0 6
org.molwind.model.AbstractMolwindWorld 20 9 0 2
org.molwind.view.AbstractTopologyManager 15 6 0 4
org.molwind.MolwindException 10 4 0 5
org.molwind.view.TileException 10 4 0 5
org.molwind.io.MolwindLocator 9 3 0 4
org.molwind.model.PartOf 8 2 0 2
org.molwind.graph.EntityVertex 7 6 0 7
org.molwind.graph.EntityEdge 7 6 0 7
org.molwind.model.MolwindWorld 6 5 0 6
org.molwind.util.ConfigException 6 2 0 3
org.molwind.graph.EntityGraph 5 4 0 5
org.molwind.io.AbstractWorldLocator 5 3 0 2
org.molwind.model.WorldEntity 5 4 0 3
org.molwind.model.Relationship 4 3 0 4
org.molwind.model.RelationshipResolver 4 3 0 4
org.molwind.view.TopologyManager 4 3 0 4
org.molwind.io.WorldLocator 3 2 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.molwind.util.Stringx 417 50 0 11
org.molwind.util.MolwindServerConfiguration 262 31 0 4
org.molwind.util.MolwindLogger 100 24 0 1
org.molwind.graph.DefaultEntityGraph 121 14 2 12
org.molwind.model.BaseRelationship 54 12 0 3
org.molwind.model.LayeredPosition 42 11 0 2
org.molwind.graph.DefaultEntityEdge 31 10 0 10
org.molwind.io.ImageFileCache 31 10 0 9
org.molwind.view.AbstractTile 33 10 0 3
org.molwind.model.AbstractMolwindWorld 20 9 0 2
org.molwind.model.PlacedWorldEntity 24 9 0 6
org.molwind.view.Tiles 43 9 0 1
org.molwind.graph.DefaultEntityVertex 27 8 0 5
org.molwind.model.BaseWorldEntity 39 8 0 3
org.molwind.graph.EntityVertex 7 6 0 7
org.molwind.graph.EntityEdge 7 6 0 7
org.molwind.view.AbstractTopologyManager 15 6 0 4
org.molwind.model.MolwindWorld 6 5 0 6
org.molwind.MolwindException 10 4 0 5
org.molwind.graph.EntityGraph 5 4 0 5
org.molwind.model.WorldEntity 5 4 0 3
org.molwind.view.TileException 10 4 0 5
org.molwind.io.AbstractWorldLocator 5 3 0 2
org.molwind.io.MolwindLocator 9 3 0 4
org.molwind.model.Relationship 4 3 0 4
org.molwind.model.RelationshipResolver 4 3 0 4
org.molwind.view.TopologyManager 4 3 0 4
org.molwind.io.WorldLocator 3 2 0 3
org.molwind.io.BasePathSupport 3 2 0 1
org.molwind.model.PartOf 8 2 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
33.59 1,561.00 0.05 7.05 3.98

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.molwind.util.MolwindServerConfiguration.createParam(Class,String) 50 27 0
org.molwind.util.MolwindServerConfiguration.load() 37 15 0
org.molwind.util.Stringx.toColor(String) 31 22 0
org.molwind.graph.DefaultEntityGraph.devideLayers() 30 9 1
org.molwind.util.Stringx.escapeChar(String) 29 11 0
org.molwind.util.Stringx.escapeXmlAttributeValue(String) 23 11 0
org.molwind.util.MolwindServerConfiguration.invokeSetter(Object,Properties) 21 10 0
org.molwind.graph.DefaultEntityGraph.addEdge(String,String,Relationship,int) 18 3 0
org.molwind.graph.DefaultEntityGraph.viewGraph(int) 18 1 1
org.molwind.model.BaseRelationship.equals(Object) 18 8 0
org.molwind.util.Stringx.concat(String) 18 6 0
org.molwind.model.BaseWorldEntity.getRelationship(Relationship) 17 5 0
org.molwind.util.MolwindServerConfiguration.initWorldPaths() 17 6 0
org.molwind.util.Stringx.toStringList(Collection,String) 14 5 0
org.molwind.util.Stringx.extractAll(String,String,String) 14 5 0
org.molwind.util.Stringx.deleteBetweenAll(String,String,String) 14 5 0
org.molwind.util.Stringx.toStringList(Object[],String) 12 5 0
org.molwind.model.BaseRelationship.matches(Relationship) 11 9 0
org.molwind.util.MolwindServerConfiguration.locateWorld(String) 11 5 0
org.molwind.util.MolwindServerConfiguration.getWorldNames() 11 4 0
org.molwind.view.Tiles.getInstance(String) 11 4 0
org.molwind.view.Tiles.writeTile(LayeredPosition,OutputStream) 11 4 0
org.molwind.util.MolwindServerConfiguration.MolwindServerConfiguration(String) 10 1 0
org.molwind.util.MolwindServerConfiguration.pushConfig(Configuration,String) 10 3 0
org.molwind.util.MolwindServerConfiguration.numberInit(String) 10 6 0
org.molwind.util.Stringx.toProperties(String,String) 10 4 0
org.molwind.util.MolwindServerConfiguration.toWorldPath(String,String) 9 6 0
org.molwind.util.Stringx.strtok(String,String,boolean) 9 3 0
org.molwind.util.Stringx.deleteAll(String,String) 9 3 1
org.molwind.util.Stringx.strbreak(String,String,int) 9 2 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,561.00 4.34 2.08 0.42

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