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.model.recipe1494291241530260
com.swingtech.cooksarm.core.parser.model648151161100124
com.swingtech.cooksarm.core.dao510251598090
com.swingtech.cooksarm.core.error28211066036
com.swingtech.cooksarm.core.parser2313558036
com.swingtech.cooksarm.core.service.impl121317018
com.swingtech.cooksarm.core.parser.error1410545018
com.swingtech.cooksarm.core.service115215018
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
32170529785520600

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
com.swingtech.cooksarm.core.model.recipe.Recipe552002
com.swingtech.cooksarm.core.model.recipe.IngredientItem501903
com.swingtech.cooksarm.core.parser.model.RecipeItemSummaries491806
com.swingtech.cooksarm.core.model.recipe.BaseItem411601
com.swingtech.cooksarm.core.model.recipe.FacetItem331001
com.swingtech.cooksarm.core.parser.model.RecipeListItem30902
com.swingtech.cooksarm.core.parser.model.ItemSummary28904
com.swingtech.cooksarm.core.parser.model.RecipeProgramSummary16601
com.swingtech.cooksarm.core.model.recipe.DirectionStep16601
com.swingtech.cooksarm.core.model.recipe.Ingredients16504
com.swingtech.cooksarm.core.model.recipe.ItemCode16601
com.swingtech.cooksarm.core.parser.model.RecipeParseErrorItem11401
com.swingtech.cooksarm.core.error.CooksArmDaoException10405
com.swingtech.cooksarm.core.parser.error.RecipeParseException9405
com.swingtech.cooksarm.core.error.CooksArmServiceException9405
com.swingtech.cooksarm.core.service.impl.RecipeServiceImpl8201
com.swingtech.cooksarm.core.model.recipe.Facets8302
com.swingtech.cooksarm.core.model.recipe.RecipeInfos8302
com.swingtech.cooksarm.core.model.recipe.DirectionSteps8302
com.swingtech.cooksarm.core.model.recipe.NutritionFacts8302
com.swingtech.cooksarm.core.parser.model.RecipeParseState6202
com.swingtech.cooksarm.core.dao.FacetDao4304
com.swingtech.cooksarm.core.parser.RecipeParser3203
com.swingtech.cooksarm.core.dao.IngredientDao3203
com.swingtech.cooksarm.core.dao.RecipeInfoDao3203
com.swingtech.cooksarm.core.dao.NutritionFactDao3203
com.swingtech.cooksarm.core.parser.RecipeListParser2102
com.swingtech.cooksarm.core.dao.RecipeDao2102
com.swingtech.cooksarm.core.service.RecipeService2102
com.swingtech.cooksarm.core.model.recipe.RecipeInfoItem1001

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
com.swingtech.cooksarm.core.model.recipe.Recipe552002
com.swingtech.cooksarm.core.model.recipe.IngredientItem501903
com.swingtech.cooksarm.core.parser.model.RecipeItemSummaries491806
com.swingtech.cooksarm.core.model.recipe.BaseItem411601
com.swingtech.cooksarm.core.model.recipe.FacetItem331001
com.swingtech.cooksarm.core.parser.model.RecipeListItem30902
com.swingtech.cooksarm.core.parser.model.ItemSummary28904
com.swingtech.cooksarm.core.parser.model.RecipeProgramSummary16601
com.swingtech.cooksarm.core.model.recipe.DirectionStep16601
com.swingtech.cooksarm.core.model.recipe.ItemCode16601
com.swingtech.cooksarm.core.model.recipe.Ingredients16504
com.swingtech.cooksarm.core.parser.error.RecipeParseException9405
com.swingtech.cooksarm.core.parser.model.RecipeParseErrorItem11401
com.swingtech.cooksarm.core.error.CooksArmDaoException10405
com.swingtech.cooksarm.core.error.CooksArmServiceException9405
com.swingtech.cooksarm.core.dao.FacetDao4304
com.swingtech.cooksarm.core.model.recipe.Facets8302
com.swingtech.cooksarm.core.model.recipe.RecipeInfos8302
com.swingtech.cooksarm.core.model.recipe.DirectionSteps8302
com.swingtech.cooksarm.core.model.recipe.NutritionFacts8302
com.swingtech.cooksarm.core.parser.RecipeParser3203
com.swingtech.cooksarm.core.parser.model.RecipeParseState6202
com.swingtech.cooksarm.core.dao.IngredientDao3203
com.swingtech.cooksarm.core.dao.RecipeInfoDao3203
com.swingtech.cooksarm.core.dao.NutritionFactDao3203
com.swingtech.cooksarm.core.service.impl.RecipeServiceImpl8201
com.swingtech.cooksarm.core.parser.RecipeListParser2102
com.swingtech.cooksarm.core.dao.RecipeDao2102
com.swingtech.cooksarm.core.service.RecipeService2102
com.swingtech.cooksarm.core.model.recipe.RecipeInfoItem1001

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
14.38529.000.005.312.44

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
com.swingtech.cooksarm.core.parser.model.RecipeItemSummaries.addToList(String,ItemSummary)720
com.swingtech.cooksarm.core.model.recipe.Recipe.toString()710
com.swingtech.cooksarm.core.model.recipe.FacetItem.equals(Object)760
com.swingtech.cooksarm.core.model.recipe.Ingredients.getIngredientsWithAlternateIngredientItem()631
com.swingtech.cooksarm.core.parser.model.RecipeListItem.equals(Object)530
com.swingtech.cooksarm.core.parser.model.RecipeListItem.hashCode()520
com.swingtech.cooksarm.core.parser.model.ItemSummary.hashCode()520
com.swingtech.cooksarm.core.model.recipe.FacetItem.hashCode()520
com.swingtech.cooksarm.core.parser.model.RecipeListItem.RecipeListItem(String,String,String)411
com.swingtech.cooksarm.core.parser.model.ItemSummary.equals(Object)430
com.swingtech.cooksarm.core.service.impl.RecipeServiceImpl.saveRecipe(Recipe)430
com.swingtech.cooksarm.core.parser.model.ItemSummary.ItemSummary(String)311
com.swingtech.cooksarm.core.parser.model.ItemSummary.ItemSummary(String,int)311
com.swingtech.cooksarm.core.parser.model.RecipeItemSummaries.addRecipe(String)311
com.swingtech.cooksarm.core.model.recipe.IngredientItem.addAlternateIngredientItem(IngredientItem)311
com.swingtech.cooksarm.core.model.recipe.IngredientItem.setAlternateIngredientItems(IngredientItem)311
com.swingtech.cooksarm.core.parser.error.RecipeParseException.RecipeParseException()211
com.swingtech.cooksarm.core.parser.error.RecipeParseException.RecipeParseException(String)211
com.swingtech.cooksarm.core.parser.error.RecipeParseException.RecipeParseException(String,Throwable)211
com.swingtech.cooksarm.core.parser.error.RecipeParseException.RecipeParseException(Throwable)211
com.swingtech.cooksarm.core.parser.model.RecipeListItem.getId()210
com.swingtech.cooksarm.core.parser.model.RecipeListItem.getName()210
com.swingtech.cooksarm.core.parser.model.RecipeListItem.getUrl()210
com.swingtech.cooksarm.core.parser.model.RecipeListItem.setId(String)210
com.swingtech.cooksarm.core.parser.model.RecipeListItem.setName(String)210
com.swingtech.cooksarm.core.parser.model.RecipeListItem.setUrl(String)210
com.swingtech.cooksarm.core.parser.model.ItemSummary.getItemName()210
com.swingtech.cooksarm.core.parser.model.ItemSummary.getRecipeCount()210
com.swingtech.cooksarm.core.parser.model.ItemSummary.incrementRecipeCount()211
com.swingtech.cooksarm.core.parser.model.ItemSummary.setItemName(String)210

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
529.002.161.100.27

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