JavaNCSS Metric Results

[ package ] [ object ] [ function ] [ explanation ]

The following document contains the results of a JavaNCSS metric analysis.
JavaNCSS web site.

Packages

[ package ] [ object ] [ function ] [ explanation ]

Packages sorted by NCSS.

PackageClassesFunctionsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
net.sf.hermesftp.cmd.impl4014296017013622898
net.sf.hermesftp.cmd14997091085567337
net.sf.hermesftp.streams1160442633240254
net.sf.hermesftp.console956415532590201
net.sf.hermesftp.utils939386472773211
net.sf.hermesftp.session.impl256334511661363
net.sf.hermesftp.usermanager.impl2232551977045
net.sf.hermesftp.common666214693660286
net.sf.hermesftp.usermanager.model534173382100113
net.sf.hermesftp.server23916839167049
net.sf.hermesftp.parser.impl22516718741044
net.sf.hermesftp.server.impl3231512585066
net.sf.hermesftp.exception1338119512180286
net.sf.hermesftp1689313028
net.sf.hermesftp.parser29201052049
net.sf.hermesftp.usermanager111201280022
net.sf.hermesftp.session1610731022
Classes totalFunctions totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
12373246327834317352974

Objects

[ package ] [ object ] [ function ] [ explanation ]

TOP 30 classes containing the most NCSS.

ObjectNCSSFunctionsClassesJavadocs
net.sf.hermesftp.session.impl.FtpSessionContextImpl20744043
net.sf.hermesftp.server.AbstractFtpServer13029028
net.sf.hermesftp.cmd.AbstractFtpCmdStor12215016
net.sf.hermesftp.common.FtpConstants119001
net.sf.hermesftp.usermanager.impl.XmlFileReader119705
net.sf.hermesftp.parser.impl.FtpCmdReaderThread11019011
net.sf.hermesftp.cmd.AbstractFtpCmdRetr10814013
net.sf.hermesftp.usermanager.impl.XmlFileUserManager9416014
net.sf.hermesftp.server.impl.FtpServerOptionsImpl8818019
net.sf.hermesftp.session.impl.FtpSessionImpl821208
net.sf.hermesftp.streams.BlockModeInputStream76706
net.sf.hermesftp.streams.RecordInputStream74707
net.sf.hermesftp.console.SessionsServlet72906
net.sf.hermesftp.cmd.PassiveModeSocketProvider71707
net.sf.hermesftp.FtpServerApp70603
net.sf.hermesftp.utils.IOUtils67506
net.sf.hermesftp.console.AbstractConsoleServlet6616016
net.sf.hermesftp.cmd.AbstractFtpCmdStorFile63505
net.sf.hermesftp.cmd.AbstractFtpCmd6219020
net.sf.hermesftp.console.ConsoleServerImpl6212012
net.sf.hermesftp.console.UserServlet60704
net.sf.hermesftp.cmd.impl.FtpCmdRetr57707
net.sf.hermesftp.utils.SecurityUtil56505
net.sf.hermesftp.utils.NetUtils52506
net.sf.hermesftp.cmd.impl.FtpCmdAuth47707
net.sf.hermesftp.streams.BlockModeOutputStream47808
net.sf.hermesftp.utils.VarMerger45607
net.sf.hermesftp.streams.TextInputStream43506
net.sf.hermesftp.common.FtpSessionContext4241042
net.sf.hermesftp.cmd.ActiveModeSocketProvider41606

TOP 30 classes containing the most functions.

ObjectNCSSFunctionsClassesJavadocs
net.sf.hermesftp.session.impl.FtpSessionContextImpl20744043
net.sf.hermesftp.common.FtpSessionContext4241042
net.sf.hermesftp.server.AbstractFtpServer13029028
net.sf.hermesftp.cmd.AbstractFtpCmd6219020
net.sf.hermesftp.parser.impl.FtpCmdReaderThread11019011
net.sf.hermesftp.common.FtpServerOptions1918016
net.sf.hermesftp.server.impl.FtpServerOptionsImpl8818019
net.sf.hermesftp.console.AbstractConsoleServlet6616016
net.sf.hermesftp.usermanager.impl.XmlFileUserManager9416014
net.sf.hermesftp.cmd.AbstractFtpCmdStor12215016
net.sf.hermesftp.cmd.AbstractFtpCmdRetr10814013
net.sf.hermesftp.usermanager.model.UserData3513014
net.sf.hermesftp.console.ConsoleServerImpl6212012
net.sf.hermesftp.session.impl.FtpSessionImpl821208
net.sf.hermesftp.usermanager.UserManager1211012
net.sf.hermesftp.server.FtpServer1110011
net.sf.hermesftp.console.SessionsServlet72906
net.sf.hermesftp.streams.RafOutputStream37909
net.sf.hermesftp.cmd.DataChannelInfo23809
net.sf.hermesftp.cmd.FtpCmd9809
net.sf.hermesftp.streams.BlockModeOutputStream47808
net.sf.hermesftp.streams.RafInputStream31808
net.sf.hermesftp.cmd.impl.FtpCmdAuth47707
net.sf.hermesftp.cmd.impl.FtpCmdRetr57707
net.sf.hermesftp.cmd.PassiveModeSocketProvider71707
net.sf.hermesftp.console.UserServlet60704
net.sf.hermesftp.streams.BlockModeInputStream76706
net.sf.hermesftp.streams.RecordInputStream74707
net.sf.hermesftp.streams.RecordOutputStream36707
net.sf.hermesftp.usermanager.impl.XmlFileReader119705
Averages.
NCSS averageProgram NCSSClasses averageFunctions averageJavadocs average
31.514,632.000.005.956.37

Functions

[ package ] [ object ] [ function ] [ explanation ]

TOP 30 functions containing the most NCSS.

FunctionsNCSSCCNJavadocs
net.sf.hermesftp.cmd.AbstractFtpCmdStor.execute(boolean)42111
net.sf.hermesftp.cmd.AbstractFtpCmdRetr.execute()39111
net.sf.hermesftp.server.AbstractFtpServer.run()3351
net.sf.hermesftp.cmd.impl.FtpCmdMdtm.execute()32111
net.sf.hermesftp.FtpServerApp.startServer(String[])32100
net.sf.hermesftp.cmd.AbstractFtpCmdList.execute()3181
net.sf.hermesftp.streams.BlockModeInputStream.read()29101
net.sf.hermesftp.usermanager.impl.XmlFileReader.processGroupData(Document,UserManagerData)2760
net.sf.hermesftp.session.impl.FtpSessionImpl.run()2661
net.sf.hermesftp.usermanager.impl.XmlFileReader.processUserData(Document,UserManagerData)2660
net.sf.hermesftp.utils.SecurityUtil.createSslContext(String,char[])24151
net.sf.hermesftp.streams.RecordInputStream.readRecord()23101
net.sf.hermesftp.utils.IOUtils.formatUnixFtpFileInfo(File,boolean,boolean)2141
net.sf.hermesftp.cmd.AbstractFtpCmdStorFile.doStoreFileData(InputStream,File,long)2041
net.sf.hermesftp.cmd.impl.FtpCmdMode.execute()2051
net.sf.hermesftp.cmd.impl.FtpCmdRnto.execute()2091
net.sf.hermesftp.cmd.impl.FtpCmdStat.execute()2061
net.sf.hermesftp.cmd.PassiveModeSocketProvider.init()2091
net.sf.hermesftp.session.impl.FtpSessionContextImpl.authenticate()2051
net.sf.hermesftp.utils.NetUtils.checkIPMatch(String,String)2091
net.sf.hermesftp.cmd.impl.FtpCmdAuth.execute()1961
net.sf.hermesftp.cmd.impl.FtpCmdRetr.doRetrieveFileData(OutputStream,File,long)1941
net.sf.hermesftp.parser.impl.FtpCmdReaderThread.waitForNextCommand(int)1991
net.sf.hermesftp.cmd.AbstractFtpCmdStorFile.doStoreRecordData(RecordReadSupport,File,long)1841
net.sf.hermesftp.cmd.impl.FtpCmdProt.execute()1871
net.sf.hermesftp.cmd.impl.FtpCmdRetr.doRetrieveRecordData(RecordWriteSupport,File,long)1841
net.sf.hermesftp.streams.TextInputStream.read()1861
net.sf.hermesftp.usermanager.impl.XmlFileReader.read()1861
net.sf.hermesftp.cmd.AbstractFtpCmdPort.execute()1751
net.sf.hermesftp.console.ConsolePassword.check(Object)17101

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
4,632.004.591.860.90

Explanations

[ package ] [ object ] [ function ] [ 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.

ExamplesComments
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 {
expression, if, else, while, do, for, switch, break, continue, return, throw, synchronized, catch, finally
Label declarationfine :normal, case, default
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 (no matter if it's a function or a procedure) will not be counted.Note that else, default, and finallydon't increment the CCN value any further. On the other hand, a simple method with a switchstatement and a huge block of casestatements can have a surprisingly high CCN value (still it has the same value when converting a switchblock to an equivalent sequence of ifstatements).The first article about this trivial software metric is one of the most cited papers in computer science. Sometimes you just must be the first to point out some basic shit and you are history. It seems just like a wonder that nobody was able to package Lines of Code in a more scientific manner. Now it's too late to label someone's name on it :).