JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 32.53.
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
pl.edu.agh.cast.model.mapper 15 139 1015 138 948 233 284
pl.edu.agh.cast.model.mapper.internal 13 60 896 58 467 141 249
pl.edu.agh.cast.model.base 16 128 660 135 934 74 370
pl.edu.agh.cast.model 7 47 304 32 212 7 101
pl.edu.agh.cast.rawdata.stat 9 58 292 44 310 35 159
pl.edu.agh.cast.rawdata 2 24 100 20 137 5 50
pl.edu.agh.cast.model.base.util 3 6 38 3 18 6 29
pl.edu.agh.cast.model.mapper.annotation 0 0 33 0 0 4 84
pl.edu.agh.cast.filter 3 4 32 7 42 0 48
pl.edu.agh.cast.rawdata.logging 3 9 32 11 66 4 48
pl.edu.agh.cast.resources 1 2 20 3 24 3 22
pl.edu.agh.cast.converter 3 4 15 7 48 1 48
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
75 481 3437 458 3206 513 1492

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
pl.edu.agh.cast.model.mapper.Node 503 57 0 53
pl.edu.agh.cast.model.mapper.Link 288 40 0 34
pl.edu.agh.cast.model.mapper.internal.XMLSaver 179 12 0 5
pl.edu.agh.cast.model.mapper.internal.Helper 127 13 0 14
pl.edu.agh.cast.model.ModelUtil 121 13 1 15
pl.edu.agh.cast.rawdata.stat.BrokenDataInfo 117 20 0 15
pl.edu.agh.cast.model.mapper.internal.ModelParser 110 4 0 4
pl.edu.agh.cast.model.mapper.internal.DBLoader 107 5 0 6
pl.edu.agh.cast.model.mapper.internal.DBSaver 102 6 0 6
pl.edu.agh.cast.model.ModelColumn 83 11 0 4
pl.edu.agh.cast.model.mapper.Mapper 76 12 0 12
pl.edu.agh.cast.model.base.DataImporter 75 7 0 6
pl.edu.agh.cast.model.base.AbstractModelDataLoader 73 5 0 5
pl.edu.agh.cast.model.base.Relation 70 14 0 14
pl.edu.agh.cast.model.base.Entity 68 15 0 15
pl.edu.agh.cast.model.base.DataSet 55 15 0 13
pl.edu.agh.cast.model.base.Model 55 12 0 13
pl.edu.agh.cast.rawdata.TabularData 54 13 0 11
pl.edu.agh.cast.model.base.BasePlugin 54 6 0 7
pl.edu.agh.cast.model.base.TimedRelation 51 10 0 10
pl.edu.agh.cast.model.ModelColumnParameter 49 9 0 3
pl.edu.agh.cast.model.mapper.AbstractMappable 46 12 0 12
pl.edu.agh.cast.model.mapper.internal.XMLLoader 43 3 1 3
pl.edu.agh.cast.rawdata.stat.ErrorType 39 9 0 6
pl.edu.agh.cast.rawdata.DataRow 35 11 0 9
pl.edu.agh.cast.rawdata.stat.BrokenRowInfo 28 7 0 6
pl.edu.agh.cast.model.ModelUtil.DefaultModelPluginRegistryProvider 28 5 0 3
pl.edu.agh.cast.rawdata.stat.ErrorInfo 24 7 0 5
pl.edu.agh.cast.model.base.util.AbstractMainEntitiesUtil 22 4 1 3
pl.edu.agh.cast.model.mapper.internal.XMLRemover 20 2 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
pl.edu.agh.cast.model.mapper.Node 503 57 0 53
pl.edu.agh.cast.model.mapper.Link 288 40 0 34
pl.edu.agh.cast.rawdata.stat.BrokenDataInfo 117 20 0 15
pl.edu.agh.cast.model.base.DataSet 55 15 0 13
pl.edu.agh.cast.model.base.Entity 68 15 0 15
pl.edu.agh.cast.model.base.Relation 70 14 0 14
pl.edu.agh.cast.rawdata.TabularData 54 13 0 11
pl.edu.agh.cast.model.ModelUtil 121 13 1 15
pl.edu.agh.cast.model.mapper.internal.Helper 127 13 0 14
pl.edu.agh.cast.model.mapper.Mapper 76 12 0 12
pl.edu.agh.cast.model.mapper.AbstractMappable 46 12 0 12
pl.edu.agh.cast.model.mapper.internal.XMLSaver 179 12 0 5
pl.edu.agh.cast.model.base.Model 55 12 0 13
pl.edu.agh.cast.rawdata.DataRow 35 11 0 9
pl.edu.agh.cast.model.ModelColumn 83 11 0 4
pl.edu.agh.cast.model.mapper.Mappable 11 10 0 11
pl.edu.agh.cast.model.base.TimedRelation 51 10 0 10
pl.edu.agh.cast.model.base.IDataSet 11 10 0 11
pl.edu.agh.cast.rawdata.stat.ErrorType 39 9 0 6
pl.edu.agh.cast.model.ModelColumnParameter 49 9 0 3
pl.edu.agh.cast.model.base.IEntity 10 9 0 10
pl.edu.agh.cast.model.base.IRelation 10 9 0 10
pl.edu.agh.cast.rawdata.stat.ErrorInfo 24 7 0 5
pl.edu.agh.cast.rawdata.stat.BrokenRowInfo 28 7 0 6
pl.edu.agh.cast.model.base.IModel 8 7 0 8
pl.edu.agh.cast.model.base.DataImporter 75 7 0 6
pl.edu.agh.cast.rawdata.stat.ErrorRegistry 18 6 0 5
pl.edu.agh.cast.model.mapper.internal.DBSaver 102 6 0 6
pl.edu.agh.cast.model.base.BasePlugin 54 6 0 7
pl.edu.agh.cast.rawdata.stat.BrokenCellInfo 19 5 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
40.19 3,437.00 0.04 6.41 6.15

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
pl.edu.agh.cast.model.mapper.Link.save() 56 28 1
pl.edu.agh.cast.model.mapper.internal.ModelParser.startElement(String,String,String,Attributes) 49 17 1
pl.edu.agh.cast.model.mapper.Node.subquery(Object,StringBuilder) 41 11 1
pl.edu.agh.cast.model.mapper.internal.ModelParser.endElement(String,String,String) 39 19 1
pl.edu.agh.cast.model.ModelColumn.equals(Object) 37 31 1
pl.edu.agh.cast.model.mapper.internal.DBLoader.loadLinks(Node,Mappable,Mappable) 37 15 1
pl.edu.agh.cast.model.mapper.Node.find(String,Object) 32 9 1
pl.edu.agh.cast.model.mapper.Node.loadLinks(ResultSet) 30 7 1
pl.edu.agh.cast.model.mapper.internal.DBLoader.loadAttributes(Node,Mappable,Mappable) 30 13 1
pl.edu.agh.cast.model.mapper.Node.save() 29 14 1
pl.edu.agh.cast.model.mapper.Node.setValues(PreparedStatement) 27 6 1
pl.edu.agh.cast.model.mapper.internal.XMLSaver.convertToUTF(String) 27 35 0
pl.edu.agh.cast.model.mapper.internal.DBSaver.saveAttributes(Mappable,Node,Class) 27 8 1
pl.edu.agh.cast.model.base.AbstractModelDataLoader.importRow(DataRow,Integer,BrokenRowInfo,IDataSet,IEntity) 27 12 1
pl.edu.agh.cast.model.mapper.Node.find(long) 25 11 1
pl.edu.agh.cast.model.base.DataImporter.importData(DataRow,IDataSet,IEntity) 25 8 1
pl.edu.agh.cast.model.mapper.Node.loadValues(Integer,Float,String,Timestamp,Boolean) 24 9 1
pl.edu.agh.cast.model.mapper.internal.XMLSaver.saveRelation(IRelation) 24 3 0
pl.edu.agh.cast.model.mapper.internal.DBLoader.find() 24 11 1
pl.edu.agh.cast.model.mapper.internal.DBSaver.createLink(MapLink,Mappable,Mappable,Node,int) 24 9 1
pl.edu.agh.cast.model.mapper.internal.XMLSaver.appendAttributesXML(Mappable,Class) 22 5 0
pl.edu.agh.cast.model.ModelColumnParameter.equals(Object) 21 17 1
pl.edu.agh.cast.model.mapper.internal.XMLLoader.loadModel() 21 4 0
pl.edu.agh.cast.model.mapper.internal.XMLSaver.save(IDataSet) 21 2 0
pl.edu.agh.cast.model.mapper.Node.find(String) 20 7 1
pl.edu.agh.cast.model.mapper.Node.equals(Object) 19 17 1
pl.edu.agh.cast.model.mapper.Link.equals(Object) 19 21 1
pl.edu.agh.cast.model.mapper.Link.find(long) 19 8 1
pl.edu.agh.cast.model.mapper.internal.DBSaver.internalSave(Mappable) 19 8 0
pl.edu.agh.cast.model.base.Relation.equals(Object) 19 15 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,437.00 5.48 2.55 0.81

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