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
cs.pancava.caltha 5 85 672 27 211 137 315
cs.pancava.caltha.worlds 4 40 166 10 99 74 163
cs.pancava.caltha.graphics 1 25 150 9 73 59 75
cs.pancava.caltha.desktop 4 16 97 10 87 59 85
cs.pancava.caltha.menu 1 13 97 4 27 35 56
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
15 179 1182 60 497 364 694

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
cs.pancava.caltha.MainMenu 435 46 14 15
cs.pancava.caltha.graphics.EditorGraphicsWorld2D 136 25 0 9
cs.pancava.caltha.Editor 100 22 2 5
cs.pancava.caltha.menu.World2DPopupMenuListener 84 13 4 4
cs.pancava.caltha.AboutDialog 59 7 1 3
cs.pancava.caltha.worlds.World 45 8 0 2
cs.pancava.caltha.worlds.GameEntity 40 18 0 4
cs.pancava.caltha.worlds.Route 36 7 0 2
cs.pancava.caltha.worlds.Room 30 7 0 2
cs.pancava.caltha.desktop.EditorDesktopTextBasedGames 28 3 0 2
cs.pancava.caltha.desktop.WorldAttributeSplitPane 27 4 0 4
cs.pancava.caltha.desktop.EditorDesktop 19 6 0 2
cs.pancava.caltha.MyTheme 13 5 0 2
cs.pancava.caltha.EditorComponentListener 10 5 0 2
cs.pancava.caltha.desktop.EditorDesktopNone 8 3 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
cs.pancava.caltha.MainMenu 435 46 14 15
cs.pancava.caltha.graphics.EditorGraphicsWorld2D 136 25 0 9
cs.pancava.caltha.Editor 100 22 2 5
cs.pancava.caltha.worlds.GameEntity 40 18 0 4
cs.pancava.caltha.menu.World2DPopupMenuListener 84 13 4 4
cs.pancava.caltha.worlds.World 45 8 0 2
cs.pancava.caltha.worlds.Room 30 7 0 2
cs.pancava.caltha.worlds.Route 36 7 0 2
cs.pancava.caltha.AboutDialog 59 7 1 3
cs.pancava.caltha.desktop.EditorDesktop 19 6 0 2
cs.pancava.caltha.MyTheme 13 5 0 2
cs.pancava.caltha.EditorComponentListener 10 5 0 2
cs.pancava.caltha.desktop.WorldAttributeSplitPane 27 4 0 4
cs.pancava.caltha.desktop.EditorDesktopNone 8 3 0 2
cs.pancava.caltha.desktop.EditorDesktopTextBasedGames 28 3 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
71.33 1,182.00 1.40 11.93 4.00

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
cs.pancava.caltha.MainMenu.updateText() 47 2 1
cs.pancava.caltha.MainMenu.setLookAndFeel(String,String) 41 12 0
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.mousePressed(MouseEvent) 31 10 0
cs.pancava.caltha.MainMenu.createItemMenuFileExit() 22 1 1
cs.pancava.caltha.MainMenu.ActionListener$1.actionPerformed(ActionEvent) 16 5 0
cs.pancava.caltha.desktop.EditorDesktopTextBasedGames.createDesktop() 14 1 0
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.removeRoom(GameEntity) 13 7 1
cs.pancava.caltha.menu.World2DPopupMenuListener.updateText() 13 5 0
cs.pancava.caltha.MainMenu.addMenu(String,String,String) 13 7 1
cs.pancava.caltha.MainMenu.addMenuItem(String,String,boolean) 13 6 1
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.disconnectRoom(GameEntity) 12 11 1
cs.pancava.caltha.MainMenu.defaultLaFIM_itemStateChanged(ItemEvent) 12 7 1
cs.pancava.caltha.MainMenu.gtkLaFIM_itemStateChanged(ItemEvent) 12 7 1
cs.pancava.caltha.MainMenu.macLaFIM_itemStateChanged(ItemEvent) 12 7 0
cs.pancava.caltha.MainMenu.metalLaFIM_itemStateChanged(ItemEvent) 12 7 0
cs.pancava.caltha.MainMenu.motifLaFIM_itemStateChanged(ItemEvent) 12 7 0
cs.pancava.caltha.MainMenu.windowsLaFIM_itemStateChanged(ItemEvent) 12 7 0
cs.pancava.caltha.Editor.createAndShowGUI() 12 2 0
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.mouseReleased(MouseEvent) 11 5 0
cs.pancava.caltha.MainMenu.addCheckBoxMenuItem(String,boolean,String,boolean) 11 5 1
cs.pancava.caltha.worlds.Room.showGraphicsObject(Graphics2D) 10 2 0
cs.pancava.caltha.worlds.World.addGameEntity(GameEntity) 10 3 0
cs.pancava.caltha.AboutDialog.AboutDialog() 10 1 1
cs.pancava.caltha.desktop.WorldAttributeSplitPane.WorldAttributeSplitPane() 10 1 1
cs.pancava.caltha.MainMenu.createMenuOptionsLookAndFeel() 10 1 0
cs.pancava.caltha.MainMenu.czechIM_itemStateChanged(ItemEvent) 10 4 0
cs.pancava.caltha.MainMenu.englishIM_itemStateChanged(ItemEvent) 10 4 0
cs.pancava.caltha.Editor.setEditorDesktop(int) 10 3 0
cs.pancava.caltha.worlds.World.updateGameEntityLocation(GameEntity,int,int,int) 9 5 0
cs.pancava.caltha.AboutDialog.showLicence() 9 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,182.00 5.00 1.81 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).