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.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
cs.pancava.caltha 22 103 672 91 449 137 77
cs.pancava.caltha.graphics 1 32 201 33 180 61 16
cs.pancava.caltha.worlds 4 40 166 44 240 75 22
cs.pancava.caltha.menu 5 19 126 16 72 59 21
cs.pancava.caltha.desktop 4 16 100 20 123 63 49
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
36 210 1265 204 1064 395 185

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
cs.pancava.caltha.MainMenu 435 46 14 48
cs.pancava.caltha.graphics.EditorGraphicsWorld2D 183 32 0 33
cs.pancava.caltha.menu.World2DPopupMenuListener 111 15 4 16
cs.pancava.caltha.Editor 100 22 2 23
cs.pancava.caltha.AboutDialog 59 7 1 8
cs.pancava.caltha.worlds.World 45 8 0 9
cs.pancava.caltha.worlds.GameEntity 40 18 0 19
cs.pancava.caltha.worlds.Route 36 7 0 8
cs.pancava.caltha.worlds.Room 30 7 0 8
cs.pancava.caltha.desktop.EditorDesktopTextBasedGames 28 3 0 4
cs.pancava.caltha.desktop.WorldAttributeSplitPane 28 4 0 5
cs.pancava.caltha.desktop.EditorDesktop 19 6 0 7
cs.pancava.caltha.MainMenu.ActionListener 17 2 0 1
cs.pancava.caltha.MyTheme 13 5 0 6
cs.pancava.caltha.EditorComponentListener 10 5 0 6
cs.pancava.caltha.desktop.EditorDesktopNone 8 3 0 4
cs.pancava.caltha.menu.World2DPopupMenuListener.ActionListener 5 1 0 0
cs.pancava.caltha.menu.World2DPopupMenuListener.ActionListener 3 1 0 0
cs.pancava.caltha.menu.World2DPopupMenuListener.ActionListener 3 1 0 0
cs.pancava.caltha.menu.World2DPopupMenuListener.ActionListener 3 1 0 0
cs.pancava.caltha.Editor.Runnable 2 1 0 0
cs.pancava.caltha.Editor.Runnable 2 1 0 0
cs.pancava.caltha.AboutDialog.ActionListener 2 1 0 0
cs.pancava.caltha.MainMenu.ActionListener 2 1 0 0
cs.pancava.caltha.MainMenu.ActionListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
cs.pancava.caltha.MainMenu 435 46 14 48
cs.pancava.caltha.graphics.EditorGraphicsWorld2D 183 32 0 33
cs.pancava.caltha.Editor 100 22 2 23
cs.pancava.caltha.worlds.GameEntity 40 18 0 19
cs.pancava.caltha.menu.World2DPopupMenuListener 111 15 4 16
cs.pancava.caltha.worlds.World 45 8 0 9
cs.pancava.caltha.worlds.Route 36 7 0 8
cs.pancava.caltha.worlds.Room 30 7 0 8
cs.pancava.caltha.AboutDialog 59 7 1 8
cs.pancava.caltha.desktop.EditorDesktop 19 6 0 7
cs.pancava.caltha.MyTheme 13 5 0 6
cs.pancava.caltha.EditorComponentListener 10 5 0 6
cs.pancava.caltha.desktop.WorldAttributeSplitPane 28 4 0 5
cs.pancava.caltha.desktop.EditorDesktopNone 8 3 0 4
cs.pancava.caltha.desktop.EditorDesktopTextBasedGames 28 3 0 4
cs.pancava.caltha.MainMenu.ActionListener 17 2 0 1
cs.pancava.caltha.Editor.Runnable 2 1 0 0
cs.pancava.caltha.Editor.Runnable 2 1 0 0
cs.pancava.caltha.AboutDialog.ActionListener 2 1 0 0
cs.pancava.caltha.MainMenu.ActionListener 2 1 0 0
cs.pancava.caltha.MainMenu.ActionListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0
cs.pancava.caltha.MainMenu.ItemListener 2 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
33.56 1,265.00 0.58 5.83 5.69

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 1
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.mousePressed(MouseEvent) 34 11 1
cs.pancava.caltha.MainMenu.createItemMenuFileExit() 22 1 1
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.scrollGraphicsWorld(MouseEvent) 18 6 1
cs.pancava.caltha.MainMenu.ActionListener.actionPerformed(ActionEvent) 16 5 0
cs.pancava.caltha.desktop.EditorDesktopTextBasedGames.createDesktop() 14 1 1
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.removeRoom(GameEntity) 13 7 1
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.menu.World2DPopupMenuListener.updateText() 13 5 1
cs.pancava.caltha.menu.World2DPopupMenuListener.moveVisibleArea() 13 5 1
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.mouseReleased(MouseEvent) 12 5 1
cs.pancava.caltha.graphics.EditorGraphicsWorld2D.disconnectRoom(GameEntity) 12 11 1
cs.pancava.caltha.Editor.createAndShowGUI() 12 2 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 1
cs.pancava.caltha.MainMenu.metalLaFIM_itemStateChanged(ItemEvent) 12 7 1
cs.pancava.caltha.MainMenu.motifLaFIM_itemStateChanged(ItemEvent) 12 7 1
cs.pancava.caltha.MainMenu.windowsLaFIM_itemStateChanged(ItemEvent) 12 7 1
cs.pancava.caltha.menu.World2DPopupMenuListener.expandGraphicsWorld2DArea() 12 4 1
cs.pancava.caltha.desktop.WorldAttributeSplitPane.WorldAttributeSplitPane() 11 1 1
cs.pancava.caltha.MainMenu.addCheckBoxMenuItem(String,boolean,String,boolean) 11 5 1
cs.pancava.caltha.worlds.World.addGameEntity(GameEntity) 10 3 1
cs.pancava.caltha.worlds.Room.showGraphicsObject(Graphics2D) 10 2 1
cs.pancava.caltha.Editor.setEditorDesktop(int) 10 3 1
cs.pancava.caltha.AboutDialog.AboutDialog() 10 1 1
cs.pancava.caltha.MainMenu.createMenuOptionsLookAndFeel() 10 1 1
cs.pancava.caltha.MainMenu.czechIM_itemStateChanged(ItemEvent) 10 4 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,265.00 5.12 1.85 0.90

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