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.protocolengine.impl14165242164555374482
org.slasoi.gslam.protocolengine.persistence.profiles211464630030
org.slasoi.gslam.protocolengine421136191783124
org.slasoi.gslam.protocolengine.persistence4513016580
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
43337315084739438606

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.slasoi.gslam.protocolengine.impl.NegotiationManager124417011
org.slasoi.gslam.protocolengine.impl.MessageHandler36530028
org.slasoi.gslam.protocolengine.impl.StateEngineMain161901
org.slasoi.gslam.protocolengine.impl.IControlImpl115605
org.slasoi.gslam.protocolengine.ProtocolEngineServices861006
org.slasoi.gslam.protocolengine.impl.NegotiationSession802701
org.slasoi.gslam.protocolengine.impl.StateEngine80801
org.slasoi.gslam.protocolengine.impl.SimplifiedNegotiableParameters642610
org.slasoi.gslam.protocolengine.impl.Event5822015
org.slasoi.gslam.protocolengine.impl.State581801
org.slasoi.gslam.protocolengine.persistence.profiles.BusinessHistory582300
org.slasoi.gslam.protocolengine.persistence.profiles.NegotiationHistory532100
org.slasoi.gslam.protocolengine.persistence.profiles.Profile481900
org.slasoi.gslam.protocolengine.persistence.profiles.CustomerProfile431700
org.slasoi.gslam.protocolengine.persistence.profiles.Location381500
org.slasoi.gslam.protocolengine.persistence.PersistenceManager34200
org.slasoi.gslam.protocolengine.persistence.profiles.ProductProfile331300
org.slasoi.gslam.protocolengine.persistence.profiles.Status281100
org.slasoi.gslam.protocolengine.persistence.profiles.StrategyRanks281100
org.slasoi.gslam.protocolengine.persistence.HibernateUtil27100
org.slasoi.gslam.protocolengine.persistence.profiles.Party23900
org.slasoi.gslam.protocolengine.persistence.profiles.ProviderProfile18700
org.slasoi.gslam.protocolengine.persistence.JavaAssistHelper15111
org.slasoi.gslam.protocolengine.INegotiationOutgoing9808
org.slasoi.gslam.protocolengine.impl.ProtocolEngineActivator8201
org.slasoi.gslam.protocolengine.IStateEngine4304
org.slasoi.gslam.protocolengine.persistence.JavaAssistHelper.ProxyFactory.ClassLoaderProvider3100
org.slasoi.gslam.protocolengine.impl.EventName1000
org.slasoi.gslam.protocolengine.impl.SessionStatus1000
org.slasoi.gslam.protocolengine.impl.StateName1000

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.slasoi.gslam.protocolengine.impl.MessageHandler36530028
org.slasoi.gslam.protocolengine.impl.NegotiationSession802701
org.slasoi.gslam.protocolengine.impl.SimplifiedNegotiableParameters642610
org.slasoi.gslam.protocolengine.persistence.profiles.BusinessHistory582300
org.slasoi.gslam.protocolengine.impl.Event5822015
org.slasoi.gslam.protocolengine.persistence.profiles.NegotiationHistory532100
org.slasoi.gslam.protocolengine.persistence.profiles.Profile481900
org.slasoi.gslam.protocolengine.impl.State581801
org.slasoi.gslam.protocolengine.impl.NegotiationManager124417011
org.slasoi.gslam.protocolengine.persistence.profiles.CustomerProfile431700
org.slasoi.gslam.protocolengine.persistence.profiles.Location381500
org.slasoi.gslam.protocolengine.persistence.profiles.ProductProfile331300
org.slasoi.gslam.protocolengine.persistence.profiles.Status281100
org.slasoi.gslam.protocolengine.persistence.profiles.StrategyRanks281100
org.slasoi.gslam.protocolengine.ProtocolEngineServices861006
org.slasoi.gslam.protocolengine.impl.StateEngineMain161901
org.slasoi.gslam.protocolengine.persistence.profiles.Party23900
org.slasoi.gslam.protocolengine.impl.StateEngine80801
org.slasoi.gslam.protocolengine.INegotiationOutgoing9808
org.slasoi.gslam.protocolengine.persistence.profiles.ProviderProfile18700
org.slasoi.gslam.protocolengine.impl.IControlImpl115605
org.slasoi.gslam.protocolengine.IStateEngine4304
org.slasoi.gslam.protocolengine.impl.ProtocolEngineActivator8201
org.slasoi.gslam.protocolengine.persistence.PersistenceManager34200
org.slasoi.gslam.protocolengine.persistence.HibernateUtil27100
org.slasoi.gslam.protocolengine.persistence.JavaAssistHelper15111
org.slasoi.gslam.protocolengine.persistence.JavaAssistHelper.ProxyFactory.ClassLoaderProvider3100
org.slasoi.gslam.protocolengine.impl.EventName1000
org.slasoi.gslam.protocolengine.impl.SessionStatus1000
org.slasoi.gslam.protocolengine.impl.StateName1000

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
65.053,150.000.057.841.95

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.slasoi.gslam.protocolengine.impl.NegotiationManager.initiateNegotiation(SLATemplate)187541
org.slasoi.gslam.protocolengine.impl.NegotiationManager.renegotiate(UUID)181461
org.slasoi.gslam.protocolengine.impl.NegotiationManager.customize(String,Customization)150411
org.slasoi.gslam.protocolengine.impl.NegotiationManager.negotiate(String,SLATemplate)126561
org.slasoi.gslam.protocolengine.impl.NegotiationManager.createAgreement(String,SLATemplate)125531
org.slasoi.gslam.protocolengine.impl.StateEngineMain.init()114230
org.slasoi.gslam.protocolengine.impl.NegotiationManager.cancelNegotiation(String,CancellationReason)104441
org.slasoi.gslam.protocolengine.impl.NegotiationManager.terminate(UUID,TerminationReason)94451
org.slasoi.gslam.protocolengine.impl.NegotiationManager.consolidateCustomization(SimplifiedNegotiableParameters,Customization)78240
org.slasoi.gslam.protocolengine.impl.NegotiationManager.extractProviderParametersFromCustomization(Customization)44150
org.slasoi.gslam.protocolengine.impl.StateEngine.init()41130
org.slasoi.gslam.protocolengine.impl.NegotiationManager.provision(UUID)37151
org.slasoi.gslam.protocolengine.impl.IControlImpl.createPoliciesFromRules(String)3050
org.slasoi.gslam.protocolengine.impl.MessageHandler.negotiateOutgoing(String,SLATemplate,String)30111
org.slasoi.gslam.protocolengine.persistence.PersistenceManager.createAndStoreTest()3010
org.slasoi.gslam.protocolengine.impl.IControlImpl.getPolicies(String)2991
org.slasoi.gslam.protocolengine.impl.NegotiationManager.createCustomizationFromSimplifiedNegotiableParameters(SimplifiedNegotiableParameters)2820
org.slasoi.gslam.protocolengine.impl.IControlImpl.setPolicies(String,Policy[])2781
org.slasoi.gslam.protocolengine.impl.NegotiationManager.extractCustomerParametersFromCustomization(Customization)2690
org.slasoi.gslam.protocolengine.impl.MessageHandler.createAgreementOutgoing(String,SLATemplate,String)2591
org.slasoi.gslam.protocolengine.impl.MessageHandler.cancelNegotiationOutgoing(String,CancellationReason,String)2591
org.slasoi.gslam.protocolengine.impl.MessageHandler.renegotiateOutgoing(UUID,String)2171
org.slasoi.gslam.protocolengine.impl.MessageHandler.provisionOutgoing(UUID,String)2171
org.slasoi.gslam.protocolengine.impl.MessageHandler.renegotiate(UUID)1981
org.slasoi.gslam.protocolengine.impl.IControlImpl.extractRulesFromPolicyObjects(Policy[])1860
org.slasoi.gslam.protocolengine.impl.MessageHandler.initiateNegotiationOutgoing(SLATemplate,String)1851
org.slasoi.gslam.protocolengine.impl.MessageHandler.customizeOutgoing(String,Customization,String)1860
org.slasoi.gslam.protocolengine.ProtocolEngineServices.updateProfile(Object)1850
org.slasoi.gslam.protocolengine.impl.MessageHandler.negotiate(String,SLATemplate)17101
org.slasoi.gslam.protocolengine.impl.MessageHandler.createAgreement(String,SLATemplate)17101

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
3,150.007.612.870.21

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