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 18 395 2845 460 4625 204 623
org.apache.commons.text.translate 14 45 643 60 386 314 311
org.apache.commons.text.similarity 19 55 596 70 921 94 525
org.apache.commons.text.diff 9 29 185 43 534 11 192
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
60 524 4269 633 6466 623 1651

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.text.StrBuilder 991 149 3 173
org.apache.commons.text.StrSubstitutor 319 57 0 58
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 219 18 0 19
org.apache.commons.text.StringEscapeUtils 184 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.translate.NumericEntityUnescaper 46 3 1 4
org.apache.commons.text.StrLookup 44 6 3 14
org.apache.commons.text.CaseUtils 42 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.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.similarity.FuzzyScore 28 3 0 4
org.apache.commons.text.FormattableUtils 28 6 0 7
org.apache.commons.text.similarity.CosineSimilarity 27 3 0 4
org.apache.commons.text.translate.CsvTranslators 26 1 2 4
org.apache.commons.text.diff.EditScript 24 7 0 8
org.apache.commons.text.translate.NumericEntityEscaper 23 7 0 8
org.apache.commons.text.similarity.JaccardSimilarity 22 2 0 3
org.apache.commons.text.diff.ReplacementsFinder 22 4 0 5

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.StrTokenizer 307 64 0 65
org.apache.commons.text.StrSubstitutor 319 57 0 58
org.apache.commons.text.ExtendedMessageFormat 219 21 0 22
org.apache.commons.text.StringEscapeUtils 184 19 2 26
org.apache.commons.text.WordUtils 219 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.translate.UnicodeEscaper 36 8 0 9
org.apache.commons.text.similarity.LevenshteinResults 29 8 0 6
org.apache.commons.text.similarity.LevenshteinDetailedDistance 170 8 0 9
org.apache.commons.text.translate.NumericEntityEscaper 23 7 0 8
org.apache.commons.text.similarity.LevenshteinDistance 98 7 0 8
org.apache.commons.text.diff.EditScript 24 7 0 8
org.apache.commons.text.CharacterPredicates 22 7 0 0
org.apache.commons.text.translate.JavaUnicodeEscaper 14 6 0 7
org.apache.commons.text.CompositeFormat 17 6 0 7
org.apache.commons.text.FormattableUtils 28 6 0 7
org.apache.commons.text.StrLookup 44 6 3 14
org.apache.commons.text.RandomStringGenerator 100 5 1 13
org.apache.commons.text.translate.CharSequenceTranslator 38 5 0 6
org.apache.commons.text.diff.StringsComparator 96 5 1 11
org.apache.commons.text.similarity.SimilarityScoreFrom 13 4 0 5
org.apache.commons.text.similarity.LongestCommonSubsequence 40 4 0 5
org.apache.commons.text.similarity.EditDistanceFrom 13 4 0 5
org.apache.commons.text.diff.ReplacementsFinder 22 4 0 5
org.apache.commons.text.translate.NumericEntityUnescaper 46 3 1 4
org.apache.commons.text.translate.OctalUnescaper 20 3 0 4
org.apache.commons.text.translate.SinglePassTranslator 10 3 0 3
org.apache.commons.text.similarity.FuzzyScore 28 3 0 4

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
67.50 4,269.00 0.30 8.73 10.55

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
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) 48 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.StrTokenizer.readWithQuotes(int[],int,int,StrBuilder,String,int,int) 40 11 1
org.apache.commons.text.translate.NumericEntityUnescaper.translate(CharSequence,int,Writer) 36 28 1
org.apache.commons.text.similarity.LevenshteinDistance.unlimitedCompare(CharSequence,CharSequence) 35 13 1
org.apache.commons.text.CaseUtils.toCamelCase(String,boolean,char) 31 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.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.translate.CharSequenceTranslator.translate(CharSequence,Writer) 20 9 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
org.apache.commons.text.similarity.LongestCommonSubsequence.longestCommonSubsequence(CharSequence,CharSequence) 20 7 1
org.apache.commons.text.StrBuilder.insert(int,boolean) 20 2 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
4,269.00 5.90 3.01 0.96

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