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
pl.innosoft.mathj.compiler.javacc 7 92 949 15 159 0 32
pl.innosoft.mathj 9 48 276 22 161 12 3
pl.innosoft.mathj.factory.xml 3 11 136 6 39 0 3
pl.innosoft.mathj.analyzer 7 21 128 13 87 1 2
pl.innosoft.util.dependecies 3 12 87 6 102 17 9
pl.innosoft.mathj.compiler 4 10 44 6 36 0 3
pl.innosoft.mathj.factory 4 12 42 7 45 3 3
pl.innosoft.mathj.ui.console 2 2 40 4 26 3 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
39 208 1702 79 655 36 55

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompilerTokenManager 277 21 0 0
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompiler 249 22 0 0
pl.innosoft.mathj.compiler.javacc.SimpleCharStream 234 36 0 4
pl.innosoft.mathj.ReversePolishNotationManager 102 7 0 6
pl.innosoft.mathj.factory.xml.MathSheetXmlParser 98 5 0 3
pl.innosoft.mathj.compiler.javacc.ParseException 88 5 0 5
pl.innosoft.util.dependecies.DependencyResolver 59 4 0 4
pl.innosoft.mathj.compiler.javacc.TokenMgrError 55 6 0 3
pl.innosoft.mathj.analyzer.ParametrizedExpressionAnalyzer 37 3 0 2
pl.innosoft.mathj.ParametrizedExpression 34 9 0 2
pl.innosoft.mathj.Solver 33 3 0 4
pl.innosoft.mathj.MathSheet 22 8 0 4
pl.innosoft.mathj.analyzer.SimpleExpressionAnalyzer 17 2 0 1
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompilerConstants 17 0 0 0
pl.innosoft.mathj.ui.console.RPNStack 17 1 0 2
pl.innosoft.mathj.analyzer.ParametrizedExpressionAnalyzerException 15 6 0 0
pl.innosoft.util.dependecies.DefaultDependencyNode 15 6 0 1
pl.innosoft.mathj.analyzer.MathSheetDefaultAnalyzer 14 2 0 3
pl.innosoft.mathj.BaseExpression 14 5 0 1
pl.innosoft.mathj.factory.AbstractMathSheetFactory 14 4 0 1
pl.innosoft.mathj.compiler.javacc.Token 12 2 0 3
pl.innosoft.mathj.SimpleExpression 12 3 0 2
pl.innosoft.mathj.ui.console.ExpressionSolver 12 1 0 2
pl.innosoft.mathj.analyzer.AnalyzerException 10 4 0 1
pl.innosoft.mathj.compiler.DefaultExpressionCompiler 10 1 0 2
pl.innosoft.mathj.compiler.DefaultExpressionCompilerException 10 4 0 1
pl.innosoft.mathj.compiler.ExpressionCompilerException 10 4 0 1
pl.innosoft.mathj.ExpressionException 10 4 0 1
pl.innosoft.mathj.factory.MathSheetFactoryException 10 4 0 1
pl.innosoft.mathj.factory.xml.MathSheetParserException 10 4 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
pl.innosoft.mathj.compiler.javacc.SimpleCharStream 234 36 0 4
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompiler 249 22 0 0
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompilerTokenManager 277 21 0 0
pl.innosoft.mathj.ParametrizedExpression 34 9 0 2
pl.innosoft.mathj.MathSheet 22 8 0 4
pl.innosoft.mathj.ReversePolishNotationManager 102 7 0 6
pl.innosoft.mathj.analyzer.ParametrizedExpressionAnalyzerException 15 6 0 0
pl.innosoft.mathj.compiler.javacc.TokenMgrError 55 6 0 3
pl.innosoft.util.dependecies.DefaultDependencyNode 15 6 0 1
pl.innosoft.mathj.BaseExpression 14 5 0 1
pl.innosoft.mathj.compiler.javacc.ParseException 88 5 0 5
pl.innosoft.mathj.Expression 6 5 0 1
pl.innosoft.mathj.factory.xml.MathSheetXmlParser 98 5 0 3
pl.innosoft.mathj.analyzer.AnalyzerException 10 4 0 1
pl.innosoft.mathj.compiler.DefaultExpressionCompilerException 10 4 0 1
pl.innosoft.mathj.compiler.ExpressionCompilerException 10 4 0 1
pl.innosoft.mathj.ExpressionException 10 4 0 1
pl.innosoft.mathj.factory.AbstractMathSheetFactory 14 4 0 1
pl.innosoft.mathj.factory.MathSheetFactoryException 10 4 0 1
pl.innosoft.mathj.factory.xml.MathSheetParserException 10 4 0 1
pl.innosoft.mathj.ReversePolishNotationResolvingException 10 4 0 1
pl.innosoft.util.dependecies.DependencyResolver 59 4 0 4
pl.innosoft.mathj.analyzer.ParametrizedExpressionAnalyzer 37 3 0 2
pl.innosoft.mathj.factory.MathSheetFactory 4 3 0 4
pl.innosoft.mathj.SimpleExpression 12 3 0 2
pl.innosoft.mathj.Solver 33 3 0 4
pl.innosoft.mathj.analyzer.ExpressionAnalyzer 3 2 0 3
pl.innosoft.mathj.analyzer.MathSheetAnalyzer 3 2 0 3
pl.innosoft.mathj.analyzer.MathSheetDefaultAnalyzer 14 2 0 3
pl.innosoft.mathj.analyzer.SimpleExpressionAnalyzer 17 2 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
40.00 1,702.00 0.00 5.33 2.03

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompilerTokenManager.jjMoveNfa_0(int,int) 108 42 0
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompiler.Expression() 50 17 0
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompilerTokenManager.getNextToken() 46 18 0
pl.innosoft.mathj.compiler.javacc.ParseException.add_escapes(String) 39 13 1
pl.innosoft.mathj.compiler.javacc.TokenMgrError.addEscapes(String) 39 13 1
pl.innosoft.mathj.factory.xml.MathSheetXmlParser.processStartElement(XmlPullParser) 35 12 1
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompiler.Element() 33 8 0
pl.innosoft.mathj.compiler.javacc.SimpleCharStream.FillBuff() 32 13 0
pl.innosoft.mathj.compiler.javacc.ParseException.getMessage() 31 11 1
pl.innosoft.mathj.ReversePolishNotationManager.evalOperation(Double,String,Double) 29 18 1
pl.innosoft.mathj.compiler.javacc.SimpleCharStream.ExpandBuff(boolean) 28 4 0
pl.innosoft.mathj.factory.xml.MathSheetXmlParser.processText(XmlPullParser) 28 10 0
pl.innosoft.mathj.compiler.javacc.SimpleCharStream.UpdateLineColumn(char) 27 7 0
pl.innosoft.mathj.compiler.javacc.SimpleCharStream.adjustBeginLineColumn(int,int) 25 7 1
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompilerTokenManager.jjMoveStringLiteralDfa0_0() 23 19 0
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompiler.generateParseException() 22 10 0
pl.innosoft.mathj.ReversePolishNotationManager.solveStack(Stack) 22 8 1
pl.innosoft.util.dependecies.DependencyResolver.isCyclic(DependencyNode,Map) 21 12 1
pl.innosoft.util.dependecies.DependencyResolver.isIndependent(DependencyNode,List,Map) 18 10 1
pl.innosoft.mathj.analyzer.ParametrizedExpressionAnalyzer.validate(Expression) 17 10 0
pl.innosoft.util.dependecies.DependencyResolver.recursiveNodesDependencyCheck(DependencyNode,DependencyNode,DependencyNode,List,Map) 17 14 0
pl.innosoft.mathj.ui.console.RPNStack.main(String[]) 16 5 1
pl.innosoft.mathj.analyzer.ParametrizedExpressionAnalyzer.isValid(Expression) 15 9 0
pl.innosoft.mathj.Solver.solve(Expression) 15 5 1
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompiler.pushOperator(String) 14 4 0
pl.innosoft.mathj.factory.xml.MathSheetXmlParser.processDocument(XmlPullParser) 14 5 0
pl.innosoft.mathj.analyzer.SimpleExpressionAnalyzer.isValid(Expression) 13 8 0
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompiler.jj_consume_token(int) 13 5 0
pl.innosoft.mathj.compiler.javacc.JavaCCEquationCompilerTokenManager.jjMoveStringLiteralDfa1_0(long) 13 6 0
pl.innosoft.mathj.Solver.solve(MathSheet,String) 13 3 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,702.00 6.79 2.91 0.22

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