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
scoreboard.controller 22 81 599 81 538 18 582
scoreboard.model 6 63 268 50 267 4 180
scoreboard.config 6 34 172 34 142 10 131
scoreboard 1 4 67 5 33 1 18
scoreboard.view 1 6 64 6 44 0 25
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
36 188 1170 176 1024 33 936

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
scoreboard.model.GameModel 151 24 1 9
scoreboard.controller.ScoreBoardHttpHandler 66 8 1 6
scoreboard.config.GameModeConfig 64 5 0 6
scoreboard.view.HtmlView 56 6 0 6
scoreboard.ScoreBoardHttp 54 4 0 5
scoreboard.controller.TicketDispenser 45 8 0 9
scoreboard.controller.GameFactory 44 6 0 7
scoreboard.config.GameMode 38 15 0 16
scoreboard.model.TeamInfo 38 13 0 13
scoreboard.controller.AlternatingServiceProcessor 31 3 0 3
scoreboard.controller.UriParams 29 5 0 6
scoreboard.controller.WinnerServesProcessor 28 2 0 2
scoreboard.config.Command 27 8 0 8
scoreboard.controller.ServiceProcessor 24 5 0 5
scoreboard.controller.PageCreationBridge 23 7 0 8
scoreboard.controller.UriFactory 23 8 0 8
scoreboard.controller.PointsSumDecisionProcessor 22 2 0 2
scoreboard.controller.PointsForSetWinProcessor 20 2 0 2
scoreboard.controller.SetsForGameWinProcessor 20 3 0 3
scoreboard.model.GameModelIfc 20 19 0 20
scoreboard.controller.GameContext 19 4 0 5
scoreboard.controller.CounterProcessor 18 2 0 2
scoreboard.controller.TieBreakDecisionProcessor 18 2 0 2
scoreboard.model.UndoStack 16 5 0 5
scoreboard.config.ShortcutKey 13 5 0 3
scoreboard.model.GameModelFactory 13 1 0 2
scoreboard.controller.TeamsProcessor 10 1 0 1
scoreboard.controller.TicketDispenserException 10 4 0 1
scoreboard.controller.ServerStateProcessor 9 1 0 1
scoreboard.controller.UndoProcessor 9 1 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
scoreboard.model.GameModel 151 24 1 9
scoreboard.model.GameModelIfc 20 19 0 20
scoreboard.config.GameMode 38 15 0 16
scoreboard.model.TeamInfo 38 13 0 13
scoreboard.config.Command 27 8 0 8
scoreboard.controller.ScoreBoardHttpHandler 66 8 1 6
scoreboard.controller.TicketDispenser 45 8 0 9
scoreboard.controller.UriFactory 23 8 0 8
scoreboard.controller.PageCreationBridge 23 7 0 8
scoreboard.controller.GameFactory 44 6 0 7
scoreboard.view.HtmlView 56 6 0 6
scoreboard.config.GameModeConfig 64 5 0 6
scoreboard.config.ShortcutKey 13 5 0 3
scoreboard.controller.ServiceProcessor 24 5 0 5
scoreboard.controller.UriParams 29 5 0 6
scoreboard.model.UndoStack 16 5 0 5
scoreboard.controller.GameContext 19 4 0 5
scoreboard.controller.TicketDispenserException 10 4 0 1
scoreboard.ScoreBoardHttp 54 4 0 5
scoreboard.controller.AlternatingServiceProcessor 31 3 0 3
scoreboard.controller.CommandProcessor 8 3 0 2
scoreboard.controller.SetsForGameWinProcessor 20 3 0 3
scoreboard.controller.CommandProcessorComposite 7 2 0 2
scoreboard.controller.CommandProcessorIfc 3 2 0 3
scoreboard.controller.CounterProcessor 18 2 0 2
scoreboard.controller.PointsForSetWinProcessor 20 2 0 2
scoreboard.controller.PointsSumDecisionProcessor 22 2 0 2
scoreboard.controller.TieBreakDecisionProcessor 18 2 0 2
scoreboard.controller.WinnerServesProcessor 28 2 0 2
scoreboard.config.Team 3 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
27.42 1,170.00 0.06 5.22 4.89

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
scoreboard.controller.WinnerServesProcessor.doProcess(Command,GameModelIfc,Properties) 26 12 0
scoreboard.controller.ScoreBoardHttpHandler.handle(HttpExchange) 25 8 0
scoreboard.ScoreBoardHttp.pickGame(List,String) 24 9 1
scoreboard.controller.AlternatingServiceProcessor.doProcess(Command,GameModelIfc,Properties) 23 9 0
scoreboard.controller.GameFactory.newCommandProcessor(JSONArray) 18 8 1
scoreboard.config.GameModeConfig.getGameMode(String) 15 4 1
scoreboard.controller.UriParams.parse(String) 14 8 1
scoreboard.ScoreBoardHttp.main(String[]) 14 4 1
scoreboard.config.GameModeConfig.getDefaultGame() 12 9 1
scoreboard.controller.CounterProcessor.doProcess(Command,GameModelIfc,Properties) 12 7 0
scoreboard.model.GameModelFactory.createGameModel(String,String,boolean) 12 8 1
scoreboard.controller.GameFactory.createCommandProcessor(GameMode) 11 4 1
scoreboard.controller.TicketDispenser.next(String) 11 5 1
scoreboard.model.GameModel.reset() 11 4 0
scoreboard.model.GameModel.setService(Team) 11 7 0
scoreboard.model.GameModel.changeover() 11 4 0
scoreboard.view.HtmlView.HtmlView(String,String) 11 3 1
scoreboard.view.HtmlView.createErrorPage(Throwable) 11 2 0
scoreboard.config.GameModeConfig.GameModeConfig() 10 7 1
scoreboard.controller.PointsForSetWinProcessor.doProcess(Command,GameModelIfc,Properties) 10 5 0
scoreboard.controller.PointsSumDecisionProcessor.PointsSumDecisionProcessor(Integer,CommandProcessor,CommandProcessor) 10 7 1
scoreboard.model.GameModel.GameModel(String,boolean) 10 2 1
scoreboard.controller.TeamsProcessor.doProcess(Command,GameModelIfc,Properties) 9 4 0
scoreboard.model.GameModel.toContext() 9 2 0
scoreboard.controller.PointsSumDecisionProcessor.doProcess(Command,GameModelIfc,Properties) 8 3 0
scoreboard.controller.ServerStateProcessor.doProcess(Command,GameModelIfc,Properties) 8 3 0
scoreboard.controller.SetsForGameWinProcessor.doProcess(Command,GameModelIfc,Properties) 8 5 0
scoreboard.controller.TieBreakDecisionProcessor.doProcess(Command,GameModelIfc,Properties) 8 3 0
scoreboard.controller.UndoProcessor.doProcess(Command,GameModelIfc,Properties) 8 2 0
scoreboard.ScoreBoardHttp.printInstructions(UriFactory) 8 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,170.00 4.42 2.01 0.74

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