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.riverock.dbrevision.db.impl 8 282 2414 11 50 89 520
org.riverock.dbrevision.db 6 86 1349 21 213 5 147
org.riverock.dbrevision.annotation.schema.db 32 223 855 229 1924 198 787
org.riverock.dbrevision.manager 7 59 456 9 46 0 0
org.riverock.dbrevision.manager.patch 7 29 402 7 39 3 81
org.riverock.dbrevision.utils 2 39 293 12 83 6 219
org.riverock.dbrevision.exception 18 72 180 90 418 0 0
org.riverock.dbrevision.manager.dao 3 13 147 3 15 9 6
org.riverock.dbrevision.system 2 4 83 1 9 0 60
org.riverock.dbrevision.manager.config 3 3 34 3 15 0 0
org.riverock.dbrevision 1 0 6 1 5 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
89 810 6219 387 2817 310 1820

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.riverock.dbrevision.db.DatabaseStructureManager 816 24 0 8
org.riverock.dbrevision.db.impl.OracleDatabase 395 36 0 2
org.riverock.dbrevision.db.impl.PostgreeSqlDatabase 354 36 0 2
org.riverock.dbrevision.db.DatabaseManager 340 17 0 1
org.riverock.dbrevision.db.impl.MySqlDatabase 315 35 0 1
org.riverock.dbrevision.db.impl.SqlServerDatabase 298 35 0 1
org.riverock.dbrevision.manager.patch.PatchService 292 17 1 1
org.riverock.dbrevision.db.impl.HyperSonicDatabase 285 35 0 1
org.riverock.dbrevision.db.impl.InterbaseDatabase 247 35 0 1
org.riverock.dbrevision.db.impl.DB2Database 206 35 0 1
org.riverock.dbrevision.manager.Version 149 19 1 1
org.riverock.dbrevision.utils.Utils 140 25 0 7
org.riverock.dbrevision.utils.DbUtils 132 14 0 5
org.riverock.dbrevision.manager.DbRevisionManager 116 10 0 3
org.riverock.dbrevision.manager.dao.ManagerDaoImpl 113 6 0 1
org.riverock.dbrevision.db.impl.MaxDBDatabase 92 35 0 2
org.riverock.dbrevision.manager.Module 71 12 0 1
org.riverock.dbrevision.annotation.schema.db.ObjectFactory 67 33 0 32
org.riverock.dbrevision.db.DatabaseFactory 60 4 0 1
org.riverock.dbrevision.annotation.schema.db.DbIndex 56 21 0 21
org.riverock.dbrevision.annotation.schema.db.DbField 51 20 0 20
org.riverock.dbrevision.annotation.schema.db.DbForeignKey 51 19 0 19
org.riverock.dbrevision.system.DbStructureImport 51 2 0 0
org.riverock.dbrevision.db.Database 43 37 1 7
org.riverock.dbrevision.manager.patch.PatchSorter 42 2 0 1
org.riverock.dbrevision.annotation.schema.db.DbSequence 41 16 0 16
org.riverock.dbrevision.annotation.schema.db.DbDataFieldData 36 14 0 14
org.riverock.dbrevision.annotation.schema.db.FieldData 31 12 0 12
org.riverock.dbrevision.annotation.schema.db.DbRevision 28 1 1 8
org.riverock.dbrevision.annotation.schema.db.DbPrimaryKey 26 9 0 9

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.riverock.dbrevision.db.Database 43 37 1 7
org.riverock.dbrevision.db.impl.OracleDatabase 395 36 0 2
org.riverock.dbrevision.db.impl.PostgreeSqlDatabase 354 36 0 2
org.riverock.dbrevision.db.impl.DB2Database 206 35 0 1
org.riverock.dbrevision.db.impl.HyperSonicDatabase 285 35 0 1
org.riverock.dbrevision.db.impl.InterbaseDatabase 247 35 0 1
org.riverock.dbrevision.db.impl.MaxDBDatabase 92 35 0 2
org.riverock.dbrevision.db.impl.MySqlDatabase 315 35 0 1
org.riverock.dbrevision.db.impl.SqlServerDatabase 298 35 0 1
org.riverock.dbrevision.annotation.schema.db.ObjectFactory 67 33 0 32
org.riverock.dbrevision.utils.Utils 140 25 0 7
org.riverock.dbrevision.db.DatabaseStructureManager 816 24 0 8
org.riverock.dbrevision.annotation.schema.db.DbIndex 56 21 0 21
org.riverock.dbrevision.annotation.schema.db.DbField 51 20 0 20
org.riverock.dbrevision.annotation.schema.db.DbForeignKey 51 19 0 19
org.riverock.dbrevision.manager.Version 149 19 1 1
org.riverock.dbrevision.db.DatabaseManager 340 17 0 1
org.riverock.dbrevision.manager.patch.PatchService 292 17 1 1
org.riverock.dbrevision.annotation.schema.db.DbSequence 41 16 0 16
org.riverock.dbrevision.annotation.schema.db.DbDataFieldData 36 14 0 14
org.riverock.dbrevision.utils.DbUtils 132 14 0 5
org.riverock.dbrevision.annotation.schema.db.FieldData 31 12 0 12
org.riverock.dbrevision.manager.Module 71 12 0 1
org.riverock.dbrevision.manager.DbRevisionManager 116 10 0 3
org.riverock.dbrevision.annotation.schema.db.DbPrimaryKey 26 9 0 9
org.riverock.dbrevision.annotation.schema.db.Patch 26 9 0 9
org.riverock.dbrevision.annotation.schema.db.DbAbstractTable 21 8 0 8
org.riverock.dbrevision.annotation.schema.db.DbTable 26 7 0 7
org.riverock.dbrevision.manager.ModuleConfig 18 7 0 1
org.riverock.dbrevision.annotation.schema.db.DbForeignKeyColumn 16 6 0 6

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
61.92 6,219.00 0.06 9.10 4.35

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.riverock.dbrevision.db.DatabaseStructureManager.setDataTable(Database,DbTable) 126 45 0
org.riverock.dbrevision.db.DatabaseStructureManager.getFieldsList(Database,String,String) 121 40 1
org.riverock.dbrevision.db.impl.OracleDatabase.createTable(DbTable) 109 44 0
org.riverock.dbrevision.db.DatabaseStructureManager.getDataTable(Database,DbTable) 107 36 1
org.riverock.dbrevision.db.impl.MySqlDatabase.createTable(DbTable) 106 45 0
org.riverock.dbrevision.db.impl.SqlServerDatabase.createTable(DbTable) 100 38 0
org.riverock.dbrevision.manager.patch.PatchService.processAction(Database,Patch) 95 40 0
org.riverock.dbrevision.db.DatabaseManager.sqlTypesMapping(String) 91 61 0
org.riverock.dbrevision.db.impl.HyperSonicDatabase.createTable(DbTable) 89 35 0
org.riverock.dbrevision.db.impl.PostgreeSqlDatabase.createTable(DbTable) 82 33 0
org.riverock.dbrevision.db.DatabaseStructureManager.getForeignKeys(Database,String,String) 79 24 1
org.riverock.dbrevision.db.impl.InterbaseDatabase.createTable(DbTable) 79 30 0
org.riverock.dbrevision.db.impl.DB2Database.createTable(DbTable) 77 30 0
org.riverock.dbrevision.db.impl.SqlServerDatabase.addColumn(DbTable,DbField) 69 25 0
org.riverock.dbrevision.db.impl.MySqlDatabase.addColumn(DbTable,DbField) 66 24 0
org.riverock.dbrevision.db.impl.OracleDatabase.addColumn(DbTable,DbField) 65 28 0
org.riverock.dbrevision.db.impl.HyperSonicDatabase.addColumn(DbTable,DbField) 57 22 0
org.riverock.dbrevision.db.impl.PostgreeSqlDatabase.addColumn(DbTable,DbField) 55 22 0
org.riverock.dbrevision.db.DatabaseStructureManager.createForeignKey(Database,DbForeignKey) 54 18 1
org.riverock.dbrevision.db.impl.InterbaseDatabase.addColumn(DbTable,DbField) 50 17 0
org.riverock.dbrevision.system.DbStructureImport.importStructure(Database,DbSchema,boolean) 40 15 0
org.riverock.dbrevision.db.DatabaseStructureManager.getIndexes(Database,String,String) 37 13 0
org.riverock.dbrevision.db.DatabaseStructureManager.getPrimaryKey(Database,String,String) 35 13 0
org.riverock.dbrevision.manager.Version.initPatches() 34 16 0
org.riverock.dbrevision.db.DatabaseManager.getLongValueList(Database,String,Object[],int[]) 31 9 0
org.riverock.dbrevision.db.DatabaseStructureManager.decodeUpdateRule(ResultSet) 31 10 0
org.riverock.dbrevision.manager.patch.PatchSorter.sort(List) 31 13 0
org.riverock.dbrevision.utils.Utils.createCustomObject(String) 31 16 1
org.riverock.dbrevision.db.DatabaseStructureManager.decodeDeleteRule(ResultSet) 30 10 0
org.riverock.dbrevision.manager.DbRevisionManager.markAllCompleteProccesedVesion(Version,RevisionBean) 30 12 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
6,219.00 6.35 3.02 0.41

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