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
org.fosstrak.reader.rp.client744598146731140
org.fosstrak.reader.rp.client.model4723100076
org.fosstrak.reader.rp.client.actions919183000171
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
20701012146731387

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.fosstrak.reader.rp.client.TestClient21624110
org.fosstrak.reader.rp.client.model.MethodComboBoxModel188200
org.fosstrak.reader.rp.client.EventSinkUI96811
org.fosstrak.reader.rp.client.ParameterPanel92550
org.fosstrak.reader.rp.client.actions.ObjectChangeAction41200
org.fosstrak.reader.rp.client.HttpTestClient39301
org.fosstrak.reader.rp.client.TcpTestClient32201
org.fosstrak.reader.rp.client.actions.CreateCommandAction20300
org.fosstrak.reader.rp.client.actions.ConnectAction19200
org.fosstrak.reader.rp.client.EventSink15100
org.fosstrak.reader.rp.client.model.ObjectComboBoxModel13100
org.fosstrak.reader.rp.client.actions.DisconnectAction11200
org.fosstrak.reader.rp.client.model.ParameterListModel9200
org.fosstrak.reader.rp.client.model.TypeComboBoxModel9200
org.fosstrak.reader.rp.client.TcpTestServer9101
org.fosstrak.reader.rp.client.actions.SendAction8200
org.fosstrak.reader.rp.client.actions.SetMessageFormatText8200
org.fosstrak.reader.rp.client.actions.SetMessageFormatXML8200
org.fosstrak.reader.rp.client.actions.SetTransportProtocolHttp8200
org.fosstrak.reader.rp.client.actions.SetTransportProtocolTcp8200

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.fosstrak.reader.rp.client.TestClient21624110
org.fosstrak.reader.rp.client.EventSinkUI96811
org.fosstrak.reader.rp.client.ParameterPanel92550
org.fosstrak.reader.rp.client.actions.CreateCommandAction20300
org.fosstrak.reader.rp.client.HttpTestClient39301
org.fosstrak.reader.rp.client.actions.ConnectAction19200
org.fosstrak.reader.rp.client.actions.DisconnectAction11200
org.fosstrak.reader.rp.client.actions.ObjectChangeAction41200
org.fosstrak.reader.rp.client.actions.SendAction8200
org.fosstrak.reader.rp.client.actions.SetMessageFormatText8200
org.fosstrak.reader.rp.client.actions.SetMessageFormatXML8200
org.fosstrak.reader.rp.client.actions.SetTransportProtocolHttp8200
org.fosstrak.reader.rp.client.actions.SetTransportProtocolTcp8200
org.fosstrak.reader.rp.client.model.MethodComboBoxModel188200
org.fosstrak.reader.rp.client.model.ParameterListModel9200
org.fosstrak.reader.rp.client.model.TypeComboBoxModel9200
org.fosstrak.reader.rp.client.TcpTestClient32201
org.fosstrak.reader.rp.client.EventSink15100
org.fosstrak.reader.rp.client.model.ObjectComboBoxModel13100
org.fosstrak.reader.rp.client.TcpTestServer9101

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
42.451,012.000.353.500.70

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.fosstrak.reader.rp.client.model.MethodComboBoxModel.MethodComboBoxModel()17010
org.fosstrak.reader.rp.client.TestClient.getConnectPanel()4411
org.fosstrak.reader.rp.client.actions.ObjectChangeAction.actionPerformed(ActionEvent)37130
org.fosstrak.reader.rp.client.TestClient.getCommandCreatorPanel()2711
org.fosstrak.reader.rp.client.TcpTestClient.run()2550
org.fosstrak.reader.rp.client.EventSinkUI.buildUI()2110
org.fosstrak.reader.rp.client.HttpTestClient.run()2050
org.fosstrak.reader.rp.client.ParameterPanel.initComponents()1910
org.fosstrak.reader.rp.client.EventSinkUI.run()1750
org.fosstrak.reader.rp.client.TestClient.initialize()1710
org.fosstrak.reader.rp.client.EventSinkUI.getInputPanel()1510
org.fosstrak.reader.rp.client.TestClient.getOutputPanel()1510
org.fosstrak.reader.rp.client.TestClient.getInputPanel()1510
org.fosstrak.reader.rp.client.actions.ConnectAction.actionPerformed(ActionEvent)1430
org.fosstrak.reader.rp.client.EventSink.main(String[])1440
org.fosstrak.reader.rp.client.EventSinkUI.main(String[])1421
org.fosstrak.reader.rp.client.EventSinkUI.actionPerformed(ActionEvent)1360
org.fosstrak.reader.rp.client.model.ObjectComboBoxModel.ObjectComboBoxModel()1210
org.fosstrak.reader.rp.client.ParameterPanel.layoutComponents()1210
org.fosstrak.reader.rp.client.TestClient.setConnectPanelEnabled(boolean)1211
org.fosstrak.reader.rp.client.actions.CreateCommandAction.actionPerformed(ActionEvent)1140
org.fosstrak.reader.rp.client.ParameterPanel.ParameterChangeAction.mouseClicked(MouseEvent)1040
org.fosstrak.reader.rp.client.TestClient.getCommandPanel()911
org.fosstrak.reader.rp.client.HttpTestClient.sendMessage(Writer,String)810
org.fosstrak.reader.rp.client.ParameterPanel.ChangeButtonAction.actionPerformed(ActionEvent)820
org.fosstrak.reader.rp.client.TcpTestServer.main(String[])821
org.fosstrak.reader.rp.client.TestClient.createAndShowGUI()711
org.fosstrak.reader.rp.client.TestClient.createImageIcon(String)731
org.fosstrak.reader.rp.client.actions.DisconnectAction.actionPerformed(ActionEvent)620
org.fosstrak.reader.rp.client.ParameterPanel.AddButtonAction.actionPerformed(ActionEvent)620

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,012.009.311.630.16

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