Fork me on GitHub

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
io.github.prolobjectlink.prolog.jtrolog 36 354 2098 30 156 30 714
jTrolog.engine 18 181 1371 66 418 142 305
jTrolog.lib 6 155 1009 26 128 207 237
jTrolog.parser 5 40 592 18 100 183 84
jTrolog.terms 18 107 474 51 194 17 375
jTrolog.errors 4 9 27 4 17 0 152
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
87 846 5571 195 1013 579 1867

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
jTrolog.lib.BasicLibrary 488 63 0 6
jTrolog.engine.BindingsTable 306 24 2 6
jTrolog.engine.Prolog 299 50 0 26
io.github.prolobjectlink.prolog.jtrolog.JTrologEngine 269 45 0 1
jTrolog.parser.Parser 266 20 0 10
jTrolog.parser.Tokenizer 227 7 1 6
jTrolog.lib.BuiltIn 211 39 0 8
io.github.prolobjectlink.prolog.jtrolog.JTrologQuery 202 20 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologTerm 199 29 0 2
jTrolog.engine.Engine 157 14 1 4
jTrolog.terms.Struct 152 15 0 5
io.github.prolobjectlink.prolog.jtrolog.JTrologConverter 150 6 0 1
jTrolog.lib.IOLibrary 146 22 0 2
io.github.prolobjectlink.prolog.jtrolog.JTrologMap 132 32 1 1
jTrolog.engine.LibraryAndTheoryManager 112 18 0 13
io.github.prolobjectlink.prolog.jtrolog.JTrolog 105 39 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologList 90 14 1 1
jTrolog.lib.ISOLibrary 82 22 0 2
jTrolog.engine.ChoicePoint 70 11 0 3
jTrolog.engine.SolutionManager 58 4 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologFormatter 56 1 0 1
jTrolog.engine.OperatorTable 56 3 1 4
io.github.prolobjectlink.prolog.jtrolog.JTrologEntry 55 13 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologClauses 53 11 0 0
jTrolog.engine.ClauseDatabase 53 8 1 1
jTrolog.engine.LinkTable 51 12 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologVariable 49 14 0 1
jTrolog.engine.GarbageCan 46 6 0 1
jTrolog.engine.OperatorTable.OperatorIterator 46 4 0 0
io.github.prolobjectlink.prolog.jtrolog.JTrologReference 43 10 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
jTrolog.lib.BasicLibrary 488 63 0 6
jTrolog.engine.Prolog 299 50 0 26
io.github.prolobjectlink.prolog.jtrolog.JTrologEngine 269 45 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrolog 105 39 0 1
jTrolog.lib.BuiltIn 211 39 0 8
io.github.prolobjectlink.prolog.jtrolog.JTrologMap 132 32 1 1
io.github.prolobjectlink.prolog.jtrolog.JTrologTerm 199 29 0 2
jTrolog.engine.BindingsTable 306 24 2 6
jTrolog.lib.IOLibrary 146 22 0 2
jTrolog.lib.ISOLibrary 82 22 0 2
io.github.prolobjectlink.prolog.jtrolog.JTrologQuery 202 20 0 1
jTrolog.parser.Parser 266 20 0 10
jTrolog.engine.LibraryAndTheoryManager 112 18 0 13
jTrolog.terms.Struct 152 15 0 5
io.github.prolobjectlink.prolog.jtrolog.JTrologList 90 14 1 1
io.github.prolobjectlink.prolog.jtrolog.JTrologVariable 49 14 0 1
jTrolog.engine.Engine 157 14 1 4
io.github.prolobjectlink.prolog.jtrolog.JTrologEntry 55 13 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologDouble 25 12 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologFloat 25 12 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologInteger 25 12 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologLong 25 12 0 1
jTrolog.engine.LinkTable 51 12 0 1
io.github.prolobjectlink.prolog.jtrolog.JTrologClauses 53 11 0 0
io.github.prolobjectlink.prolog.jtrolog.JTrologStructure 40 11 0 1
jTrolog.engine.ChoicePoint 70 11 0 3
io.github.prolobjectlink.prolog.jtrolog.JTrologReference 43 10 0 0
jTrolog.terms.Int 25 10 0 5
jTrolog.terms.Float 21 9 0 5
jTrolog.terms.Number 23 9 0 6

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
59.56 5,571.00 0.10 9.72 2.24

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
jTrolog.parser.Tokenizer.readNextToken() 169 107 0
io.github.prolobjectlink.prolog.jtrolog.JTrologTerm.compareTo(PrologTerm) 95 56 0
jTrolog.parser.Parser.expr0() 70 47 1
io.github.prolobjectlink.prolog.jtrolog.JTrologConverter.toTerm(Term) 66 37 0
io.github.prolobjectlink.prolog.jtrolog.JTrologConverter.fromTerm(PrologTerm) 65 49 0
jTrolog.parser.Parser.expr(int,boolean) 58 27 0
jTrolog.engine.BindingsTable.unifyTrees(int,int,int[],Term[],Term[],Term[][],int,int) 55 41 0
io.github.prolobjectlink.prolog.jtrolog.JTrologFormatter.format(LogRecord) 50 10 0
jTrolog.lib.BasicLibrary.$tofromlist_2(BindingsTable,Term,Term) 49 28 0
jTrolog.lib.BasicLibrary.getSynonym(String) 46 45 1
jTrolog.engine.DefaultProlog.DefaultProlog() 42 1 0
jTrolog.lib.BasicLibrary.term_greater_than_2(BindingsTable,Term,Term) 34 30 0
jTrolog.terms.Struct.toStringImpl(boolean) 33 31 0
jTrolog.parser.Parser.parseLeftSide(boolean,int) 31 18 1
jTrolog.terms.Struct.prepArrays() 31 8 0
jTrolog.parser.Tokenizer.Tokenizer(Reader) 29 1 1
jTrolog.engine.BindingsTable.unifyBranch(Term,Term,int,int) 28 20 1
jTrolog.engine.OperatorTable.OperatorIterator.next() 28 9 0
jTrolog.engine.Prolog.getPrimitives(Library) 27 11 1
jTrolog.engine.Engine.addToStack(Struct,int,ChoicePoint) 26 13 1
jTrolog.lib.BasicLibrary.$functor_3(BindingsTable,Term,Term,Term) 26 26 0
jTrolog.lib.BasicLibrary.$stripBagList_5(BindingsTable,Struct,Struct,Term,Term,Term) 26 5 0
jTrolog.engine.BindingsTable.checkForInternalOccurencesOfVarInTerm(int,int,Term,int) 25 20 1
io.github.prolobjectlink.prolog.jtrolog.JTrologEngine.exist(Clause) 24 15 0
io.github.prolobjectlink.prolog.jtrolog.JTrologQuery.nSolutions(int) 24 11 0
io.github.prolobjectlink.prolog.jtrolog.JTrologQuery.allSolutions() 23 9 0
jTrolog.engine.LibraryAndTheoryManager.runDirective(Struct) 23 11 0
jTrolog.engine.Prolog.main(String[]) 23 5 1
jTrolog.engine.SolutionManager.replaceUnknownManInTheMiddle(HashMap) 23 9 0
jTrolog.lib.BasicLibrary.term_equality_2(BindingsTable,Term,Term) 23 22 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
5,571.00 5.54 3.02 0.14

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