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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
net.sourceforge.networktools.core.telnet958774175110127
net.sourceforge.networktools.core.portscanner6324596183618
net.sourceforge.networktools.proportionlayout43745633530483
net.sourceforge.networktools.jcolorchooserbutton2104472106
net.sourceforge.networktools.core12381363
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
22139177164623147137

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
net.sourceforge.networktools.core.telnet.TelnetPanel399712
net.sourceforge.networktools.core.portscanner.PortScanner177601
net.sourceforge.networktools.core.portscanner.ScanJobPool138901
net.sourceforge.networktools.proportionlayout.ProportionConstraints119809
net.sourceforge.networktools.proportionlayout.ProportionLayout11919020
net.sourceforge.networktools.proportionlayout.ProportionLinePart115702
net.sourceforge.networktools.proportionlayout.ProportionLine89302
net.sourceforge.networktools.core.telnet.TelnetData78501
net.sourceforge.networktools.core.telnet.TelnetPipeline58702
net.sourceforge.networktools.core.telnet.Telnet421102
net.sourceforge.networktools.core.telnet.TelnetServer42802
net.sourceforge.networktools.core.portscanner.ScanJob40601
net.sourceforge.networktools.core.telnet.TelnetConnection35402
net.sourceforge.networktools.core.portscanner.ScanJobThread32301
net.sourceforge.networktools.core.telnet.TelnetListener30402
net.sourceforge.networktools.core.NetworkTools29201
net.sourceforge.networktools.core.portscanner.NumberRangeCollection26401
net.sourceforge.networktools.jcolorchooserbutton.JColorChooserButton25605
net.sourceforge.networktools.core.portscanner.NumberRange21401
net.sourceforge.networktools.core.telnet.TelnetClient21502
net.sourceforge.networktools.jcolorchooserbutton.JColorChooserButtonIcon12402
net.sourceforge.networktools.core.telnet.TelnetSession10702

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
net.sourceforge.networktools.proportionlayout.ProportionLayout11919020
net.sourceforge.networktools.core.telnet.Telnet421102
net.sourceforge.networktools.core.portscanner.ScanJobPool138901
net.sourceforge.networktools.core.telnet.TelnetServer42802
net.sourceforge.networktools.proportionlayout.ProportionConstraints119809
net.sourceforge.networktools.core.telnet.TelnetPanel399712
net.sourceforge.networktools.core.telnet.TelnetPipeline58702
net.sourceforge.networktools.core.telnet.TelnetSession10702
net.sourceforge.networktools.proportionlayout.ProportionLinePart115702
net.sourceforge.networktools.core.portscanner.PortScanner177601
net.sourceforge.networktools.core.portscanner.ScanJob40601
net.sourceforge.networktools.jcolorchooserbutton.JColorChooserButton25605
net.sourceforge.networktools.core.telnet.TelnetClient21502
net.sourceforge.networktools.core.telnet.TelnetData78501
net.sourceforge.networktools.core.portscanner.NumberRange21401
net.sourceforge.networktools.core.portscanner.NumberRangeCollection26401
net.sourceforge.networktools.core.telnet.TelnetConnection35402
net.sourceforge.networktools.core.telnet.TelnetListener30402
net.sourceforge.networktools.jcolorchooserbutton.JColorChooserButtonIcon12402
net.sourceforge.networktools.core.portscanner.ScanJobThread32301
net.sourceforge.networktools.proportionlayout.ProportionLine89302
net.sourceforge.networktools.core.NetworkTools29201

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
75.321,771.000.056.322.91

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
net.sourceforge.networktools.core.telnet.TelnetPanel.TelnetPanel(Telnet)22261
net.sourceforge.networktools.core.portscanner.PortScanner.PortScanner()9330
net.sourceforge.networktools.core.telnet.TelnetPanel.actionPerformed(ActionEvent)82330
net.sourceforge.networktools.proportionlayout.ProportionLine.arrangeLines(ArrayList,TreeSet,int)59220
net.sourceforge.networktools.core.portscanner.ScanJobPool.run()47220
net.sourceforge.networktools.core.portscanner.PortScanner.actionPerformed(ActionEvent)46110
net.sourceforge.networktools.core.telnet.TelnetData.TelnetData(int,String,int,int)42160
net.sourceforge.networktools.proportionlayout.ProportionLayout.layoutContainer(Container)4281
net.sourceforge.networktools.proportionlayout.ProportionConstraints.getColumnLinePart(Component,int)31161
net.sourceforge.networktools.proportionlayout.ProportionConstraints.getRowLinePart(Component,int)31161
net.sourceforge.networktools.core.portscanner.ScanJobThread.run()21130
net.sourceforge.networktools.core.portscanner.ScanJob.compareTo(Object)20140
net.sourceforge.networktools.core.telnet.TelnetPanel.setSessionState(int)2070
net.sourceforge.networktools.proportionlayout.ProportionLinePart.compareTo(Object)20130
net.sourceforge.networktools.proportionlayout.ProportionConstraints.ProportionConstraints(int,int,int,int,int,int,int,int,int,int,int,int,int,int)19171
net.sourceforge.networktools.core.NetworkTools.NetworkTools()1810
net.sourceforge.networktools.core.telnet.TelnetData.getString(int)1880
net.sourceforge.networktools.proportionlayout.ProportionLine.layoutLines(ArrayList,int,int,int,double,int)1860
net.sourceforge.networktools.proportionlayout.ProportionLinePart.getX(ArrayList,int)18110
net.sourceforge.networktools.core.portscanner.ScanJobPool.getNextScanJob()1790
net.sourceforge.networktools.core.telnet.TelnetPanel.run()1760
net.sourceforge.networktools.core.telnet.TelnetPipeline.processConnection(Socket)1540
net.sourceforge.networktools.core.portscanner.ScanJobPool.calculateAddresses(Object[],int,ArrayList,String)1470
net.sourceforge.networktools.core.telnet.TelnetPanel.appendDataToTexts(TelnetData)1440
net.sourceforge.networktools.proportionlayout.ProportionLinePart.getMinimumWidth()1450
net.sourceforge.networktools.proportionlayout.ProportionLinePart.getPreferredWidth()1450
net.sourceforge.networktools.core.portscanner.ScanJobPool.ScanJobPool(PortScanner,boolean,String,String,int,int)1320
net.sourceforge.networktools.core.telnet.TelnetListener.run()1360
net.sourceforge.networktools.core.telnet.TelnetConnection.run()1240
net.sourceforge.networktools.proportionlayout.ProportionLayout.addLayoutComponent(Component,Object)1241

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,771.0010.433.390.30

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