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
org.miloss.fgsms.sla.rules 33 462 2997 33 141 15 665
. 11 162 2438 47 310 93 79
org.miloss.fgsms.sla 7 30 467 21 176 17 213
org.miloss.fgsms.sla.actions 2 20 441 4 27 7 138
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
53 674 6343 105 654 132 1095

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
SLACommon 1084 52 1 33
org.miloss.fgsms.sla.AuxHelper 305 12 1 13
NonTransactionalSLAProcessor 292 22 0 2
org.miloss.fgsms.sla.actions.WSNotificationAlerter 240 11 0 2
AMQPAlerter 214 11 0 3
JMSAlerter 190 10 0 1
LowDiskSpace 151 16 0 2
org.miloss.fgsms.sla.actions.SimpleMulticastAlerter 105 9 0 2
XPathExpression 100 14 0 1
org.miloss.fgsms.sla.rules.HighCPUUsageOverTime 91 14 0 1
org.miloss.fgsms.sla.rules.HighMemoryUsageOverTime 91 14 0 1
org.miloss.fgsms.sla.rules.FaultsOverTimeGreaterThan 90 14 0 1
org.miloss.fgsms.sla.rules.FaultsOverTimeLessThan 90 14 0 1
org.miloss.fgsms.sla.rules.HighDiskUsageOverTime 90 14 0 1
org.miloss.fgsms.sla.rules.HighNetworkUsageOverTime 90 14 0 1
org.miloss.fgsms.sla.rules.InvocationsOverTimeGreatThan 90 14 0 1
org.miloss.fgsms.sla.rules.InvocationsOverTimeLessThan 90 14 0 1
org.miloss.fgsms.sla.rules.BrokerQueueSizeGreaterThan 89 14 0 1
SLAActionRunScript 88 9 0 1
org.miloss.fgsms.sla.rules.HighThreadCount 88 14 0 1
EmailAlerter 87 9 0 1
org.miloss.fgsms.sla.rules.StaleData 87 14 0 1
org.miloss.fgsms.sla.rules.HighOpenFileHandles 77 14 0 1
org.miloss.fgsms.sla.rules.HighCPUUsage 76 14 0 1
org.miloss.fgsms.sla.rules.QueueOrTopicDoesNotExist 74 14 0 1
org.miloss.fgsms.sla.rules.HighMemoryUsage 72 14 0 1
org.miloss.fgsms.sla.rules.MeanTimeBetweenFailureGreatThan 71 14 0 1
org.miloss.fgsms.sla.rules.MeanTimeBetweenFailureLessThan 71 14 0 1
org.miloss.fgsms.sla.rules.RequestMessageSizeGreaterThan 71 14 0 1
org.miloss.fgsms.sla.rules.RequestMessageSizeLessThan 71 14 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
SLACommon 1084 52 1 33
NonTransactionalSLAProcessor 292 22 0 2
LowDiskSpace 151 16 0 2
org.miloss.fgsms.sla.rules.ActionContainsIgnoreCase 64 14 0 1
org.miloss.fgsms.sla.rules.ActionEqualsIgnoreCase 64 14 0 1
org.miloss.fgsms.sla.rules.AllFaults 43 14 0 1
org.miloss.fgsms.sla.rules.AllSuccesses 43 14 0 1
org.miloss.fgsms.sla.rules.BrokerQueueSizeGreaterThan 89 14 0 1
org.miloss.fgsms.sla.rules.ChangeInAvailabilityStatus 29 14 0 1
org.miloss.fgsms.sla.rules.ConsumerContainsIgnoreCase 65 14 0 1
org.miloss.fgsms.sla.rules.ConsumerEqualsIgnoreCase 65 14 0 1
org.miloss.fgsms.sla.rules.FaultsOverTimeGreaterThan 90 14 0 1
org.miloss.fgsms.sla.rules.FaultsOverTimeLessThan 90 14 0 1
org.miloss.fgsms.sla.rules.HighCPUUsage 76 14 0 1
org.miloss.fgsms.sla.rules.HighCPUUsageOverTime 91 14 0 1
org.miloss.fgsms.sla.rules.HighDiskUsageOverTime 90 14 0 1
org.miloss.fgsms.sla.rules.HighMemoryUsage 72 14 0 1
org.miloss.fgsms.sla.rules.HighMemoryUsageOverTime 91 14 0 1
org.miloss.fgsms.sla.rules.HighNetworkUsageOverTime 90 14 0 1
org.miloss.fgsms.sla.rules.HighOpenFileHandles 77 14 0 1
org.miloss.fgsms.sla.rules.HighThreadCount 88 14 0 1
org.miloss.fgsms.sla.rules.InvocationsOverTimeGreatThan 90 14 0 1
org.miloss.fgsms.sla.rules.InvocationsOverTimeLessThan 90 14 0 1
org.miloss.fgsms.sla.rules.MeanTimeBetweenFailureGreatThan 71 14 0 1
org.miloss.fgsms.sla.rules.MeanTimeBetweenFailureLessThan 71 14 0 1
org.miloss.fgsms.sla.rules.QueueOrTopicDoesNotExist 74 14 0 1
org.miloss.fgsms.sla.rules.RequestContentContainsIgnoreCase 69 14 0 1
org.miloss.fgsms.sla.rules.RequestMessageSizeGreaterThan 71 14 0 1
org.miloss.fgsms.sla.rules.RequestMessageSizeLessThan 71 14 0 1
org.miloss.fgsms.sla.rules.ResponseContentContainsIgnoreCase 69 14 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
103.83 6,343.00 0.06 12.72 1.98

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.miloss.fgsms.sla.AuxHelper.WritePolicytoDB(ServicePolicy,String,String,boolean) 110 36 1
AMQPAlerter.ProcessActionRet(AlertContainer) 105 30 1
org.miloss.fgsms.sla.AuxHelper.TryUpdateStatus(boolean,String,String,boolean,PolicyType,String,String,String,FLAGS) 103 17 1
JMSAlerter.SendAlert(AlertContainer) 101 30 0
org.miloss.fgsms.sla.actions.WSNotificationAlerter.SendAlert(AlertContainer,Element) 94 30 0
org.miloss.fgsms.sla.actions.WSNotificationAlerter.Configure(boolean) 78 34 0
SLACommon.getPolicy(String,boolean) 72 24 1
org.miloss.fgsms.sla.AuxHelper.CheckPolicyAndCreate(String,Connection,PolicyType,boolean,String,String,String) 70 17 1
SLACommon.loadPolicy(Connection,String) 62 21 1
SLACommon.loadServicePolicies(Connection) 61 19 1
SLACommon.loadServicePoliciesWithFederation(Connection) 61 19 0
AMQPAlerter.Configure(boolean) 54 25 0
LowDiskSpace.ValidateConfiguration(NameValuePair,String,ServicePolicy) 47 21 0
JMSAlerter.Configure(boolean) 46 24 0
SLACommon.processMachineSLAsRecursive(AddMachineAndProcessDataRequestMsg,RuleBaseType,MachinePolicy,boolean,String) 45 26 0
EmailAlerter.SendMailAlert(String,SLAAction,String,boolean,String) 44 14 0
org.miloss.fgsms.sla.rules.StaleData.CheckNonTransactionalRule(ServicePolicy,NameValuePair,String,boolean) 43 19 0
SLACommon.loadMachinePolicyPooled(String) 43 11 1
SLACommon.LoadProcessPoliciesPooledByHostname(String) 42 10 1
NonTransactionalSLAProcessor.ProcessNonTransactionalRules(StringBuffer,RuleBaseType,PolicyType,boolean,ServicePolicy) 41 24 0
SLACommon.getSubscribers(Connection,String) 41 13 1
org.miloss.fgsms.sla.actions.SimpleMulticastAlerter.ProcessActionRet(AlertContainer) 40 10 1
SLACommon.getAllfgsmsAdminsEmailAddress(Connection) 40 13 0
TransactionalSLAProcessor.ProcessRules(AddDataRequestMsg,String,RuleBaseType) 40 25 0
SLAActionRunScript.runScript(String,SLAAction,String,String) 37 12 0
org.miloss.fgsms.sla.rules.FaultsOverTimeGreaterThan.ValidateConfiguration(NameValuePair,String,ServicePolicy) 36 18 0
org.miloss.fgsms.sla.rules.FaultsOverTimeLessThan.ValidateConfiguration(NameValuePair,String,ServicePolicy) 36 18 0
org.miloss.fgsms.sla.rules.HighCPUUsageOverTime.ValidateConfiguration(NameValuePair,String,ServicePolicy) 36 20 0
org.miloss.fgsms.sla.rules.HighDiskUsageOverTime.ValidateConfiguration(NameValuePair,String,ServicePolicy) 36 18 0
org.miloss.fgsms.sla.rules.HighMemoryUsageOverTime.ValidateConfiguration(NameValuePair,String,ServicePolicy) 36 19 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
6,343.00 7.96 3.30 0.08

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