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
com.swingtech.cooksarm.core.dao.jpa.db.model182087531854180
com.swingtech.cooksarm.core.dao.jpa.mapper628270334000108
com.swingtech.cooksarm.core.dao.jpa523172191441133
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
2925911957059819241

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
com.swingtech.cooksarm.core.dao.jpa.mapper.IngredientJpaDataMapper62606
com.swingtech.cooksarm.core.dao.jpa.db.model.Recipe531901
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeInfoJpaDataMapper50506
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeIngredient491701
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeNutritionFact431501
com.swingtech.cooksarm.core.dao.jpa.db.model.XIngredientAlternateIngredient421501
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeRecipeInfo371301
com.swingtech.cooksarm.core.dao.jpa.mapper.NutritionFactJpaDataMapper36405
com.swingtech.cooksarm.core.dao.jpa.mapper.FacetJpaDataMapper35405
com.swingtech.cooksarm.core.dao.jpa.db.model.RecipeInfo351301
com.swingtech.cooksarm.core.dao.jpa.db.model.Ingredient351301
com.swingtech.cooksarm.core.dao.jpa.RecipeDaoJpa34707
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeFacet311101
com.swingtech.cooksarm.core.dao.jpa.db.model.DirectionStep301101
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeJpaDataMapper29607
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeFacetId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeRecipeInfoId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeNutritionFactId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.Facet291101
com.swingtech.cooksarm.core.dao.jpa.db.model.DirectionStepId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.RecipeInfoValueTypeCode291101
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeIngredientId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.XIngredientAlternateIngredientId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.NutritionFact291101
com.swingtech.cooksarm.core.dao.jpa.IngredientDaoJpa28403
com.swingtech.cooksarm.core.dao.jpa.FacetDaoJpa25403
com.swingtech.cooksarm.core.dao.jpa.NutritionFactDaoJpa25403
com.swingtech.cooksarm.core.dao.jpa.mapper.DirectionsJpaDataMapper23304
com.swingtech.cooksarm.core.dao.jpa.RecipeInfoDaoJpa23403

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
com.swingtech.cooksarm.core.dao.jpa.db.model.Recipe531901
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeIngredient491701
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeNutritionFact431501
com.swingtech.cooksarm.core.dao.jpa.db.model.XIngredientAlternateIngredient421501
com.swingtech.cooksarm.core.dao.jpa.db.model.RecipeInfo351301
com.swingtech.cooksarm.core.dao.jpa.db.model.Ingredient351301
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeRecipeInfo371301
com.swingtech.cooksarm.core.dao.jpa.db.model.Facet291101
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeFacet311101
com.swingtech.cooksarm.core.dao.jpa.db.model.DirectionStep301101
com.swingtech.cooksarm.core.dao.jpa.db.model.RecipeInfoValueTypeCode291101
com.swingtech.cooksarm.core.dao.jpa.db.model.NutritionFact291101
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeFacetId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeRecipeInfoId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeNutritionFactId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.DirectionStepId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeIngredientId29801
com.swingtech.cooksarm.core.dao.jpa.db.model.XIngredientAlternateIngredientId29801
com.swingtech.cooksarm.core.dao.jpa.RecipeDaoJpa34707
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeJpaDataMapper29607
com.swingtech.cooksarm.core.dao.jpa.mapper.IngredientJpaDataMapper62606
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeInfoJpaDataMapper50506
com.swingtech.cooksarm.core.dao.jpa.FacetDaoJpa25403
com.swingtech.cooksarm.core.dao.jpa.IngredientDaoJpa28403
com.swingtech.cooksarm.core.dao.jpa.mapper.FacetJpaDataMapper35405
com.swingtech.cooksarm.core.dao.jpa.mapper.NutritionFactJpaDataMapper36405
com.swingtech.cooksarm.core.dao.jpa.NutritionFactDaoJpa25403
com.swingtech.cooksarm.core.dao.jpa.RecipeInfoDaoJpa23403
com.swingtech.cooksarm.core.dao.jpa.mapper.DirectionsJpaDataMapper23304

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
34.001,195.000.008.932.41

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
com.swingtech.cooksarm.core.dao.jpa.IngredientDaoJpa.saveIngredientItem(IngredientItem)1670
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeInfoJpaDataMapper.translateRecipeInfo(RecipeInfoItem,com.swingtech.cooksarm.core.dao.jpa.db.model.RecipeInfo)1651
com.swingtech.cooksarm.core.dao.jpa.mapper.IngredientJpaDataMapper.translateXIngredient(Recipe,IngredientItem)1511
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeInfoJpaDataMapper.translateXRecipeInfo(Recipe,RecipeInfoItem)1541
com.swingtech.cooksarm.core.dao.jpa.RecipeDaoJpa.saveRecipe(Recipe)1570
com.swingtech.cooksarm.core.dao.jpa.mapper.DirectionsJpaDataMapper.translateDirectionStep(Recipe,com.swingtech.cooksarm.core.model.recipe.DirectionStep,com.swingtech.cooksarm.core.dao.jpa.db.model.DirectionStep)1421
com.swingtech.cooksarm.core.dao.jpa.mapper.IngredientJpaDataMapper.translateIngredient(IngredientItem,com.swingtech.cooksarm.core.dao.jpa.db.model.Ingredient)1461
com.swingtech.cooksarm.core.dao.jpa.mapper.IngredientJpaDataMapper.translateXIngredientAlternateIngredient(IngredientItem,IngredientItem)1410
com.swingtech.cooksarm.core.dao.jpa.FacetDaoJpa.saveFacetItem(FacetItem)1340
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeJpaDataMapper.translateRecipe(com.swingtech.cooksarm.core.model.recipe.Recipe)1331
com.swingtech.cooksarm.core.dao.jpa.mapper.NutritionFactJpaDataMapper.translateXNutritionFact(Recipe,NutritionFactItem)1311
com.swingtech.cooksarm.core.dao.jpa.NutritionFactDaoJpa.saveNutritionFactItem(NutritionFactItem)1340
com.swingtech.cooksarm.core.dao.jpa.mapper.FacetJpaDataMapper.translateFacet(FacetItem,com.swingtech.cooksarm.core.dao.jpa.db.model.Facet)1241
com.swingtech.cooksarm.core.dao.jpa.mapper.FacetJpaDataMapper.translateXFacet(Recipe,FacetItem)1211
com.swingtech.cooksarm.core.dao.jpa.mapper.NutritionFactJpaDataMapper.translateNutritionFact(NutritionFactItem,com.swingtech.cooksarm.core.dao.jpa.db.model.NutritionFact)1241
com.swingtech.cooksarm.core.dao.jpa.RecipeInfoDaoJpa.saveRecipeInfoItem(RecipeInfoItem)1140
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeFacetId.equals(Object)9110
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeRecipeInfoId.equals(Object)9110
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeNutritionFactId.equals(Object)9110
com.swingtech.cooksarm.core.dao.jpa.db.model.DirectionStepId.equals(Object)980
com.swingtech.cooksarm.core.dao.jpa.db.model.Recipe.Recipe(int,String,String,XRecipeRecipeInfo,DirectionStep,XRecipeIngredient,XRecipeNutritionFact,XRecipeFacet)910
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeIngredientId.equals(Object)9110
com.swingtech.cooksarm.core.dao.jpa.db.model.XIngredientAlternateIngredientId.equals(Object)9140
com.swingtech.cooksarm.core.dao.jpa.mapper.IngredientJpaDataMapper.translateAlternateIngredientList(IngredientItem,IngredientItem,com.swingtech.cooksarm.core.dao.jpa.db.model.Ingredient,XIngredientAlternateIngredient)881
com.swingtech.cooksarm.core.dao.jpa.mapper.IngredientJpaDataMapper.translateIngredientList(Recipe,com.swingtech.cooksarm.core.model.recipe.Ingredients,XRecipeIngredient)881
com.swingtech.cooksarm.core.dao.jpa.mapper.FacetJpaDataMapper.translateFacetList(Recipe,com.swingtech.cooksarm.core.model.recipe.Facets,XRecipeFacet)881
com.swingtech.cooksarm.core.dao.jpa.mapper.NutritionFactJpaDataMapper.translateNutritionFactList(Recipe,com.swingtech.cooksarm.core.model.recipe.NutritionFacts,XRecipeNutritionFact)881
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeInfoJpaDataMapper.translateRecipeInfoList(Recipe,com.swingtech.cooksarm.core.model.recipe.RecipeInfos,XRecipeRecipeInfo)881
com.swingtech.cooksarm.core.dao.jpa.mapper.RecipeInfoJpaDataMapper.translateRecipeInfoValueTypeCode(ValueTypeCode)831
com.swingtech.cooksarm.core.dao.jpa.db.model.XRecipeIngredient.XRecipeIngredient(XRecipeIngredientId,Ingredient,Recipe,Double,String,String,String)810

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,195.003.341.630.16

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