Apache Commons logo Commons Text

JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 33.54.
JavaNCSS web site.

Packages

Packages

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

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.apache.commons.text 21 664 4498 755 7487 340 710
org.apache.commons.text.translate 14 45 642 60 387 314 311
org.apache.commons.text.similarity 19 55 596 70 920 94 525
org.apache.commons.text.lookup 13 51 227 61 477 14 283
org.apache.commons.text.diff 9 29 185 43 534 11 192
org.apache.commons.text.matcher 3 17 101 35 246 1 108
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
79 861 6249 1024 10051 774 2129

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.text.TextStringBuilder 993 149 3 173
org.apache.commons.text.StrBuilder 991 149 3 173
org.apache.commons.text.StringSubstitutor 324 57 0 58
org.apache.commons.text.StrSubstitutor 319 57 0 58
org.apache.commons.text.StringTokenizer 307 64 0 65
org.apache.commons.text.StrTokenizer 307 64 0 65
org.apache.commons.text.translate.EntityArrays 299 1 0 2
org.apache.commons.text.ExtendedMessageFormat 219 21 0 22
org.apache.commons.text.WordUtils 218 18 0 19
org.apache.commons.text.StringEscapeUtils 182 19 2 26
org.apache.commons.text.similarity.LevenshteinDetailedDistance 170 8 0 9
org.apache.commons.text.AlphabetConverter 147 14 0 12
org.apache.commons.text.RandomStringGenerator 100 5 1 13
org.apache.commons.text.similarity.LevenshteinDistance 98 7 0 8
org.apache.commons.text.diff.StringsComparator 96 5 1 11
org.apache.commons.text.StrMatcher 91 16 5 32
org.apache.commons.text.similarity.JaroWinklerDistance 55 2 0 3
org.apache.commons.text.matcher.StringMatcherFactory 48 14 0 15
org.apache.commons.text.matcher.AbstractStringMatcher 46 2 5 18
org.apache.commons.text.translate.NumericEntityUnescaper 45 3 1 4
org.apache.commons.text.lookup.InterpolatorStringLookup 43 7 0 6
org.apache.commons.text.StrLookup 43 5 3 13
org.apache.commons.text.CaseUtils 41 3 0 4
org.apache.commons.text.similarity.LongestCommonSubsequence 40 4 0 5
org.apache.commons.text.translate.CharSequenceTranslator 38 5 0 6
org.apache.commons.text.lookup.JavaPlatformStringLookup 36 9 0 10
org.apache.commons.text.translate.UnicodeEscaper 36 8 0 9
org.apache.commons.text.translate.LookupTranslator 34 2 0 3
org.apache.commons.text.similarity.LevenshteinResults 29 8 0 6
org.apache.commons.text.FormattableUtils 28 6 0 7

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.commons.text.StrBuilder 991 149 3 173
org.apache.commons.text.TextStringBuilder 993 149 3 173
org.apache.commons.text.StringTokenizer 307 64 0 65
org.apache.commons.text.StrTokenizer 307 64 0 65
org.apache.commons.text.StringSubstitutor 324 57 0 58
org.apache.commons.text.StrSubstitutor 319 57 0 58
org.apache.commons.text.ExtendedMessageFormat 219 21 0 22
org.apache.commons.text.StringEscapeUtils 182 19 2 26
org.apache.commons.text.WordUtils 218 18 0 19
org.apache.commons.text.StrMatcher 91 16 5 32
org.apache.commons.text.AlphabetConverter 147 14 0 12
org.apache.commons.text.matcher.StringMatcherFactory 48 14 0 15
org.apache.commons.text.lookup.StringLookupFactory 27 13 0 14
org.apache.commons.text.lookup.JavaPlatformStringLookup 36 9 0 10
org.apache.commons.text.similarity.LevenshteinDetailedDistance 170 8 0 9
org.apache.commons.text.similarity.LevenshteinResults 29 8 0 6
org.apache.commons.text.translate.UnicodeEscaper 36 8 0 9
org.apache.commons.text.CharacterPredicates 22 7 0 0
org.apache.commons.text.diff.EditScript 24 7 0 8
org.apache.commons.text.lookup.InterpolatorStringLookup 43 7 0 6
org.apache.commons.text.similarity.LevenshteinDistance 98 7 0 8
org.apache.commons.text.translate.NumericEntityEscaper 23 7 0 8
org.apache.commons.text.CompositeFormat 17 6 0 7
org.apache.commons.text.FormattableUtils 28 6 0 7
org.apache.commons.text.translate.JavaUnicodeEscaper 14 6 0 7
org.apache.commons.text.diff.StringsComparator 96 5 1 11
org.apache.commons.text.lookup.MapStringLookup 18 5 0 5
org.apache.commons.text.RandomStringGenerator 100 5 1 13
org.apache.commons.text.StrLookup 43 5 3 13
org.apache.commons.text.translate.CharSequenceTranslator 38 5 0 6

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
75.47 6,249.00 0.33 10.90 12.96

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.commons.text.StringSubstitutor.substitute(TextStringBuilder,int,int,String) 90 24 1
org.apache.commons.text.StrSubstitutor.substitute(StrBuilder,int,int,String) 90 24 1
org.apache.commons.text.similarity.LevenshteinDetailedDistance.findDetailedResults(CharSequence,CharSequence,CharSequence[][],boolean) 56 27 1
org.apache.commons.text.similarity.LevenshteinDetailedDistance.limitedCompare(CharSequence,CharSequence,int) 54 25 1
org.apache.commons.text.ExtendedMessageFormat.applyPattern(String) 51 18 1
org.apache.commons.text.WordUtils.wrap(String,int,String,boolean,String) 47 15 1
org.apache.commons.text.similarity.LevenshteinDistance.limitedCompare(CharSequence,CharSequence,int) 46 23 1
org.apache.commons.text.AlphabetConverter.createConverter(Integer[],Integer[],Integer[]) 43 14 1
org.apache.commons.text.similarity.LevenshteinDetailedDistance.unlimitedCompare(CharSequence,CharSequence) 43 15 1
org.apache.commons.text.similarity.JaroWinklerDistance.matches(CharSequence,CharSequence) 42 14 1
org.apache.commons.text.diff.StringsComparator.getMiddleSnake(int,int,int,int) 40 31 1
org.apache.commons.text.StringTokenizer.readWithQuotes(int[],int,int,TextStringBuilder,String,int,int) 40 11 1
org.apache.commons.text.StrTokenizer.readWithQuotes(int[],int,int,StrBuilder,String,int,int) 40 11 1
org.apache.commons.text.similarity.LevenshteinDistance.unlimitedCompare(CharSequence,CharSequence) 35 13 1
org.apache.commons.text.translate.NumericEntityUnescaper.translate(CharSequence,int,Writer) 35 28 1
org.apache.commons.text.CaseUtils.toCamelCase(String,boolean,char) 30 12 1
org.apache.commons.text.RandomStringGenerator.generate(int) 29 13 1
org.apache.commons.text.ExtendedMessageFormat.insertFormats(String,String) 28 9 1
org.apache.commons.text.WordUtils.swapCase(String) 26 8 1
org.apache.commons.text.StrBuilder.readFrom(Readable) 25 6 1
org.apache.commons.text.TextStringBuilder.readFrom(Readable) 25 6 1
org.apache.commons.text.ExtendedMessageFormat.parseFormatDescription(String,ParsePosition) 24 8 1
org.apache.commons.text.WordUtils.capitalize(String,char) 24 6 1
org.apache.commons.text.WordUtils.uncapitalize(String,char) 24 6 1
org.apache.commons.text.WordUtils.abbreviate(String,int,int,String) 23 10 1
org.apache.commons.text.diff.StringsComparator.buildScript(int,int,int,int,Character) 22 13 1
org.apache.commons.text.ExtendedMessageFormat.readArgumentIndex(String,ParsePosition) 21 14 1
org.apache.commons.text.AlphabetConverter.decode(String) 20 9 1
org.apache.commons.text.AlphabetConverter.addSingleEncoding(int,String,Integer,Integer,String) 20 10 1
org.apache.commons.text.similarity.FuzzyScore.fuzzyScore(CharSequence,CharSequence) 20 9 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
6,249.00 5.52 2.86 0.97

Explanations

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