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 74 752 2878 416 4198 100 2017
io.github.prolobjectlink.prolog.spi 1 4 11 4 30 1 25
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
75 756 2889 420 4228 101 2042

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
io.github.prolobjectlink.prolog.AbstractProvider 243 38 0 2
io.github.prolobjectlink.prolog.AbstractClause 223 45 1 3
io.github.prolobjectlink.prolog.AbstractTerm 159 32 0 5
io.github.prolobjectlink.prolog.AbstractConsole 155 4 0 1
io.github.prolobjectlink.prolog.AbstractConverter 137 19 0 1
io.github.prolobjectlink.prolog.AbstractEngine 137 38 1 1
io.github.prolobjectlink.prolog.AbstractJavaConverter 128 13 0 1
io.github.prolobjectlink.prolog.PrologBuiltin 114 1 0 0
io.github.prolobjectlink.prolog.AbstractProgram 106 30 0 0
io.github.prolobjectlink.prolog.AbstractCompounds 104 20 0 0
io.github.prolobjectlink.prolog.AbstractQuery 85 26 0 1
io.github.prolobjectlink.prolog.PrologScriptEngineFactory 74 15 0 1
io.github.prolobjectlink.prolog.DefaultClauseBuilder 67 15 0 1
io.github.prolobjectlink.prolog.PrologEngine 66 65 0 66
io.github.prolobjectlink.prolog.PrologError 62 2 0 0
io.github.prolobjectlink.prolog.AbstractOperator 54 8 0 1
io.github.prolobjectlink.prolog.AbstractBuilder 52 8 0 1
io.github.prolobjectlink.prolog.PrologProvider 52 51 0 52
io.github.prolobjectlink.prolog.PrologScriptEngine 48 10 0 1
io.github.prolobjectlink.prolog.DefaultQueryBuilder 45 11 0 1
io.github.prolobjectlink.prolog.PrologTerm 43 42 0 43
io.github.prolobjectlink.prolog.PrologLogger 39 12 0 13
io.github.prolobjectlink.prolog.AbstractIndicator 35 7 0 1
io.github.prolobjectlink.prolog.Prolog 27 4 0 4
io.github.prolobjectlink.prolog.PrologQuery 26 25 0 26
io.github.prolobjectlink.prolog.PrologTermType 26 1 0 1
io.github.prolobjectlink.prolog.PrologProgram 25 24 0 1
io.github.prolobjectlink.prolog.AbstractLogger 23 11 0 1
io.github.prolobjectlink.prolog.PrologClause 23 22 0 23
io.github.prolobjectlink.prolog.Licenses 18 1 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
io.github.prolobjectlink.prolog.PrologEngine 66 65 0 66
io.github.prolobjectlink.prolog.PrologProvider 52 51 0 52
io.github.prolobjectlink.prolog.AbstractClause 223 45 1 3
io.github.prolobjectlink.prolog.PrologTerm 43 42 0 43
io.github.prolobjectlink.prolog.AbstractEngine 137 38 1 1
io.github.prolobjectlink.prolog.AbstractProvider 243 38 0 2
io.github.prolobjectlink.prolog.AbstractTerm 159 32 0 5
io.github.prolobjectlink.prolog.AbstractProgram 106 30 0 0
io.github.prolobjectlink.prolog.AbstractQuery 85 26 0 1
io.github.prolobjectlink.prolog.PrologQuery 26 25 0 26
io.github.prolobjectlink.prolog.PrologProgram 25 24 0 1
io.github.prolobjectlink.prolog.PrologClause 23 22 0 23
io.github.prolobjectlink.prolog.AbstractCompounds 104 20 0 0
io.github.prolobjectlink.prolog.AbstractConverter 137 19 0 1
io.github.prolobjectlink.prolog.PrologDocumentable 17 16 0 17
io.github.prolobjectlink.prolog.DefaultClauseBuilder 67 15 0 1
io.github.prolobjectlink.prolog.PrologScriptEngineFactory 74 15 0 1
io.github.prolobjectlink.prolog.AbstractJavaConverter 128 13 0 1
io.github.prolobjectlink.prolog.PrologClauseBuilder 14 13 0 14
io.github.prolobjectlink.prolog.PrologLogger 39 12 0 13
io.github.prolobjectlink.prolog.AbstractLogger 23 11 0 1
io.github.prolobjectlink.prolog.DefaultQueryBuilder 45 11 0 1
io.github.prolobjectlink.prolog.PrologConverter 11 10 0 11
io.github.prolobjectlink.prolog.PrologJavaConverter 11 10 0 11
io.github.prolobjectlink.prolog.PrologQueryBuilder 11 10 0 11
io.github.prolobjectlink.prolog.PrologScriptEngine 48 10 0 1
io.github.prolobjectlink.prolog.AbstractBuilder 52 8 0 1
io.github.prolobjectlink.prolog.AbstractOperator 54 8 0 1
io.github.prolobjectlink.prolog.PrologMapper 9 8 0 1
io.github.prolobjectlink.prolog.PrologNumber 9 8 0 9

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
35.63 2,889.00 0.03 10.08 5.60

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
io.github.prolobjectlink.prolog.AbstractConsole.run(String[]) 118 27 0
io.github.prolobjectlink.prolog.AbstractClause.equals(Object) 57 48 0
io.github.prolobjectlink.prolog.AbstractTerm.getObject() 45 38 0
io.github.prolobjectlink.prolog.AbstractJavaConverter.toTerm(Object) 36 35 0
io.github.prolobjectlink.prolog.AbstractCompounds.unify(PrologTerm) 35 23 0
io.github.prolobjectlink.prolog.AbstractTerm.unify(PrologTerm,PrologTerm) 35 25 1
io.github.prolobjectlink.prolog.AbstractClause.toString() 30 10 0
io.github.prolobjectlink.prolog.AbstractCompounds.compareTo(PrologTerm) 30 22 0
io.github.prolobjectlink.prolog.AbstractJavaConverter.toObject(PrologTerm) 30 28 0
io.github.prolobjectlink.prolog.AbstractOperator.equals(Object) 23 19 0
io.github.prolobjectlink.prolog.AbstractBuilder.equals(Object) 21 17 0
io.github.prolobjectlink.prolog.AbstractConverter.equals(Object) 21 17 0
io.github.prolobjectlink.prolog.PrologScriptEngineFactory.equals(Object) 18 14 0
io.github.prolobjectlink.prolog.PrologScriptEngine.eval(String,Bindings) 17 7 0
io.github.prolobjectlink.prolog.AbstractConsole.printUsage() 16 1 0
io.github.prolobjectlink.prolog.PrologScriptEngineFactory.getParameter(String) 16 11 0
io.github.prolobjectlink.prolog.AbstractEngine.equals(Object) 15 12 0
io.github.prolobjectlink.prolog.AbstractIndicator.equals(Object) 15 12 0
io.github.prolobjectlink.prolog.AbstractJavaConverter.equals(Object) 15 12 0
io.github.prolobjectlink.prolog.AbstractProgram.equals(Object) 15 12 0
io.github.prolobjectlink.prolog.AbstractProvider.equals(Object) 15 12 0
io.github.prolobjectlink.prolog.AbstractQuery.equals(Object) 15 12 0
io.github.prolobjectlink.prolog.Prolog.getProvider(Class) 15 5 1
io.github.prolobjectlink.prolog.AbstractClause.hashCode() 14 11 0
io.github.prolobjectlink.prolog.AbstractEngine.getProgramMap() 12 3 0
io.github.prolobjectlink.prolog.AbstractConsole.getArguments(String[]) 11 3 0
io.github.prolobjectlink.prolog.AbstractTerm.match(PrologTerm) 11 4 1
io.github.prolobjectlink.prolog.PrologScriptEngine.eval(Reader,Bindings) 11 4 0
io.github.prolobjectlink.prolog.AbstractProgram.getClauses() 10 4 0
io.github.prolobjectlink.prolog.PrologScriptEngineFactory.getProgram(String) 10 4 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,889.00 2.84 1.75 0.47

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