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.minisat.core 34 273 1176 135 800 147 922
org.sat4j.minisat.constraints.cnf 16 171 870 32 214 72 694
org.sat4j.tools 14 158 764 33 294 54 566
org.sat4j.reader 9 68 685 22 132 18 317
org.sat4j.core 7 143 616 35 247 70 288
org.sat4j.minisat.orders 13 85 394 20 119 32 453
org.sat4j.minisat.constraints.card 3 46 350 17 145 76 140
org.sat4j 6 37 289 18 118 44 180
org.sat4j.minisat.constraints 10 38 259 9 39 4 375
org.sat4j.minisat 1 51 211 36 183 4 21
org.sat4j.minisat.learning 9 44 184 9 68 5 265
org.sat4j.specs 9 106 143 75 562 0 338
org.sat4j.opt 3 24 121 3 23 1 90
org.sat4j.minisat.restarts 4 19 94 4 21 4 117
org.sat4j.minisat.uip 2 8 27 2 18 0 69
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
140 1271 6183 450 2983 531 4835

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.sat4j.minisat.core.Solver 613 80 7 24
org.sat4j.core.VecInt 243 41 2 11
org.sat4j.minisat.constraints.card.MinWatchCard 227 27 0 15
org.sat4j.core.Vec 178 34 1 11
org.sat4j.minisat.SolverFactory 175 51 0 36
org.sat4j.minisat.constraints.cnf.HTClause 140 17 0 6
org.sat4j.AbstractLauncher 124 21 2 9
org.sat4j.minisat.constraints.cnf.Lits 123 26 0 2
org.sat4j.tools.GateTranslator 123 13 0 10
org.sat4j.reader.LecteurDimacs 117 11 0 7
org.sat4j.tools.DimacsStringSolver 114 38 0 1
org.sat4j.minisat.orders.VarOrder 102 19 0 4
org.sat4j.reader.DimacsReader 98 12 0 4
org.sat4j.tools.DimacsOutputSolver 95 36 0 1
org.sat4j.minisat.constraints.cnf.BinaryClause 87 18 0 6
org.sat4j.minisat.constraints.cnf.CBClause 86 19 0 2
org.sat4j.reader.ExtendedDimacsReader 84 3 0 1
org.sat4j.reader.AIGReader 80 10 0 1
org.sat4j.minisat.constraints.card.AtLeast 79 18 0 2
org.sat4j.minisat.orders.VarOrderHeap 78 19 0 8
org.sat4j.tools.SolverDecorator 77 36 0 3
org.sat4j.reader.InstanceReader 69 10 0 1
org.sat4j.minisat.core.Heap 67 16 0 1
org.sat4j.core.ReadOnlyVecInt 65 31 0 1
org.sat4j.minisat.constraints.cnf.TernaryClauses 63 17 0 1
org.sat4j.reader.AAGReader 63 8 0 1
org.sat4j.minisat.core.DotSearchListener 61 15 0 1
org.sat4j.tools.ExtendedDimacsArrayReader 59 2 0 1
org.sat4j.core.ReadOnlyVec 57 26 0 1
org.sat4j.minisat.core.SolverStats 55 3 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.sat4j.minisat.core.Solver 613 80 7 24
org.sat4j.minisat.SolverFactory 175 51 0 36
org.sat4j.core.VecInt 243 41 2 11
org.sat4j.tools.DimacsStringSolver 114 38 0 1
org.sat4j.tools.DimacsOutputSolver 95 36 0 1
org.sat4j.tools.SolverDecorator 77 36 0 3
org.sat4j.core.Vec 178 34 1 11
org.sat4j.core.ReadOnlyVecInt 65 31 0 1
org.sat4j.specs.IVecInt 31 30 0 12
org.sat4j.minisat.constraints.card.MinWatchCard 227 27 0 15
org.sat4j.minisat.constraints.cnf.Lits 123 26 0 2
org.sat4j.core.ReadOnlyVec 57 26 0 1
org.sat4j.specs.IVec 26 25 0 12
org.sat4j.minisat.core.ILits 25 23 0 7
org.sat4j.specs.ISolver 23 22 0 21
org.sat4j.AbstractLauncher 124 21 2 9
org.sat4j.minisat.orders.VarOrder 102 19 0 4
org.sat4j.minisat.orders.VarOrderHeap 78 19 0 8
org.sat4j.minisat.constraints.cnf.CBClause 86 19 0 2
org.sat4j.minisat.constraints.card.AtLeast 79 18 0 2
org.sat4j.minisat.constraints.cnf.BinaryClause 87 18 0 6
org.sat4j.minisat.constraints.cnf.TernaryClauses 63 17 0 1
org.sat4j.minisat.constraints.cnf.HTClause 140 17 0 6
org.sat4j.minisat.constraints.cnf.BinaryClauses 51 17 0 2
org.sat4j.minisat.core.Heap 67 16 0 1
org.sat4j.minisat.constraints.cnf.UnitClause 34 15 0 0
org.sat4j.minisat.core.DotSearchListener 61 15 0 1
org.sat4j.minisat.core.SearchParams 46 13 0 12
org.sat4j.tools.GateTranslator 123 13 0 10
org.sat4j.minisat.constraints.cnf.MarkableLits 53 12 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
38.95 6,183.00 0.09 9.08 3.21

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.sat4j.minisat.core.Solver.isSatisfiable(IVecInt,boolean) 62 19 0
org.sat4j.reader.ExtendedDimacsReader.handleConstr(String,IVecInt) 50 14 0
org.sat4j.minisat.core.Solver.search(long) 49 15 0
org.sat4j.minisat.core.Solver.analyze(Constr,Pair) 39 9 0
org.sat4j.tools.ExtendedDimacsArrayReader.handleConstr(int,int,int[]) 38 10 0
org.sat4j.reader.CardDimacsReader.readConstrs(LineNumberReader) 37 14 0
org.sat4j.minisat.constraints.card.MinWatchCard.computeWatches() 33 14 0
org.sat4j.reader.LecteurDimacs.ajouterClauses(char) 33 14 1
org.sat4j.reader.InstanceReader.parseInstance(String) 33 12 0
org.sat4j.minisat.constraints.cnf.HTClause.propagate(UnitPropagationListener,int) 27 11 0
org.sat4j.minisat.constraints.card.MinWatchCard.propagate(UnitPropagationListener,int) 25 12 1
org.sat4j.minisat.core.Solver.toString(String) 25 3 0
org.sat4j.MoreThanSAT.main(String[]) 25 7 0
org.sat4j.AbstractLauncher.displayHeader() 25 6 1
org.sat4j.minisat.constraints.card.MinWatchCard.MinWatchCard(ILits,IVecInt,boolean,int) 23 6 1
org.sat4j.minisat.constraints.card.MinWatchCard.toString() 23 3 0
org.sat4j.minisat.constraints.cnf.Lits.init(int) 23 3 0
org.sat4j.minisat.core.Solver.analyzeRemovable(int) 23 9 0
org.sat4j.AbstractLauncher.run(String[]) 23 8 0
org.sat4j.tools.Minimal4InclusionModel.model() 22 9 0
org.sat4j.reader.Reader.parseInstance(String) 22 13 0
org.sat4j.core.VecInt.sort(int,int) 22 6 0
org.sat4j.AbstractOptimizationLauncher.solve(IProblem) 22 8 0
org.sat4j.minisat.restarts.LubyRestarts.luby(int) 21 7 0
org.sat4j.reader.DimacsReader.readConstrs(LineNumberReader) 21 11 1
org.sat4j.core.Vec.sort(int,int,T) 21 6 0
org.sat4j.minisat.orders.VarOrder.init() 20 3 0
org.sat4j.minisat.constraints.card.Cards.niceParameters(UnitPropagationListener,ILits,IVecInt,int) 20 13 0
org.sat4j.minisat.constraints.card.MinWatchCard.equals(Object) 20 14 0
org.sat4j.minisat.constraints.cnf.HTClause.equals(Object) 20 15 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
6,183.00 3.76 1.79 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).