Fork me on GitHub

JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 33.54.
JavaNCSS web site.

Packages

Packages

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

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
. 7 45 1197 25 169 145 80
org.miloss.fgsms.agentcore 16 143 1037 63 378 37 457
org.miloss.fgsms.agentcore.mp 2 80 465 8 68 23 29
org.miloss.fgsms.agentcore.servlets 1 2 19 1 8 0 5
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
26 270 2718 97 623 205 571

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
DataPusher 562 18 0 11
org.miloss.fgsms.agentcore.ConfigLoader 370 53 2 15
org.miloss.fgsms.agentcore.mp.DefaultMessageProcessor 350 43 0 7
PolicyFetch 203 7 0 5
PersistentStorage 153 9 1 2
org.miloss.fgsms.agentcore.OSAgentHelper 145 4 0 2
StatusHelper 95 3 0 2
DependencyHelper 83 4 0 1
org.miloss.fgsms.agentcore.StatisticalHelper 72 2 0 2
org.miloss.fgsms.agentcore.mp.DropAllMessageProcessor 60 37 0 1
OneWayJudge 53 2 0 2
org.miloss.fgsms.agentcore.ApacheCxfSSlHelperGo 47 4 0 1
org.miloss.fgsms.agentcore.IMessageProcessor 37 36 0 27
HelperBase 35 2 0 2
org.miloss.fgsms.agentcore.MessageProcessor 34 2 0 2
org.miloss.fgsms.agentcore.MessageProcessorAdapter 33 16 0 1
org.miloss.fgsms.agentcore.MessageCorrelator 20 0 0 1
org.miloss.fgsms.agentcore.MessageProcessorAdapterMBean 17 16 0 1
org.miloss.fgsms.agentcore.ApacheCxfSslHelper 15 1 0 1
org.miloss.fgsms.agentcore.servlets.ServetShutdownListener 14 2 0 1
org.miloss.fgsms.agentcore.AuthSSLX509TrustManager 13 4 0 5
org.miloss.fgsms.agentcore.PersistentAgentThreadRunner 10 2 0 1
org.miloss.fgsms.agentcore.ConfigurationException 8 3 0 1
org.miloss.fgsms.agentcore.FgsmsSoapHeaderConstants 4 0 0 1
org.miloss.fgsms.agentcore.PolicyHelper 3 0 0 1
org.miloss.fgsms.agentcore.MessageProcessorImpl 1 0 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.miloss.fgsms.agentcore.ConfigLoader 370 53 2 15
org.miloss.fgsms.agentcore.mp.DefaultMessageProcessor 350 43 0 7
org.miloss.fgsms.agentcore.mp.DropAllMessageProcessor 60 37 0 1
org.miloss.fgsms.agentcore.IMessageProcessor 37 36 0 27
DataPusher 562 18 0 11
org.miloss.fgsms.agentcore.MessageProcessorAdapter 33 16 0 1
org.miloss.fgsms.agentcore.MessageProcessorAdapterMBean 17 16 0 1
PersistentStorage 153 9 1 2
PolicyFetch 203 7 0 5
org.miloss.fgsms.agentcore.ApacheCxfSSlHelperGo 47 4 0 1
org.miloss.fgsms.agentcore.AuthSSLX509TrustManager 13 4 0 5
DependencyHelper 83 4 0 1
org.miloss.fgsms.agentcore.OSAgentHelper 145 4 0 2
org.miloss.fgsms.agentcore.ConfigurationException 8 3 0 1
StatusHelper 95 3 0 2
HelperBase 35 2 0 2
org.miloss.fgsms.agentcore.MessageProcessor 34 2 0 2
OneWayJudge 53 2 0 2
org.miloss.fgsms.agentcore.PersistentAgentThreadRunner 10 2 0 1
org.miloss.fgsms.agentcore.servlets.ServetShutdownListener 14 2 0 1
org.miloss.fgsms.agentcore.StatisticalHelper 72 2 0 2
org.miloss.fgsms.agentcore.ApacheCxfSslHelper 15 1 0 1
org.miloss.fgsms.agentcore.FgsmsSoapHeaderConstants 4 0 0 1
org.miloss.fgsms.agentcore.MessageCorrelator 20 0 0 1
org.miloss.fgsms.agentcore.MessageProcessorImpl 1 0 0 1
org.miloss.fgsms.agentcore.PolicyHelper 3 0 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
93.73 2,718.00 0.12 10.38 3.73

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
DataPusher.run() 148 64 1
org.miloss.fgsms.agentcore.ConfigLoader.load() 103 34 0
DataPusher.PrepMessage(MessageCorrelator,PolicyHelper) 78 29 1
StatusHelper.send(SetStatusRequestMsg) 70 32 0
PolicyFetch.TryFetchGlobalPolicy() 68 27 1
org.miloss.fgsms.agentcore.OSAgentHelper.Send(SetProcessListByMachineRequestMsg) 66 27 0
org.miloss.fgsms.agentcore.StatisticalHelper.send(AddStatisticalDataRequestMsg) 66 26 1
PolicyFetch.Send(ServicePolicyRequestMsg) 65 27 0
org.miloss.fgsms.agentcore.OSAgentHelper.AddMachineAndProcessDataRequestMsg(AddMachineAndProcessDataRequestMsg) 64 26 0
DataPusher.FetchPolicy(String,ConfigLoader.Algorithm,boolean) 63 19 1
DataPusher.Init() 58 27 1
PersistentStorage.doWork(boolean) 53 23 1
PersistentStorage.init(String[]) 49 20 0
org.miloss.fgsms.agentcore.ConfigLoader.loadProperties() 47 16 1
org.miloss.fgsms.agentcore.ConfigLoader.createClientProxies() 39 10 0
DataPusher.LoadPolicy(String,boolean) 39 10 1
org.miloss.fgsms.agentcore.mp.DefaultMessageProcessor.processMessageOutput(String,String,int,boolean,Long,HashMap) 39 13 0
org.miloss.fgsms.agentcore.mp.DefaultMessageProcessor.processMessageInput(String,int,String,String,String,String,HashMap,String,String,String,String) 37 11 0
OneWayJudge.determineOneWay(String,SOAPMessageContext,String) 34 10 1
DataPusher.CheckPersistStore() 30 16 1
DependencyHelper.getThreadIdFromSoapHeader(SOAPMessageContext) 30 16 0
DependencyHelper.getRelatedMessageIdFromSoapHeader(SOAPMessageContext) 30 16 0
org.miloss.fgsms.agentcore.MessageProcessor.getSingletonObject() 29 12 1
HelperBase.discoverEndpoints() 28 15 1
DataPusher.LoadDefaultPolicy(String) 25 7 1
org.miloss.fgsms.agentcore.mp.DefaultMessageProcessor.getUserIdentities(TransactionalWebServicePolicy,MessageCorrelator) 25 17 0
PolicyFetch.loadTranasctionalDefaultPolicy(String) 25 7 1
DataPusher.DoDiscovery() 24 14 0
org.miloss.fgsms.agentcore.mp.DefaultMessageProcessor.run() 23 7 1
org.miloss.fgsms.agentcore.mp.DefaultMessageProcessor.removeDeadMessage() 21 10 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,718.00 8.41 3.70 0.26

Explanations

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