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.maven.plugin.andromdapp 16 66 1084 81 825 36 50
org.andromda.maven.plugin.andromdapp.eclipse 5 12 194 17 97 11 0
org.andromda.maven.plugin.andromdapp.hibernate 5 26 186 31 158 3 15
org.andromda.maven.plugin.andromdapp.script 2 11 96 9 58 2 3
org.andromda.maven.plugin.andromdapp.utils 2 6 48 8 44 3 9
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
30 121 1608 146 1182 55 77

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.andromda.maven.plugin.andromdapp.BuildMojo 176 13 0 13
org.andromda.maven.plugin.andromdapp.SchemaMojo 161 10 0 11
org.andromda.maven.plugin.andromdapp.EclipseMojo 129 8 0 9
org.andromda.maven.plugin.andromdapp.SymbolicLinkExplodedEarMojo 122 4 0 5
org.andromda.maven.plugin.andromdapp.eclipse.ClasspathWriter 92 4 0 5
org.andromda.maven.plugin.andromdapp.script.ScriptClassGenerator 75 8 0 5
org.andromda.maven.plugin.andromdapp.hibernate.HibernateSchemaManagement 64 13 0 14
org.andromda.maven.plugin.andromdapp.ScriptClassGeneratorMojo 52 4 0 5
org.andromda.maven.plugin.andromdapp.DeployMojo 47 2 0 3
org.andromda.maven.plugin.andromdapp.AbstractAndroMDAppMojo 46 4 0 5
org.andromda.maven.plugin.andromdapp.eclipse.ProjectWriter 32 2 0 3
org.andromda.maven.plugin.andromdapp.AndroMDAppCleanMojo 31 1 0 2
org.andromda.maven.plugin.andromdapp.hibernate.HibernateUpdateSchema 28 4 0 5
org.andromda.maven.plugin.andromdapp.JdbcDriverWrapper 22 8 0 9
org.andromda.maven.plugin.andromdapp.hibernate.HibernateValidateSchema 21 3 0 4
org.andromda.maven.plugin.andromdapp.utils.ProjectUtils 21 2 0 3
org.andromda.maven.plugin.andromdapp.AndroMDAppMojo 19 1 0 2
org.andromda.maven.plugin.andromdapp.Location 17 2 0 3
org.andromda.maven.plugin.andromdapp.hibernate.HibernateCreateSchema 16 3 0 4
org.andromda.maven.plugin.andromdapp.hibernate.HibernateDropSchema 16 3 0 4
org.andromda.maven.plugin.andromdapp.utils.Projects 14 4 0 5
org.andromda.maven.plugin.andromdapp.BeanProperties 13 2 0 3
org.andromda.maven.plugin.andromdapp.UndeployMojo 13 1 0 2
org.andromda.maven.plugin.andromdapp.eclipse.OrArtifactFilter 11 2 0 3
org.andromda.maven.plugin.andromdapp.AppManagementMojo 10 2 0 3
org.andromda.maven.plugin.andromdapp.eclipse.EclipseWriter 10 2 0 3
org.andromda.maven.plugin.andromdapp.SchemaManagementException 8 3 0 4
org.andromda.maven.plugin.andromdapp.script.ScriptClassGeneratorException 8 3 0 4
org.andromda.maven.plugin.andromdapp.eclipse.Variable 7 2 0 3
org.andromda.maven.plugin.andromdapp.SchemaManagement 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.andromda.maven.plugin.andromdapp.BuildMojo 176 13 0 13
org.andromda.maven.plugin.andromdapp.hibernate.HibernateSchemaManagement 64 13 0 14
org.andromda.maven.plugin.andromdapp.SchemaMojo 161 10 0 11
org.andromda.maven.plugin.andromdapp.EclipseMojo 129 8 0 9
org.andromda.maven.plugin.andromdapp.JdbcDriverWrapper 22 8 0 9
org.andromda.maven.plugin.andromdapp.script.ScriptClassGenerator 75 8 0 5
org.andromda.maven.plugin.andromdapp.AbstractAndroMDAppMojo 46 4 0 5
org.andromda.maven.plugin.andromdapp.eclipse.ClasspathWriter 92 4 0 5
org.andromda.maven.plugin.andromdapp.hibernate.HibernateUpdateSchema 28 4 0 5
org.andromda.maven.plugin.andromdapp.ScriptClassGeneratorMojo 52 4 0 5
org.andromda.maven.plugin.andromdapp.SymbolicLinkExplodedEarMojo 122 4 0 5
org.andromda.maven.plugin.andromdapp.utils.Projects 14 4 0 5
org.andromda.maven.plugin.andromdapp.hibernate.HibernateCreateSchema 16 3 0 4
org.andromda.maven.plugin.andromdapp.hibernate.HibernateDropSchema 16 3 0 4
org.andromda.maven.plugin.andromdapp.hibernate.HibernateValidateSchema 21 3 0 4
org.andromda.maven.plugin.andromdapp.SchemaManagementException 8 3 0 4
org.andromda.maven.plugin.andromdapp.script.ScriptClassGeneratorException 8 3 0 4
org.andromda.maven.plugin.andromdapp.AppManagementMojo 10 2 0 3
org.andromda.maven.plugin.andromdapp.BeanProperties 13 2 0 3
org.andromda.maven.plugin.andromdapp.DeployMojo 47 2 0 3
org.andromda.maven.plugin.andromdapp.eclipse.EclipseWriter 10 2 0 3
org.andromda.maven.plugin.andromdapp.eclipse.OrArtifactFilter 11 2 0 3
org.andromda.maven.plugin.andromdapp.eclipse.ProjectWriter 32 2 0 3
org.andromda.maven.plugin.andromdapp.eclipse.Variable 7 2 0 3
org.andromda.maven.plugin.andromdapp.Location 17 2 0 3
org.andromda.maven.plugin.andromdapp.utils.ProjectUtils 21 2 0 3
org.andromda.maven.plugin.andromdapp.AndroMDAppCleanMojo 31 1 0 2
org.andromda.maven.plugin.andromdapp.AndroMDAppMojo 19 1 0 2
org.andromda.maven.plugin.andromdapp.SchemaManagement 2 1 0 2
org.andromda.maven.plugin.andromdapp.UndeployMojo 13 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
42.77 1,608.00 0.00 4.03 4.87

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.andromda.maven.plugin.andromdapp.eclipse.ClasspathWriter.write(MavenProject,String,ArtifactFactory,ArtifactResolver,ArtifactRepository,ArtifactMetadataSource,String,ArtifactRepository,boolean,Variable[],String) 73 22 1
org.andromda.maven.plugin.andromdapp.SymbolicLinkExplodedEarMojo.execute() 66 20 1
org.andromda.maven.plugin.andromdapp.BuildMojo.execute() 54 19 1
org.andromda.maven.plugin.andromdapp.SchemaMojo.execute() 44 19 1
org.andromda.maven.plugin.andromdapp.script.ScriptClassGenerator.modifyClass(String,Class) 33 9 1
org.andromda.maven.plugin.andromdapp.SchemaMojo.executeSql(Connection,String) 31 10 1
org.andromda.maven.plugin.andromdapp.AndroMDAppCleanMojo.execute() 30 13 1
org.andromda.maven.plugin.andromdapp.DeployMojo.execute() 30 15 1
org.andromda.maven.plugin.andromdapp.eclipse.ProjectWriter.write() 29 1 1
org.andromda.maven.plugin.andromdapp.EclipseMojo.getExtraSourceDirectories(MavenProject) 28 14 1
org.andromda.maven.plugin.andromdapp.SymbolicLinkExplodedEarMojo.getExplodedModuleArtifacts() 23 10 1
org.andromda.maven.plugin.andromdapp.BuildMojo.getModulePoms(String) 21 8 1
org.andromda.maven.plugin.andromdapp.AndroMDAppMojo.execute() 17 10 1
org.andromda.maven.plugin.andromdapp.BuildMojo.executeModules(String,String,boolean) 17 6 1
org.andromda.maven.plugin.andromdapp.ScriptClassGeneratorMojo.execute() 17 7 1
org.andromda.maven.plugin.andromdapp.BuildMojo.collectProjects(String) 16 8 1
org.andromda.maven.plugin.andromdapp.SchemaMojo.initializeClasspathFromClassPathElements(String) 16 7 1
org.andromda.maven.plugin.andromdapp.EclipseMojo.execute() 15 5 1
org.andromda.maven.plugin.andromdapp.EclipseMojo.getPoms() 15 4 1
org.andromda.maven.plugin.andromdapp.hibernate.HibernateUpdateSchema.addArguments(Map,String) 15 2 1
org.andromda.maven.plugin.andromdapp.AbstractAndroMDAppMojo.getProperties() 14 4 1
org.andromda.maven.plugin.andromdapp.EclipseMojo.collectProjects() 14 7 1
org.andromda.maven.plugin.andromdapp.hibernate.HibernateValidateSchema.addArguments(Map,String) 14 1 1
org.andromda.maven.plugin.andromdapp.BuildMojo.executeProjects(MavenProject,String) 13 6 1
org.andromda.maven.plugin.andromdapp.hibernate.HibernateSchemaManagement.getExecutionClass() 13 5 1
org.andromda.maven.plugin.andromdapp.DeployMojo.getAdditionalFiles() 12 3 1
org.andromda.maven.plugin.andromdapp.script.ScriptClassGenerator.constructArgumentString(CtMethod) 12 3 0
org.andromda.maven.plugin.andromdapp.UndeployMojo.execute() 12 6 1
org.andromda.maven.plugin.andromdapp.AbstractAndroMDAppMojo.replaceProperties(Properties,String) 11 1 1
org.andromda.maven.plugin.andromdapp.EclipseMojo.getConfiguration(Plugin) 11 5 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,608.00 9.26 3.46 0.96

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