Fork me on GitHub

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.miloss.fgsms.common.codec 17 126 662 140 1521 88 606
org.miloss.fgsms.common 4 80 632 43 309 45 176
org.miloss.fgsms.tomcat.jdbcp 1 1 16 1 4 0 5
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
22 207 1310 184 1834 133 787

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.miloss.fgsms.common.AesCbcWithIntegrity 298 20 3 36
org.miloss.fgsms.common.codec.Base64 188 26 0 27
org.miloss.fgsms.common.codec.BaseNCodec 135 24 1 25
org.miloss.fgsms.common.AES 128 11 0 4
org.miloss.fgsms.common.Logger 107 49 0 2
org.miloss.fgsms.common.codec.Hex 95 25 0 26
org.miloss.fgsms.common.codec.BinaryCodec 78 11 0 12
org.miloss.fgsms.common.codec.StringUtils 59 20 0 20
org.miloss.fgsms.common.Constants 47 0 1 1
org.miloss.fgsms.common.codec.CharSequenceUtils 17 1 0 2
org.miloss.fgsms.common.codec.StringEncoderComparator 14 3 0 4
org.miloss.fgsms.common.codec.Charsets 11 2 0 3
org.miloss.fgsms.common.codec.DecoderException 10 4 0 5
org.miloss.fgsms.common.codec.EncoderException 10 4 0 5
org.miloss.fgsms.tomcat.jdbcp.EncryptedConnectionFactory 10 1 0 1
org.miloss.fgsms.common.codec.CharEncoding 7 0 0 1
org.miloss.fgsms.common.codec.BinaryDecoder 2 1 0 1
org.miloss.fgsms.common.codec.BinaryEncoder 2 1 0 1
org.miloss.fgsms.common.codec.Decoder 2 1 0 2
org.miloss.fgsms.common.codec.Encoder 2 1 0 2
org.miloss.fgsms.common.codec.StringDecoder 2 1 0 2
org.miloss.fgsms.common.codec.StringEncoder 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.miloss.fgsms.common.Logger 107 49 0 2
org.miloss.fgsms.common.codec.Base64 188 26 0 27
org.miloss.fgsms.common.codec.Hex 95 25 0 26
org.miloss.fgsms.common.codec.BaseNCodec 135 24 1 25
org.miloss.fgsms.common.AesCbcWithIntegrity 298 20 3 36
org.miloss.fgsms.common.codec.StringUtils 59 20 0 20
org.miloss.fgsms.common.AES 128 11 0 4
org.miloss.fgsms.common.codec.BinaryCodec 78 11 0 12
org.miloss.fgsms.common.codec.DecoderException 10 4 0 5
org.miloss.fgsms.common.codec.EncoderException 10 4 0 5
org.miloss.fgsms.common.codec.StringEncoderComparator 14 3 0 4
org.miloss.fgsms.common.codec.Charsets 11 2 0 3
org.miloss.fgsms.common.codec.BinaryDecoder 2 1 0 1
org.miloss.fgsms.common.codec.BinaryEncoder 2 1 0 1
org.miloss.fgsms.common.codec.CharSequenceUtils 17 1 0 2
org.miloss.fgsms.common.codec.Decoder 2 1 0 2
org.miloss.fgsms.common.codec.Encoder 2 1 0 2
org.miloss.fgsms.common.codec.StringDecoder 2 1 0 2
org.miloss.fgsms.common.codec.StringEncoder 2 1 0 2
org.miloss.fgsms.tomcat.jdbcp.EncryptedConnectionFactory 10 1 0 1
org.miloss.fgsms.common.codec.CharEncoding 7 0 0 1
org.miloss.fgsms.common.Constants 47 0 1 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
55.73 1,310.00 0.23 9.41 8.36

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.miloss.fgsms.common.codec.Base64.encode(Override[],int,int,Context) 50 20 1
org.miloss.fgsms.common.codec.Base64.decode(Override[],int,int,Context) 36 16 1
org.miloss.fgsms.common.AES.getUrl(String) 32 14 0
org.miloss.fgsms.common.AES.loadKey() 30 12 0
org.miloss.fgsms.common.AesCbcWithIntegrity.PrngFixes.installLinuxPRNGSecureRandom() 26 16 1
org.miloss.fgsms.common.codec.Base64.Base64(int,int[],boolean) 18 7 1
org.miloss.fgsms.common.AES.readAllText(File) 17 9 0
org.miloss.fgsms.common.codec.CharSequenceUtils.regionMatches(CharSequence,boolean,int,CharSequence,int,int) 16 11 1
org.miloss.fgsms.common.AesCbcWithIntegrity.CipherTextIvMac.equals(Object) 15 13 0
org.miloss.fgsms.common.codec.Base64.toIntegerBytes(BigInteger) 15 5 1
org.miloss.fgsms.common.AES.readAllText(InputStream) 14 5 0
org.miloss.fgsms.common.AesCbcWithIntegrity.keys(String) 13 7 1
org.miloss.fgsms.common.AesCbcWithIntegrity.SecretKeys.equals(Object) 13 11 0
org.miloss.fgsms.common.AesCbcWithIntegrity.PrngFixes.LinuxPRNGSecureRandom.engineSetSeed(Override[]) 13 4 0
org.miloss.fgsms.common.codec.Hex.decode(Object) 13 10 1
org.miloss.fgsms.common.codec.Hex.decodeHex(data.toCharArray[][]) 12 4 1
org.miloss.fgsms.common.codec.Hex.encode(Object) 12 5 1
org.miloss.fgsms.common.codec.BinaryCodec.toAsciiBytes(array.length[][]) 11 6 1
org.miloss.fgsms.common.codec.BinaryCodec.toAsciiChars(l_ascii[][]) 11 6 1
org.miloss.fgsms.common.AesCbcWithIntegrity.generateKeyFromPassword(String,String[]) 10 1 1
org.miloss.fgsms.common.AesCbcWithIntegrity.PrngFixes.LinuxPRNGSecureRandom.engineNextBytes(Override[]) 10 4 0
org.miloss.fgsms.common.codec.BaseNCodec.resizeBuffer(Context) 10 2 1
org.miloss.fgsms.common.codec.BinaryCodec.decode(Object) 10 10 1
org.miloss.fgsms.common.AesCbcWithIntegrity.encrypt(CipherTextIvMac[],SecretKeys) 9 1 1
org.miloss.fgsms.common.AesCbcWithIntegrity.decrypt(CipherTextIvMac,SecretKeys) 9 4 1
org.miloss.fgsms.common.AesCbcWithIntegrity.PrngFixes.generateSeed() 9 4 1
org.miloss.fgsms.common.codec.BaseNCodec.readResults(int[],int,int,Context) 9 5 1
org.miloss.fgsms.common.codec.BaseNCodec.isWhiteSpace(byte) 9 6 1
org.miloss.fgsms.common.codec.BaseNCodec.decode(Override[][]) 9 4 1
org.miloss.fgsms.common.codec.BaseNCodec.encode(pArray.length[][],int,int) 9 4 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,310.00 4.45 2.34 0.66

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