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.parser.atkins1349549158613298
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
1349549158613298

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser123901
com.swingtech.cooksarm.core.parser.atkins.ParserUtil87701
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser78701
com.swingtech.cooksarm.core.parser.atkins.AtkinsDirectionStepParser58601
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeListPageParser41303
com.swingtech.cooksarm.core.parser.atkins.AtkinsFacetParser21301
com.swingtech.cooksarm.core.parser.atkins.AtkinsNutritionFactParser17301
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeInfoParser17301
com.swingtech.cooksarm.core.parser.atkins.IngredientParser4301
com.swingtech.cooksarm.core.parser.atkins.NutritionFactParser3201
com.swingtech.cooksarm.core.parser.atkins.FacetParser2101
com.swingtech.cooksarm.core.parser.atkins.DirectionStepParser2101
com.swingtech.cooksarm.core.parser.atkins.RecipeInfoParser2101

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser123901
com.swingtech.cooksarm.core.parser.atkins.ParserUtil87701
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser78701
com.swingtech.cooksarm.core.parser.atkins.AtkinsDirectionStepParser58601
com.swingtech.cooksarm.core.parser.atkins.IngredientParser4301
com.swingtech.cooksarm.core.parser.atkins.AtkinsFacetParser21301
com.swingtech.cooksarm.core.parser.atkins.AtkinsNutritionFactParser17301
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeInfoParser17301
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeListPageParser41303
com.swingtech.cooksarm.core.parser.atkins.NutritionFactParser3201
com.swingtech.cooksarm.core.parser.atkins.FacetParser2101
com.swingtech.cooksarm.core.parser.atkins.DirectionStepParser2101
com.swingtech.cooksarm.core.parser.atkins.RecipeInfoParser2101

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
35.00549.000.003.771.15

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
com.swingtech.cooksarm.core.parser.atkins.ParserUtil.populateItemValues(BaseItem,String)5690
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser.parseIngredientsDirectionAndCategories(RecipeParseState,Recipe,TagNode)40140
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser.parseNutritionAndRecipeInfo(Recipe,TagNode)2580
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeListPageParser.parseRecipeListPage(String)2470
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser.parseRecipe(String,String)1730
com.swingtech.cooksarm.core.parser.atkins.AtkinsDirectionStepParser.populateDirectionItem(RecipeParseState,Recipe,TagNode)1790
com.swingtech.cooksarm.core.parser.atkins.AtkinsDirectionStepParser.setDirectionStepFromContentString(RecipeParseState,Recipe,String)1570
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser.addAlternateIngredientToRecipe(Recipe,String)1550
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser.parseIngredientItemStringList(Recipe,TagNode)1560
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser.setIngredientItemFromContentString(Recipe,String)1550
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser.getNamedTagNode(TagNode,String)1460
com.swingtech.cooksarm.core.parser.atkins.AtkinsFacetParser.parseCategoryString(Recipe,String)1330
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser.stripSpecialCharactersIngredient(String)1130
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeListPageParser.testParse(String)1131
com.swingtech.cooksarm.core.parser.atkins.AtkinsNutritionFactParser.parseNutritionFactString(Recipe,String)1010
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeInfoParser.parseRecipeInfoString(Recipe,String)1010
com.swingtech.cooksarm.core.parser.atkins.ParserUtil.createCodeFromName(String,int,int)1040
com.swingtech.cooksarm.core.parser.atkins.AtkinsDirectionStepParser.parseDirectionItemStringList(RecipeParseState,Recipe,TagNode)960
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser.populateIngredientItem(Recipe,TagNode)950
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser.getRecipeName(TagNode)840
com.swingtech.cooksarm.core.parser.atkins.AtkinsDirectionStepParser.parseDirectionItemStringSingleParagraph(RecipeParseState,Recipe,String)740
com.swingtech.cooksarm.core.parser.atkins.ParserUtil.getBrChildCountForTagNode(TagNode)640
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeParser.main(String[])511
com.swingtech.cooksarm.core.parser.atkins.ParserUtil.tagNodeContainsBrChild(TagNode)550
com.swingtech.cooksarm.core.parser.atkins.AtkinsDirectionStepParser.parseDirectionItemFromBr(RecipeParseState,Recipe,TagNode)530
com.swingtech.cooksarm.core.parser.atkins.AtkinsIngredientParser.parseIngredientItemFromBr(Recipe,TagNode)530
com.swingtech.cooksarm.core.parser.atkins.AtkinsRecipeListPageParser.main(String[])511
com.swingtech.cooksarm.core.parser.atkins.ParserUtil.stripSpecialCharacters(String)430
com.swingtech.cooksarm.core.parser.atkins.AtkinsFacetParser.populateCategoryItem(Recipe,TagNode)310
com.swingtech.cooksarm.core.parser.atkins.AtkinsFacetParser.AtkinsFacetParser(RecipeItemSummaries)210

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
549.008.573.140.06

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