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.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.andromda.cartridges.webservice 3 30 1318 31 228 102 294
org.andromda.cartridges.webservice.metafacades 13 167 1312 173 795 100 116
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
16 197 2630 204 1023 202 410

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.andromda.cartridges.webservice.WebServiceUtils 1211 29 1 30
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl 524 68 5 74
org.andromda.cartridges.webservice.metafacades.WebServiceOperationLogicImpl 260 30 0 31
org.andromda.cartridges.webservice.metafacades.WebServicePackageLogicImpl 113 14 0 15
org.andromda.cartridges.webservice.metafacades.WebServiceParameterLogicImpl 95 10 0 11
org.andromda.cartridges.webservice.metafacades.WSDLTypeLogicImpl 72 15 0 16
org.andromda.cartridges.webservice.metafacades.WSDLTypeAttributeLogicImpl 60 7 0 8
org.andromda.cartridges.webservice.WebServiceGlobals 60 0 0 1
org.andromda.cartridges.webservice.metafacades.WSDLEnumerationTypeLogicImpl 51 13 0 14
org.andromda.cartridges.webservice.metafacades.WSDLTypeAssociationEndLogicImpl 19 3 0 4
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.TypeComparator 14 2 0 2
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.OperationNameComparator 8 2 0 2
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.Predicate 5 1 0 0
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.Closure 3 1 0 0
org.andromda.cartridges.webservice.WebServiceUtils.Closure 3 1 0 0
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.Predicate 2 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl 524 68 5 74
org.andromda.cartridges.webservice.metafacades.WebServiceOperationLogicImpl 260 30 0 31
org.andromda.cartridges.webservice.WebServiceUtils 1211 29 1 30
org.andromda.cartridges.webservice.metafacades.WSDLTypeLogicImpl 72 15 0 16
org.andromda.cartridges.webservice.metafacades.WebServicePackageLogicImpl 113 14 0 15
org.andromda.cartridges.webservice.metafacades.WSDLEnumerationTypeLogicImpl 51 13 0 14
org.andromda.cartridges.webservice.metafacades.WebServiceParameterLogicImpl 95 10 0 11
org.andromda.cartridges.webservice.metafacades.WSDLTypeAttributeLogicImpl 60 7 0 8
org.andromda.cartridges.webservice.metafacades.WSDLTypeAssociationEndLogicImpl 19 3 0 4
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.OperationNameComparator 8 2 0 2
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.TypeComparator 14 2 0 2
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.Closure 3 1 0 0
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.Predicate 5 1 0 0
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.Predicate 2 1 0 0
org.andromda.cartridges.webservice.WebServiceUtils.Closure 3 1 0 0
org.andromda.cartridges.webservice.WebServiceGlobals 60 0 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
156.25 2,630.00 0.38 12.31 13.00

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.andromda.cartridges.webservice.WebServiceUtils.createConstructor(ModelElementFacade,boolean,ModelElementFacade) 215 111 1
org.andromda.cartridges.webservice.WebServiceUtils.getPackageReferences(WebServiceLogicImpl,MetafacadeBase,String,boolean) 187 115 1
org.andromda.cartridges.webservice.WebServiceUtils.setPkgAbbr(WebServiceLogicImpl,ModelElementFacade,boolean) 179 95 1
org.andromda.cartridges.webservice.WebServiceUtils.getPackageTypes(WebServiceLogicImpl,MetafacadeBase,String,boolean) 153 91 1
org.andromda.cartridges.webservice.WebServiceUtils.getPackageReferences(PackageFacade,boolean) 78 52 1
org.andromda.cartridges.webservice.WebServiceUtils.getPackageTypes(PackageFacade,boolean) 74 43 1
org.andromda.cartridges.webservice.WebServiceUtils.isSimpleType(ModelElementFacade) 45 26 1
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.setPkgRefs(ModelElementFacade,boolean) 40 19 1
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.loadTypes(ModelElementFacade,ModelElementFacade,ModelElementFacade) 39 23 1
org.andromda.cartridges.webservice.WebServiceUtils.getPackageName(String) 39 7 1
org.andromda.cartridges.webservice.metafacades.WebServiceOperationLogicImpl.handleGetRestTestPath() 33 11 1
org.andromda.cartridges.webservice.WebServiceUtils.getSchemaType(ClassifierFacade,TypeMappings,String,String,String,boolean,boolean) 33 15 1
org.andromda.cartridges.webservice.metafacades.WebServiceOperationLogicImpl.handleGetSignature(boolean) 29 11 1
org.andromda.cartridges.webservice.WebServiceUtils.getServiceDescendantPackages(ModelElementFacade,PackageFacade,ModelElementFacade) 29 23 1
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.setPkgAbbr(ModelElementFacade) 28 18 1
org.andromda.cartridges.webservice.metafacades.WebServiceOperationLogicImpl.getMediaTranslation() 26 1 1
org.andromda.cartridges.webservice.metafacades.WebServiceParameterLogicImpl.handleGetTestTypeName() 25 12 1
org.andromda.cartridges.webservice.WebServiceUtils.getPkgAbbr(PackageFacade,PackageFacade) 25 17 1
org.andromda.cartridges.webservice.WebServiceUtils.hasComplexTypes(ClassifierFacade,boolean) 22 16 1
org.andromda.cartridges.webservice.WebServiceUtils.getServiceReferences(WebServiceLogicImpl,boolean) 21 12 1
org.andromda.cartridges.webservice.metafacades.WebServiceOperationLogicImpl.handleGetRestPath() 20 9 1
org.andromda.cartridges.webservice.WebServiceUtils.getExceptionReferences(PackageFacade) 20 12 1
org.andromda.cartridges.webservice.metafacades.WebServicePackageLogicImpl.handleIsMissingXmlSchema() 19 12 1
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.getClassifier(Object) 18 8 1
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.handleGetTypeMappingElements() 17 5 1
org.andromda.cartridges.webservice.metafacades.WSDLTypeLogicImpl.handleIsWebFaultThrown() 17 12 1
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.getType(Object) 16 9 1
org.andromda.cartridges.webservice.metafacades.WebServiceLogicImpl.handleGetSchemaMappings() 16 3 1
org.andromda.cartridges.webservice.metafacades.WSDLTypeLogicImpl.getSchemaTypeMappings() 16 3 1
org.andromda.cartridges.webservice.metafacades.WSDLEnumerationTypeLogicImpl.getSchemaTypeMappings() 15 4 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,630.00 11.81 6.26 0.97

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