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.core.common 31 227 1682 255 1707 92 194
org.andromda.core.metafacade 29 189 1175 195 1369 99 135
org.andromda.core.configuration 14 123 607 137 864 18 84
org.andromda.core.cartridge 3 40 333 43 279 60 16
org.andromda.core.engine 7 46 324 43 297 36 21
org.andromda.core.translation.library 6 47 279 53 309 15 12
org.andromda.core.namespace 8 52 252 58 334 13 20
org.andromda.core.mapping 3 33 211 36 250 24 16
org.andromda.core.cartridge.template 6 40 176 46 286 6 6
org.andromda.core.server 6 17 143 23 127 7 7
org.andromda.core.translation 6 34 138 40 260 3 0
org.andromda.core.repository 5 22 124 26 164 5 6
org.andromda.core 3 16 100 18 109 5 3
org.andromda.core.transformation 4 7 87 11 65 1 0
org.andromda.core.profile 2 13 82 15 74 5 9
org.andromda.core.templateengine 2 10 21 12 78 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
135 916 5734 1011 6572 389 529

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.andromda.core.metafacade.MetafacadeMappings 319 31 9 33
org.andromda.core.engine.ModelProcessor 252 31 4 33
org.andromda.core.common.ResourceUtils 247 28 0 29
org.andromda.core.cartridge.Cartridge 221 20 0 21
org.andromda.core.metafacade.MetafacadeFactory 213 31 0 31
org.andromda.core.common.Introspector 179 15 0 16
org.andromda.core.common.ComponentContainer 144 23 0 24
org.andromda.core.configuration.Model 144 27 0 28
org.andromda.core.mapping.Mappings 141 23 0 24
org.andromda.core.common.XmlObjectFactory 128 9 2 17
org.andromda.core.common.ClassUtils 109 14 0 15
org.andromda.core.configuration.Namespaces 109 20 0 21
org.andromda.core.metafacade.MetafacadeUtils 108 8 2 9
org.andromda.core.namespace.NamespaceComponents 107 11 1 13
org.andromda.core.metafacade.MetafacadeMapping 105 25 2 34
org.andromda.core.metafacade.MetafacadeBase 100 30 0 31
org.andromda.core.translation.library.LibraryTranslation 90 15 0 16
org.andromda.core.metafacade.MetafacadeImpls 89 7 1 13
org.andromda.core.common.ExceptionRecorder 78 7 0 8
org.andromda.core.common.ResourceWriter 76 16 0 17
org.andromda.core.configuration.Configuration 70 20 0 21
org.andromda.core.common.BasePlugin 68 16 0 17
org.andromda.core.cartridge.Resource 63 16 0 17
org.andromda.core.common.TemplateObject 61 12 0 13
org.andromda.core.repository.Repositories 61 5 0 6
org.andromda.core.common.AndroMDALogger 59 15 0 16
org.andromda.core.translation.library.Translation 59 10 0 11
org.andromda.core.profile.Profile 58 9 0 10
org.andromda.core.common.Merger 57 5 0 6
org.andromda.core.metafacade.ModelValidationMessage 57 9 0 10

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.andromda.core.engine.ModelProcessor 252 31 4 33
org.andromda.core.metafacade.MetafacadeFactory 213 31 0 31
org.andromda.core.metafacade.MetafacadeMappings 319 31 9 33
org.andromda.core.metafacade.MetafacadeBase 100 30 0 31
org.andromda.core.common.ResourceUtils 247 28 0 29
org.andromda.core.configuration.Model 144 27 0 28
org.andromda.core.metafacade.MetafacadeMapping 105 25 2 34
org.andromda.core.common.ComponentContainer 144 23 0 24
org.andromda.core.mapping.Mappings 141 23 0 24
org.andromda.core.cartridge.Cartridge 221 20 0 21
org.andromda.core.configuration.Configuration 70 20 0 21
org.andromda.core.configuration.Namespaces 109 20 0 21
org.andromda.core.cartridge.Resource 63 16 0 17
org.andromda.core.common.BasePlugin 68 16 0 17
org.andromda.core.common.ResourceWriter 76 16 0 17
org.andromda.core.common.AndroMDALogger 59 15 0 16
org.andromda.core.common.Introspector 179 15 0 16
org.andromda.core.namespace.NamespaceRegistry 44 15 0 16
org.andromda.core.translation.library.LibraryTranslation 90 15 0 16
org.andromda.core.common.ClassUtils 109 14 0 15
org.andromda.core.translation.Expression 42 14 0 15
org.andromda.core.cartridge.template.ModelElement 47 12 0 13
org.andromda.core.common.TemplateObject 61 12 0 13
org.andromda.core.AndroMDA 52 11 0 12
org.andromda.core.cartridge.template.Template 44 11 0 12
org.andromda.core.common.ExceptionUtils 45 11 0 12
org.andromda.core.namespace.NamespaceComponents 107 11 1 13
org.andromda.core.translation.library.Fragment 34 11 0 12
org.andromda.core.translation.library.Translation 59 10 0 11
org.andromda.core.translation.TranslationUtils 38 10 0 11

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
38.56 5,734.00 0.17 6.79 7.65

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.andromda.core.metafacade.MetafacadeMappings.getMapping(String,Object,String,String) 60 16 1
org.andromda.core.namespace.NamespaceComponents.discover() 45 14 1
org.andromda.core.engine.ModelProcessor.processModels(String,Model[]) 43 16 1
org.andromda.core.server.DefaultServer.start(Configuration) 42 18 1
org.andromda.core.cartridge.Cartridge.processWithTemplate(Template,Object,String,String) 40 15 1
org.andromda.core.transformation.XslTransformer.transform(String,Transformation[]) 40 11 1
org.andromda.core.metafacade.MetafacadeMappings.initializeMappings(String[]) 39 19 1
org.andromda.core.cartridge.Cartridge.processTemplateWithMetafacades(MetafacadeFactory,Template) 36 17 1
org.andromda.core.common.ResourceUtils.resolveClasspathResource(String) 35 14 1
org.andromda.core.common.ExceptionRecorder.record(String,Throwable,String) 33 5 1
org.andromda.core.metafacade.MetafacadeFactory.createMetafacade(Object,String,Class) 32 15 1
org.andromda.core.metafacade.MetafacadeUtils.intersection(String,String) 31 10 1
org.andromda.core.common.Converter.convert(Object,Class) 30 12 1
org.andromda.core.common.ResourceUtils.getDirectoryContents(URL,boolean,String[]) 30 12 1
org.andromda.core.server.DefaultClient.performServerOperation(Configuration,Object) 30 15 1
org.andromda.core.common.Introspector.getPropertyDescriptor(Class,String) 27 12 1
org.andromda.core.common.XmlObjectFactory.XmlObjectEntityResolver.resolveEntity(String,String) 27 12 1
org.andromda.core.mapping.Mappings.initializeLogicalMappings() 25 8 1
org.andromda.core.metafacade.MetafacadeMappings.getMetafacadeMapping(Object,String,String,String) 25 9 1
org.andromda.core.translation.library.LibraryTranslation.handleTranslationFragment(String,String,Object) 25 10 1
org.andromda.core.cartridge.Cartridge.writeResource(Resource,URL) 24 11 1
org.andromda.core.common.XmlObjectFactory.setValidating(boolean) 23 9 1
org.andromda.core.metafacade.MetafacadeUtils.propertiesValid(MetafacadeBase,MetafacadeMapping) 23 12 1
org.andromda.core.repository.Repositories.loadModel(Model) 23 9 1
org.andromda.core.common.BuildInformation.initialize() 22 5 0
org.andromda.core.common.Introspector.internalGetProperty(Object,String) 22 12 1
org.andromda.core.common.PathMatcher.wildcardMatch(String,String) 22 8 1
org.andromda.core.engine.ModelProcessor.validateModel(String,Model) 22 8 1
org.andromda.core.metafacade.MetafacadeFactory.getMetafacade(Class,Object,String,MetafacadeMapping) 22 10 1
org.andromda.core.AndroMDA.run(Configuration,boolean,String) 21 9 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
5,734.00 4.95 2.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).