Apache Commons logo Apache Commons Codec

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.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.apache.commons.codec.language 16 134 1481 113 1060 184 293
org.apache.commons.codec.binary 13 128 866 135 1453 144 451
org.apache.commons.codec.language.bm 30 118 741 50 498 55 167
org.apache.commons.codec.digest 7 85 577 83 925 120 295
org.apache.commons.codec.net 6 69 505 69 697 9 128
org.apache.commons.codec 11 19 77 28 294 8 299
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
83 553 4247 478 4927 520 1633

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.codec.language.DoubleMetaphone 564 38 1 40
org.apache.commons.codec.language.bm.Rule 288 21 14 13
org.apache.commons.codec.language.Metaphone 213 12 0 8
org.apache.commons.codec.binary.Base64 189 26 0 27
org.apache.commons.codec.language.bm.PhoneticEngine 185 11 2 20
org.apache.commons.codec.binary.Base32 184 8 0 9
org.apache.commons.codec.digest.UnixCrypt 161 12 0 5
org.apache.commons.codec.language.ColognePhonetic 152 6 3 4
org.apache.commons.codec.digest.Sha2Crypt 144 5 0 6
org.apache.commons.codec.language.MatchRatingApproachEncoder 140 11 0 12
org.apache.commons.codec.binary.BaseNCodec 127 22 1 23
org.apache.commons.codec.net.QCodec 123 16 0 14
org.apache.commons.codec.digest.DigestUtils 119 54 0 55
org.apache.commons.codec.net.URLCodec 111 14 0 15
org.apache.commons.codec.net.QuotedPrintableCodec 105 18 0 19
org.apache.commons.codec.language.bm.Languages 99 5 4 3
org.apache.commons.codec.language.Nysiis 98 8 0 9
org.apache.commons.codec.digest.Md5Crypt 82 7 0 8
org.apache.commons.codec.binary.BinaryCodec 78 11 0 12
org.apache.commons.codec.language.bm.Lang 70 5 1 5
org.apache.commons.codec.language.Caverphone2 66 1 0 2
org.apache.commons.codec.language.Caverphone1 63 1 0 2
org.apache.commons.codec.binary.Hex 62 16 0 17
org.apache.commons.codec.binary.BaseNCodecInputStream 60 8 0 8
org.apache.commons.codec.language.Soundex 60 12 0 13
org.apache.commons.codec.net.BCodec 58 14 0 12
org.apache.commons.codec.net.RFC1522Codec 49 6 0 7
org.apache.commons.codec.binary.BaseNCodecOutputStream 46 6 0 6
org.apache.commons.codec.binary.StringUtils 45 17 0 17
org.apache.commons.codec.language.RefinedSoundex 43 8 0 9

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.commons.codec.digest.DigestUtils 119 54 0 55
org.apache.commons.codec.language.DoubleMetaphone 564 38 1 40
org.apache.commons.codec.binary.Base64 189 26 0 27
org.apache.commons.codec.binary.BaseNCodec 127 22 1 23
org.apache.commons.codec.language.bm.Rule 288 21 14 13
org.apache.commons.codec.net.QuotedPrintableCodec 105 18 0 19
org.apache.commons.codec.binary.StringUtils 45 17 0 17
org.apache.commons.codec.binary.Hex 62 16 0 17
org.apache.commons.codec.net.QCodec 123 16 0 14
org.apache.commons.codec.net.BCodec 58 14 0 12
org.apache.commons.codec.net.URLCodec 111 14 0 15
org.apache.commons.codec.digest.UnixCrypt 161 12 0 5
org.apache.commons.codec.language.DoubleMetaphone.DoubleMetaphoneResult 42 12 0 0
org.apache.commons.codec.language.Metaphone 213 12 0 8
org.apache.commons.codec.language.Soundex 60 12 0 13
org.apache.commons.codec.binary.BinaryCodec 78 11 0 12
org.apache.commons.codec.language.bm.PhoneticEngine 185 11 2 20
org.apache.commons.codec.language.MatchRatingApproachEncoder 140 11 0 12
org.apache.commons.codec.language.bm.BeiderMorseEncoder 24 9 0 8
org.apache.commons.codec.binary.Base32 184 8 0 9
org.apache.commons.codec.binary.BaseNCodecInputStream 60 8 0 8
org.apache.commons.codec.language.bm.Languages.SomeLanguages 29 8 0 0
org.apache.commons.codec.language.bm.Rule.Phoneme 34 8 1 1
org.apache.commons.codec.language.Nysiis 98 8 0 9
org.apache.commons.codec.language.RefinedSoundex 43 8 0 9
org.apache.commons.codec.digest.Md5Crypt 82 7 0 8
org.apache.commons.codec.language.bm.PhoneticEngine.PhonemeBuilder 35 7 0 5
org.apache.commons.codec.binary.BaseNCodecOutputStream 46 6 0 6
org.apache.commons.codec.language.bm.Languages.LanguageSet 8 6 0 0
org.apache.commons.codec.language.bm.Languages.LanguageSet 12 6 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
52.19 4,247.00 0.33 6.66 5.86

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.commons.codec.language.Metaphone.metaphone(String) 174 93 1
org.apache.commons.codec.digest.Sha2Crypt.sha2Crypt(String[],String,String,int,String) 122 21 1
org.apache.commons.codec.language.DoubleMetaphone.doubleMetaphone(String,boolean) 96 42 1
org.apache.commons.codec.binary.Base32.encode(Override[],int,int,Context) 80 20 1
org.apache.commons.codec.language.ColognePhonetic.colognePhonetic(String) 76 38 1
org.apache.commons.codec.language.Caverphone2.encode(String) 64 4 1
org.apache.commons.codec.digest.Md5Crypt.md5Crypt(String[],String,String) 63 14 1
org.apache.commons.codec.language.Caverphone1.encode(String) 61 4 1
org.apache.commons.codec.binary.Base32.decode(Override[],int,int,Context) 58 19 1
org.apache.commons.codec.language.bm.Rule.pattern(String) 58 28 1
org.apache.commons.codec.language.bm.Rule.parseRules(Scanner,String) 56 15 0
org.apache.commons.codec.language.bm.PhoneticEngine.encode(String,Languages.LanguageSet) 52 18 1
org.apache.commons.codec.binary.Base64.encode(Override[],int,int,Context) 50 20 1
org.apache.commons.codec.digest.UnixCrypt.crypt(String[],String) 43 11 1
org.apache.commons.codec.language.DoubleMetaphone.handleC(String,DoubleMetaphoneResult,int) 43 18 1
org.apache.commons.codec.language.DoubleMetaphone.handleG(String,DoubleMetaphoneResult,int,boolean) 43 26 1
org.apache.commons.codec.digest.UnixCrypt.desSetKey(byte[]) 38 3 0
org.apache.commons.codec.binary.Base64.decode(Override[],int,int,Context) 37 16 1
org.apache.commons.codec.language.Nysiis.nysiis(String) 37 16 1
org.apache.commons.codec.language.DoubleMetaphone.handleS(String,DoubleMetaphoneResult,int,boolean) 35 17 1
org.apache.commons.codec.digest.UnixCrypt.body(int[],int,int) 34 3 0
org.apache.commons.codec.language.bm.Lang.loadFromResource(String,Languages) 33 11 1
org.apache.commons.codec.language.MatchRatingApproachEncoder.leftToRightThenRightToLeftProcessing(String,String) 28 7 1
org.apache.commons.codec.language.MatchRatingApproachEncoder.isEncodeEquals(String,String) 27 16 1
org.apache.commons.codec.language.Nysiis.transcodeRemaining(char,char,char,char) 27 30 1
org.apache.commons.codec.net.RFC1522Codec.decodeText(String) 25 14 1
org.apache.commons.codec.binary.BaseNCodecInputStream.read(byte[],int,int) 24 15 1
org.apache.commons.codec.language.DoubleMetaphone.handleJ(String,DoubleMetaphoneResult,int,boolean) 24 17 1
org.apache.commons.codec.language.DoubleMetaphone.handleGH(String,DoubleMetaphoneResult,int) 22 16 1
org.apache.commons.codec.language.DoubleMetaphone.handleW(String,DoubleMetaphoneResult,int) 22 11 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
4,247.00 6.59 3.18 0.75

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