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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
net.sourceforge.jeuclid.app.mathviewer62161120765310140235
net.sourceforge.jeuclid.biparser1411072511976487243
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
7627119321841074227478

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
net.sourceforge.jeuclid.app.mathviewer.MainFrame505592731
net.sourceforge.jeuclid.biparser.BiNode19015015
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog1356102
net.sourceforge.jeuclid.biparser.JEuclidSAXHandler12712013
net.sourceforge.jeuclid.app.mathviewer.FileIO95725
net.sourceforge.jeuclid.app.mathviewer.InsertTableDialog92833
net.sourceforge.jeuclid.biparser.BiTree6613013
net.sourceforge.jeuclid.app.mathviewer.FontSelectionDialog62624
net.sourceforge.jeuclid.biparser.AbstractBiNode6114015
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog60733
net.sourceforge.jeuclid.biparser.EmptyNode52808
net.sourceforge.jeuclid.biparser.TextNode5110010
net.sourceforge.jeuclid.biparser.BiTreeCreationHelper41708
net.sourceforge.jeuclid.app.mathviewer.AboutDialog40314
net.sourceforge.jeuclid.biparser.SAXBiParser37316
net.sourceforge.jeuclid.app.mathviewer.MathViewer32213
net.sourceforge.jeuclid.biparser.TextPosition21607
net.sourceforge.jeuclid.biparser.IBiNode2019020
net.sourceforge.jeuclid.app.mathviewer.MainFrameAppListener16506
net.sourceforge.jeuclid.app.mathviewer.Messages16202
net.sourceforge.jeuclid.app.mathviewer.MathViewer.Runnable11100
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog.ActionListener7100
net.sourceforge.jeuclid.app.mathviewer.FileIO.SaveExportFilter6200
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog.Runnable6110
net.sourceforge.jeuclid.app.mathviewer.InsertTableDialog.Runnable6110
net.sourceforge.jeuclid.app.mathviewer.MainFrame.DocumentListener6300
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog.ActionListener6100
net.sourceforge.jeuclid.app.mathviewer.FontSelectionDialog.ActionListener5100
net.sourceforge.jeuclid.app.mathviewer.MainFrame.ActionListener5100
net.sourceforge.jeuclid.app.mathviewer.MainFrame.ActionListener5100

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
net.sourceforge.jeuclid.app.mathviewer.MainFrame505592731
net.sourceforge.jeuclid.biparser.IBiNode2019020
net.sourceforge.jeuclid.biparser.BiNode19015015
net.sourceforge.jeuclid.biparser.AbstractBiNode6114015
net.sourceforge.jeuclid.biparser.BiTree6613013
net.sourceforge.jeuclid.biparser.JEuclidSAXHandler12712013
net.sourceforge.jeuclid.biparser.TextNode5110010
net.sourceforge.jeuclid.app.mathviewer.InsertTableDialog92833
net.sourceforge.jeuclid.biparser.EmptyNode52808
net.sourceforge.jeuclid.app.mathviewer.FileIO95725
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog60733
net.sourceforge.jeuclid.biparser.BiTreeCreationHelper41708
net.sourceforge.jeuclid.app.mathviewer.FontSelectionDialog62624
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog1356102
net.sourceforge.jeuclid.biparser.TextPosition21607
net.sourceforge.jeuclid.app.mathviewer.MainFrameAppListener16506
net.sourceforge.jeuclid.app.mathviewer.AboutDialog40314
net.sourceforge.jeuclid.app.mathviewer.MainFrame.DocumentListener6300
net.sourceforge.jeuclid.biparser.SAXBiParser37316
net.sourceforge.jeuclid.app.mathviewer.FileIO.SaveExportFilter6200
net.sourceforge.jeuclid.app.mathviewer.Helper4202
net.sourceforge.jeuclid.app.mathviewer.MathViewer32213
net.sourceforge.jeuclid.app.mathviewer.Messages16202
net.sourceforge.jeuclid.app.mathviewer.AboutDialog.KeyAdapter3100
net.sourceforge.jeuclid.app.mathviewer.FileIO.SingletonHolder3100
net.sourceforge.jeuclid.app.mathviewer.FontSelectionDialog.ActionListener5100
net.sourceforge.jeuclid.app.mathviewer.FontSelectionDialog.ListSelectionListener3100
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog.Runnable6110
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog.Runnable.java.awt.event.WindowAdapter2100
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog.java.awt.event.ActionListener2100

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
24.801,932.000.683.572.43

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog.createInputForParameter(Parameter)4370
net.sourceforge.jeuclid.app.mathviewer.InsertTableDialog.initComponents()3811
net.sourceforge.jeuclid.biparser.BiNode.parseAndReplace(BiTree,String,int)33131
net.sourceforge.jeuclid.biparser.SAXBiParser.parse(String)3071
net.sourceforge.jeuclid.app.mathviewer.FileIO.saveDocument(Frame,Node,MutableLayoutContext)2881
net.sourceforge.jeuclid.app.mathviewer.MathViewer.main(String[])2771
net.sourceforge.jeuclid.biparser.BiNode.toString(int)2691
net.sourceforge.jeuclid.biparser.BiNode.createDOMSubtree(Document)2571
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog.init()2320
net.sourceforge.jeuclid.biparser.JEuclidSAXHandler.printElement(String,String,boolean,int,Attributes)2371
net.sourceforge.jeuclid.app.mathviewer.FileIO.selectFileToOpen(Frame)2261
net.sourceforge.jeuclid.app.mathviewer.FontSelectionDialog.setupFontsList(String)2260
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog.initComponents()2111
net.sourceforge.jeuclid.app.mathviewer.MainFrame.setContent(DocumentEvent,String)2071
net.sourceforge.jeuclid.biparser.JEuclidSAXHandler.startElement(String,String,String,Attributes)2041
net.sourceforge.jeuclid.app.mathviewer.AboutDialog.getJContentPane()1921
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog.setupButtonsPanel()1910
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog.setupColorParameter(Parameter)1920
net.sourceforge.jeuclid.app.mathviewer.ParametersDialog.setupTextParameter(Parameter)1910
net.sourceforge.jeuclid.biparser.JEuclidSAXHandler.endElement(String,String,String)1971
net.sourceforge.jeuclid.biparser.BiTree.toStringDOM(int,Node)1860
net.sourceforge.jeuclid.app.mathviewer.FontSelectionDialog.setupButtons()1710
net.sourceforge.jeuclid.app.mathviewer.FileIO.loadFile(Frame,File)1541
net.sourceforge.jeuclid.app.mathviewer.MainFrame.getXMLEditor()1521
net.sourceforge.jeuclid.biparser.BiNode.insert(BiTree,int,int,int)15121
net.sourceforge.jeuclid.biparser.BiTreeCreationHelper.createBiNode(int,int,String,String,Attributes)1551
net.sourceforge.jeuclid.biparser.JEuclidSAXHandler.contentPosition()1531
net.sourceforge.jeuclid.app.mathviewer.InsertPolynomDialog.updateMathMLText()1440
net.sourceforge.jeuclid.biparser.JEuclidSAXHandler.position()1431
net.sourceforge.jeuclid.app.mathviewer.InsertTableDialog.updateMathMLText()1340

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,932.006.311.960.60

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 declarationpackage java.lang;
Import declarationimport java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declarationpublic interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declarationpublic Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
Label declarationfine :

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