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.sat4j.pb.constraints.pb 21 236 1517 72 587 118 726
org.sat4j.pb.reader 6 66 653 35 216 60 252
org.sat4j.pb 10 106 494 38 227 21 313
org.sat4j.pb.constraints 13 73 354 8 40 4 505
org.sat4j.pb.core 7 30 219 2 13 10 204
org.sat4j.pb.orders 1 5 41 0 0 0 30
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
58 516 3278 155 1083 213 2030

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.sat4j.pb.constraints.pb.ConflictMap 340 28 0 10
org.sat4j.pb.reader.OPBReader2005 293 37 0 23
org.sat4j.pb.constraints.pb.WatchPb 217 36 0 21
org.sat4j.pb.constraints.pb.MinWatchPb 187 18 0 13
org.sat4j.pb.SolverFactory 167 49 0 24
org.sat4j.pb.constraints.pb.MapPb 115 20 0 1
org.sat4j.pb.reader.GoodOPBReader 106 6 0 2
org.sat4j.pb.constraints.pb.MaxWatchPb 103 14 0 11
org.sat4j.pb.reader.OPBReader2007 97 10 0 4
org.sat4j.pb.core.PBSolverCP 82 10 0 2
org.sat4j.pb.OPBStringSolver 66 13 0 3
org.sat4j.pb.constraints.pb.InternalMapPBStructure 62 14 0 1
org.sat4j.pb.constraints.pb.MinWatchCardPB 56 13 0 2
org.sat4j.pb.constraints.AbstractPBClauseCardConstrDataStructure 51 16 0 0
org.sat4j.pb.constraints.pb.Pseudos 50 5 0 0
org.sat4j.pb.constraints.pb.PuebloMinWatchPb 49 9 0 5
org.sat4j.pb.constraints.pb.HTClausePB 46 10 0 3
org.sat4j.pb.constraints.pb.AtLeastPB 42 13 0 0
org.sat4j.pb.reader.PBInstanceReader 41 6 0 1
org.sat4j.pb.constraints.PuebloPBMinClauseCardConstrDataStructure 38 10 0 0
org.sat4j.pb.reader.OPBEclipseReader2007 35 5 0 4
org.sat4j.pb.OptToPBSATAdapter 35 8 0 1
org.sat4j.pb.constraints.pb.MixableCBClausePB 33 10 0 0
org.sat4j.pb.constraints.AbstractPBDataStructureFactory 32 13 0 3
org.sat4j.pb.PseudoOptDecorator 32 10 0 1
org.sat4j.pb.orders.VarOrderHeapObjective 30 5 0 0
org.sat4j.pb.LanceurPseudo2005 26 5 0 2
org.sat4j.pb.ObjectiveFunction 26 5 0 1
org.sat4j.pb.LanceurPseudo2007Eclipse 22 5 0 1
org.sat4j.pb.constraints.pb.BinaryClausePB 21 8 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.sat4j.pb.SolverFactory 167 49 0 24
org.sat4j.pb.reader.OPBReader2005 293 37 0 23
org.sat4j.pb.constraints.pb.WatchPb 217 36 0 21
org.sat4j.pb.constraints.pb.ConflictMap 340 28 0 10
org.sat4j.pb.constraints.pb.MapPb 115 20 0 1
org.sat4j.pb.constraints.pb.MinWatchPb 187 18 0 13
org.sat4j.pb.constraints.AbstractPBClauseCardConstrDataStructure 51 16 0 0
org.sat4j.pb.constraints.pb.InternalMapPBStructure 62 14 0 1
org.sat4j.pb.constraints.pb.MaxWatchPb 103 14 0 11
org.sat4j.pb.OPBStringSolver 66 13 0 3
org.sat4j.pb.constraints.AbstractPBDataStructureFactory 32 13 0 3
org.sat4j.pb.constraints.pb.MinWatchCardPB 56 13 0 2
org.sat4j.pb.constraints.pb.AtLeastPB 42 13 0 0
org.sat4j.pb.constraints.PuebloPBMinClauseCardConstrDataStructure 38 10 0 0
org.sat4j.pb.constraints.pb.MixableCBClausePB 33 10 0 0
org.sat4j.pb.constraints.pb.HTClausePB 46 10 0 3
org.sat4j.pb.constraints.pb.IDataStructurePB 11 10 0 0
org.sat4j.pb.reader.OPBReader2007 97 10 0 4
org.sat4j.pb.core.PBSolverCP 82 10 0 2
org.sat4j.pb.PseudoOptDecorator 32 10 0 1
org.sat4j.pb.constraints.pb.PuebloMinWatchPb 49 9 0 5
org.sat4j.pb.constraints.pb.BinaryClausePB 21 8 0 1
org.sat4j.pb.OptToPBSATAdapter 35 8 0 1
org.sat4j.pb.constraints.pb.IConflict 8 7 0 2
org.sat4j.pb.constraints.pb.UnitClausePB 15 7 0 0
org.sat4j.pb.constraints.pb.PBConstr 7 6 0 1
org.sat4j.pb.reader.GoodOPBReader 106 6 0 2
org.sat4j.pb.reader.PBInstanceReader 41 6 0 1
org.sat4j.pb.core.PBSolver 20 6 0 0
org.sat4j.pb.orders.VarOrderHeapObjective 30 5 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
47.97 3,278.00 0.00 8.90 2.67

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.sat4j.pb.reader.GoodOPBReader.parseLine(String) 69 34 0
org.sat4j.pb.constraints.pb.ConflictMap.resolve(PBConstr,int,VarActivityListener) 59 14 1
org.sat4j.pb.core.PBSolverCP.analyze(Constr,Pair) 39 14 0
org.sat4j.pb.constraints.pb.ConflictMap.reduceUntilConflict(int,int,BigInteger[],WatchPb) 35 5 0
org.sat4j.pb.constraints.pb.MinWatchPb.propagate(UnitPropagationListener,int) 34 12 1
org.sat4j.pb.reader.OPBReader2005.readConstraint() 31 16 1
org.sat4j.pb.constraints.pb.MapPb.cuttingPlaneStep(int,BigInteger) 29 8 0
org.sat4j.pb.reader.OPBReader2005.readObjective() 29 14 1
org.sat4j.pb.constraints.pb.WatchPb.sort(int,int) 27 10 1
org.sat4j.pb.reader.OPBReader2007.readMetaData() 25 13 0
org.sat4j.pb.reader.PBInstanceReader.parseInstance(String) 24 9 0
org.sat4j.pb.constraints.pb.MaxWatchPb.propagate(UnitPropagationListener,int) 23 10 1
org.sat4j.pb.constraints.pb.MinWatchPb.watchMoreForLearntConstraint() 23 9 0
org.sat4j.pb.constraints.pb.ConflictMap.getBacktrackLevel(int) 23 8 1
org.sat4j.pb.constraints.pb.WatchPb.equals(Object) 22 16 0
org.sat4j.pb.reader.OPBReader2005.readIdentifier(StringBuffer) 22 8 1
org.sat4j.pb.reader.OPBEclipseReader2007.readVariablesExplanation() 22 13 0
org.sat4j.pb.reader.OPBReader2007.linearizeProduct(String) 21 4 0
org.sat4j.pb.reader.OPBReader2005.parse() 20 7 1
org.sat4j.pb.orders.VarOrderHeapObjective.init() 19 6 0
org.sat4j.pb.constraints.pb.MinWatchCardPB.minWatchCardPBNew(UnitPropagationListener,ILits,IVecInt,boolean,int,boolean) 19 13 0
org.sat4j.pb.constraints.pb.MinWatchPb.updateWatched(BigInteger,int) 19 7 0
org.sat4j.pb.constraints.pb.ConflictMap.reduceInConstraint(WatchPb,BigInteger[],int,BigInteger) 19 11 1
org.sat4j.pb.constraints.AbstractPBClauseCardConstrDataStructure.constraintFactory(IVecInt,BigInteger,boolean,BigInteger) 17 9 0
org.sat4j.pb.constraints.pb.WatchPb.toString() 17 3 0
org.sat4j.pb.constraints.CompetPBMaxClauseCardConstrDataStructure.constraintFactory(IVecInt,BigInteger,boolean,BigInteger) 17 9 0
org.sat4j.pb.constraints.pb.HTClausePB.register() 16 6 1
org.sat4j.pb.reader.OPBReader2007.readTerm(StringBuffer,StringBuffer) 16 5 0
org.sat4j.pb.reader.OPBReader2005.readMetaData() 16 9 1
org.sat4j.pb.constraints.pb.WatchPb.selectionSort(int,int) 15 6 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,278.00 5.06 2.29 0.25

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