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.fest.swing.driver166104154892411774545394
org.fest.swing.fixture60128239011283880201008
org.fest.swing.core4542117012411388381147
org.fest.swing.keystroke1559745352584229
org.fest.swing.util2391470724540381
org.fest.swing.monitor11804672311912216
org.fest.swing.input9693902713815150
org.fest.swing.hierarchy15703693217916281
org.fest.swing.format1346342341830214
org.fest.swing.core.matcher656209474820150
org.fest.swing.edt737199171096121
org.fest.swing.data629193191530144
org.fest.swing.applet438184291610100
org.fest.swing.finder754180493780170
org.fest.swing.launcher42113614163182
org.fest.swing.awt11913294912102
org.fest.swing.query112212612940214
org.fest.swing.timing32610720121048
org.fest.swing.image4171031271073
org.fest.swing.exception81762231130120
org.fest.swing.listener29618441044
org.fest.swing.security416591260074
org.fest.swing.lock1751526022
org.fest.swing.annotation1550213096
org.fest.swing.cell51236121510115
org.fest.swing.testing1413416115
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
43235481577522821549916910710

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.fest.swing.core.BasicRobot37380719
org.fest.swing.driver.JTreeDriver2646776
org.fest.swing.driver.JTableDriver23562163
org.fest.swing.driver.JListDriver1955658
org.fest.swing.fixture.ContainerFixture18884083
org.fest.swing.fixture.JTreeFixture18162062
org.fest.swing.fixture.JListFixture18064061
org.fest.swing.fixture.JTableFixture17462060
org.fest.swing.driver.JComboBoxDriver1533965
org.fest.swing.core.BasicComponentFinder13645114
org.fest.swing.driver.JInternalFrameDriver1303272
org.fest.swing.driver.JTextComponentDriver1243142
org.fest.swing.fixture.JComboBoxFixture12443043
org.fest.swing.driver.ComponentDriver1223733
org.fest.swing.fixture.FrameFixture11238038
org.fest.swing.driver.JScrollBarDriver1092856
org.fest.swing.fixture.JScrollBarFixture10937037
org.fest.swing.awt.AWT1081929
org.fest.swing.fixture.JInternalFrameFixture10837037
org.fest.swing.fixture.JTextComponentFixture10837037
org.fest.swing.keystroke.KeyStrokeMappingProvider_de106102
org.fest.swing.fixture.JOptionPaneFixture10537037
org.fest.swing.keystroke.KeyStrokeMappingProvider_en104212
org.fest.swing.driver.JSpinnerDriver1032162
org.fest.swing.fixture.DialogFixture10335035
org.fest.swing.fixture.JSpinnerFixture9934034
org.fest.swing.keystroke.KeyStrokeMappingProvider_mac_fr_FR97212
org.fest.swing.fixture.JTabbedPaneFixture9533033
org.fest.swing.fixture.JCheckBoxFixture9332032
org.fest.swing.fixture.JRadioButtonFixture9332032

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.fest.swing.fixture.ContainerFixture18884083
org.fest.swing.core.BasicRobot37380719
org.fest.swing.fixture.ComponentContainerFixture7775075
org.fest.swing.driver.JTreeDriver2646776
org.fest.swing.fixture.JListFixture18064061
org.fest.swing.driver.JTableDriver23562163
org.fest.swing.fixture.JTableFixture17462060
org.fest.swing.fixture.JTreeFixture18162062
org.fest.swing.driver.JListDriver1955658
org.fest.swing.core.Robot5251051
org.fest.swing.core.BasicComponentFinder13645114
org.fest.swing.fixture.JComboBoxFixture12443043
org.fest.swing.driver.JComboBoxDriver1533965
org.fest.swing.fixture.FrameFixture11238038
org.fest.swing.driver.ComponentDriver1223733
org.fest.swing.fixture.JInternalFrameFixture10837037
org.fest.swing.fixture.JOptionPaneFixture10537037
org.fest.swing.fixture.JScrollBarFixture10937037
org.fest.swing.fixture.JTextComponentFixture10837037
org.fest.swing.fixture.DialogFixture10335035
org.fest.swing.fixture.JSpinnerFixture9934034
org.fest.swing.fixture.JTabbedPaneFixture9533033
org.fest.swing.driver.JInternalFrameDriver1303272
org.fest.swing.fixture.JCheckBoxFixture9332032
org.fest.swing.fixture.JRadioButtonFixture9332032
org.fest.swing.fixture.JTableCellFixture8732026
org.fest.swing.fixture.JToggleButtonFixture9332032
org.fest.swing.core.ComponentFinder3231015
org.fest.swing.driver.JTextComponentDriver1243142
org.fest.swing.fixture.JFileChooserFixture8329026

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
29.1015,775.000.628.215.28

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.fest.swing.keystroke.KeyStrokeMappingProvider_de.keyStrokeMappings()10511
org.fest.swing.keystroke.KeyStrokeMappingProvider_en.createMappings()9910
org.fest.swing.keystroke.KeyStrokeMappingProvider_mac_fr_FR.createMappings()9210
org.fest.swing.keystroke.KeyStrokeMappingProvider_fr.createMappings()8210
org.fest.swing.driver.JTreePathFinder.findMatchingPath(JTree,String)26120
org.fest.swing.edt.CheckThreadViolationRepaintManager.checkThreadViolations(JComponent)22180
org.fest.swing.driver.JToolBarLocation.dockLocation(JToolBar,Container,String)18100
org.fest.swing.util.Arrays.format(String[][])18101
org.fest.swing.keystroke.KeyStrokeMapping.equals(Object)17150
org.fest.swing.core.BasicRobot.focus(Component,boolean)1670
org.fest.swing.core.BasicRobot.click(Component,Point,MouseButton,int)1630
org.fest.swing.input.DisposedWindowMonitor.isDuplicateDispose(AWTEvent)1690
org.fest.swing.util.Arrays.equal(String[][],String[][])16171
org.fest.swing.input.InputState.updateState(MouseEvent)1570
org.fest.swing.awt.AWT.locationOnScreenOf(Component)1490
org.fest.swing.core.BasicRobot.waitForComponentToBeReady(Component,long)1480
org.fest.swing.input.MouseInfo.component()1470
org.fest.swing.monitor.ContextMonitor.processEvent(ComponentEvent)14120
org.fest.swing.core.BasicRobot.waitForIdle(EventQueue)1360
org.fest.swing.core.ComponentDragAndDrop.drop(Component,Point)1350
org.fest.swing.driver.Actions.findActionKey(String,ActionMap)1380
org.fest.swing.driver.ComponentDriver.waitForShowing(Component,long)1380
org.fest.swing.driver.DragAndDrop.drop(Component,Point)1350
org.fest.swing.keystroke.KeyStrokeMappingProviderFactory.createProvider(String)13110
org.fest.swing.keystroke.KeyStrokeMappingProviderNames.NameIterator.next()1380
org.fest.swing.util.OSIdentifier.OSIdentifier(SystemPropertyReader)1360
org.fest.swing.core.InputModifiers.modifiersMatch(InputEvent,int)12110
org.fest.swing.driver.BasicJTableCellReader.valueAt(JTable,int,int)12100
org.fest.swing.driver.JTreePathFinder.splitPath(String)1230
org.fest.swing.driver.JTreeVerifySelectionTask.checkSelection(JTree,String[],JTreePathFinder,Description)1270

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
15,775.003.221.440.49

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