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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
org.slasoi.gslam.pac24180126472462182949
org.slasoi.gslam.pac.config325128251451144
org.slasoi.gslam.pac.events31466747096
org.slasoi.gslam.pac.db121400231
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
3122114721046541851220

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.slasoi.gslam.pac.SharedKnowledgePlane2051701
org.slasoi.gslam.pac.PlanExecutionTask1571404
org.slasoi.gslam.pac.PlanCoordinationTask1181305
org.slasoi.gslam.pac.EventBusHandlingTask112912
org.slasoi.gslam.pac.Agent10121011
org.slasoi.gslam.pac.ProvisioningAndAdjustment9822021
org.slasoi.gslam.pac.events.ManageabilityAgentMessage521207
org.slasoi.gslam.pac.ActionExecutionTask501007
org.slasoi.gslam.pac.Event491502
org.slasoi.gslam.pac.Task492006
org.slasoi.gslam.pac.config.TaskConfiguration4813012
org.slasoi.gslam.pac.config.Configuration47606
org.slasoi.gslam.pac.EventTranslationTask43702
org.slasoi.gslam.pac.MonitoringEventMessageTranslator36300
org.slasoi.gslam.pac.AnalysisTask31502
org.slasoi.gslam.pac.EventBusHandlingTask.MonitoringEventListener22100
org.slasoi.gslam.pac.config.AgentConfiguration21607
org.slasoi.gslam.pac.ManageabilityAgentMessageTranslator19300
org.slasoi.gslam.pac.ManagedElement14501
org.slasoi.gslam.pac.PlanStatus14500
org.slasoi.gslam.pac.db.HibernateUtil10200
org.slasoi.gslam.pac.EventTranslator8400
org.slasoi.gslam.pac.events.MonitoringEventMessage6200
org.slasoi.gslam.pac.IAgent4304
org.slasoi.gslam.pac.ITask4304
org.slasoi.gslam.pac.events.Message1000
org.slasoi.gslam.pac.EventStatus1000
org.slasoi.gslam.pac.EventType1000
org.slasoi.gslam.pac.Identifier1000
org.slasoi.gslam.pac.Status1000

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.slasoi.gslam.pac.ProvisioningAndAdjustment9822021
org.slasoi.gslam.pac.Agent10121011
org.slasoi.gslam.pac.Task492006
org.slasoi.gslam.pac.SharedKnowledgePlane2051701
org.slasoi.gslam.pac.Event491502
org.slasoi.gslam.pac.PlanExecutionTask1571404
org.slasoi.gslam.pac.config.TaskConfiguration4813012
org.slasoi.gslam.pac.PlanCoordinationTask1181305
org.slasoi.gslam.pac.events.ManageabilityAgentMessage521207
org.slasoi.gslam.pac.ActionExecutionTask501007
org.slasoi.gslam.pac.EventBusHandlingTask112912
org.slasoi.gslam.pac.EventTranslationTask43702
org.slasoi.gslam.pac.config.AgentConfiguration21607
org.slasoi.gslam.pac.config.Configuration47606
org.slasoi.gslam.pac.AnalysisTask31502
org.slasoi.gslam.pac.ManagedElement14501
org.slasoi.gslam.pac.PlanStatus14500
org.slasoi.gslam.pac.EventTranslator8400
org.slasoi.gslam.pac.IAgent4304
org.slasoi.gslam.pac.ITask4304
org.slasoi.gslam.pac.ManageabilityAgentMessageTranslator19300
org.slasoi.gslam.pac.MonitoringEventMessageTranslator36300
org.slasoi.gslam.pac.db.HibernateUtil10200
org.slasoi.gslam.pac.events.MonitoringEventMessage6200
org.slasoi.gslam.pac.EventBusHandlingTask.MonitoringEventListener22100
org.slasoi.gslam.pac.events.Message1000
org.slasoi.gslam.pac.EventStatus1000
org.slasoi.gslam.pac.EventType1000
org.slasoi.gslam.pac.Identifier1000
org.slasoi.gslam.pac.Status1000

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
42.711,472.000.037.133.35

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.slasoi.gslam.pac.SharedKnowledgePlane.createPoliciesFromRules()2850
org.slasoi.gslam.pac.PlanExecutionTask.next()2791
org.slasoi.gslam.pac.PlanExecutionTask.run()2670
org.slasoi.gslam.pac.PlanCoordinationTask.notifyEvent(Event)25101
org.slasoi.gslam.pac.EventBusHandlingTask.configureMessaging()24100
org.slasoi.gslam.pac.PlanExecutionTask.findNode(String)2370
org.slasoi.gslam.pac.Agent.configure(AgentConfiguration)2151
org.slasoi.gslam.pac.EventBusHandlingTask.MonitoringEventListener.processMessage(MessageEvent)2170
org.slasoi.gslam.pac.PlanExecutionTask.createActionExecutionTask(org.slasoi.gslam.commons.plan.Task)2140
org.slasoi.gslam.pac.SharedKnowledgePlane.setPolicies(Policy[])2030
org.slasoi.gslam.pac.SharedKnowledgePlane.Policies2RulesFile(Policy[])1860
org.slasoi.gslam.pac.EventTranslationTask.configure(TaskConfiguration)1650
org.slasoi.gslam.pac.PlanCoordinationTask.execute(Plan)1640
org.slasoi.gslam.pac.SharedKnowledgePlane.addRulesFile(String,ResourceType)1630
org.slasoi.gslam.pac.EventBusHandlingTask.configure(TaskConfiguration)1520
org.slasoi.gslam.pac.SharedKnowledgePlane.readFile(String)1430
org.slasoi.gslam.pac.config.Configuration.configure(InputStream)1341
org.slasoi.gslam.pac.MonitoringEventMessageTranslator.toXML(Message)1330
org.slasoi.gslam.pac.ProvisioningAndAdjustment.init()1331
org.slasoi.gslam.pac.SharedKnowledgePlane.getRulesFromFile(Policy,String)1220
org.slasoi.gslam.pac.Agent.findTaskForEvent(EventType)1140
org.slasoi.gslam.pac.config.Configuration.configure()1121
org.slasoi.gslam.pac.EventBusHandlingTask.closeMessaging()1140
org.slasoi.gslam.pac.PlanCoordinationTask.query(Event)1130
org.slasoi.gslam.pac.SharedKnowledgePlane.initKnowledgeBase(String)1140
org.slasoi.gslam.pac.SharedKnowledgePlane.backupFile(String)1120
org.slasoi.gslam.pac.ActionExecutionTask.run()1031
org.slasoi.gslam.pac.config.Configuration.readFile(String)1020
org.slasoi.gslam.pac.events.ManageabilityAgentMessage.fromXML(String)1030
org.slasoi.gslam.pac.MonitoringEventMessageTranslator.fromXML(String)1020

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,472.005.271.670.38

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