JavaNCSS Metric Results

[ packages] [ objects] [ functions] [ explanations]

The following document contains the results of a JavaNCSSmetric analysis.

Packages

[ packages] [ objects] [ functions] [ explanations]

Packages sorted by NCSS

PackageClassesFunctions NCSS JavadocsJavadoc LinesSingle Comment LinesMulti Comment Lines
org.zilverline.core1320414102101404141300
org.zilverline.web27113105710556697547
org.zilverline.util8517633925068183
org.zilverline.service611363711564196157
org.zilverline.extractors9335054223826184
org.zilverline.dao.xstream4151631891180
org.zilverline.lucene26827651042
org.zilverline.dao48221269083
Classes totalFunctions total NCSS total JavadocsJavadoc LinesSingle Comment LinesMulti Comment Lines
73543463954833244391576

Objects

[ packages] [ objects] [ functions] [ explanations]

TOP 30 classes containing the most NCSS

Object NCSS FunctionsClassesJavadocs
org.zilverline.core.IMAPCollection29920018
org.zilverline.service.CollectionManagerImpl28637038
org.zilverline.util.SysUtils268403
org.zilverline.core.FileSystemCollection26211012
org.zilverline.core.AbstractCollection25547147
org.zilverline.util.ClassFinder20623111
org.zilverline.service.SearchServiceImpl17717017
org.zilverline.util.FileUtils138809
org.zilverline.core.ExtractorFactory12916014
org.zilverline.core.Result10231032
org.zilverline.extractors.AbstractExtractor7813014
org.zilverline.web.RequestDumperFilter74405
org.zilverline.core.IndexCommand7323024
org.zilverline.extractors.HTMLExtractor68506
org.zilverline.web.UploadForm66503
org.zilverline.web.SearchController65907
org.zilverline.core.ParsedFileInfo6321022
org.zilverline.extractors.PDFExtractor63203
org.zilverline.extractors.ExcelExtractor60203
org.zilverline.web.SearchDefaultsController59607
org.zilverline.web.CustomCollectionEditor50501
org.zilverline.core.Handler45809
org.zilverline.lucene.BoostingParser44303
org.zilverline.web.HandlersController44202
org.zilverline.dao.xstream.CollectionManagerXStreamDAOImpl43404
org.zilverline.web.CacheController43405
org.zilverline.web.ExtractorMappingsController42201
org.zilverline.util.StopWatch40304
org.zilverline.web.SearchForm3813014
org.zilverline.service.IndexServiceImpl379010

TOP 30 classes containing the most functions

ObjectNCSS Functions ClassesJavadocs
org.zilverline.core.AbstractCollection25547147
org.zilverline.service.CollectionManagerImpl28637038
org.zilverline.service.CollectionManager3433032
org.zilverline.core.Result10231032
org.zilverline.core.IndexCommand7323024
org.zilverline.util.ClassFinder20623111
org.zilverline.core.ParsedFileInfo6321022
org.zilverline.core.IMAPCollection29920018
org.zilverline.service.SearchServiceImpl17717017
org.zilverline.core.DocumentCollection1716017
org.zilverline.core.ExtractorFactory12916014
org.zilverline.service.SearchService1514014
org.zilverline.extractors.AbstractExtractor7813014
org.zilverline.web.SearchForm3813014
org.zilverline.core.FileSystemCollection26211012
org.zilverline.service.IndexServiceImpl379010
org.zilverline.web.SearchController65907
org.zilverline.core.Handler45809
org.zilverline.util.FileUtils138809
org.zilverline.web.ZilverController34708
org.zilverline.util.About17602
org.zilverline.web.DocumentFromCacheForm16607
org.zilverline.web.SearchDefaultsController59607
org.zilverline.web.UploadCommand16601
org.zilverline.core.SearchResult18506
org.zilverline.dao.xstream.AbstractXStreamDAOImpl22506
org.zilverline.extractors.HTMLExtractor68506
org.zilverline.web.CollectionTriple16505
org.zilverline.web.CustomCollectionEditor50501
org.zilverline.web.UploadForm66503

Averages

NCSS average Program NCSSClasses averageFunctions averageJavadocs average
54.424,639.000.037.447.51

Functions

[ packages] [ objects] [ functions] [ explanations]

TOP 30 functions containing the most NCSS

Function NCSS CCNJavadoc
org.zilverline.service.SearchServiceImpl.doc2ResultHelper(Document,float,Highlighter,Analyzer)67131
org.zilverline.web.RequestDumperFilter.doFilter(ServletRequest,ServletResponse,FilterChain)60121
org.zilverline.core.IMAPCollection.doIndex(boolean)55191
org.zilverline.core.IMAPCollection.indexMessage(Document,Message)48141
org.zilverline.extractors.PDFExtractor.getContent(File)44121
org.zilverline.service.CollectionManagerImpl.unZip(File,FileSystemCollection)44101
org.zilverline.util.SysUtils.execute(String,File,File)4481
org.zilverline.web.SearchDefaultsController.onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)44111
org.zilverline.core.FileSystemCollection.indexArchive(IndexCommand,String)43121
org.zilverline.core.FileSystemCollection.index(boolean)42111
org.zilverline.web.HandlersController.onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)4190
org.zilverline.util.FileUtils.removeDir(File)40121
org.zilverline.core.FileSystemCollection.indexFile(File)39111
org.zilverline.web.ExtractorMappingsController.onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)3990
org.zilverline.core.IMAPCollection.indexFolder(IndexWriter,Folder)38130
org.zilverline.core.AbstractCollection.init()37111
org.zilverline.core.IMAPCollection.indexPart(Document,Part)37131
org.zilverline.util.FileUtils.getMD5Hash(File)37141
org.zilverline.service.SearchServiceImpl.doSearch(String[],String,int,int)36121
org.zilverline.lucene.BoostingParser.getFieldQuery(String,Analyzer,String)35111
org.zilverline.web.CacheController.onSubmit(Object)3591
org.zilverline.web.CustomCollectionEditor.setValue(Object)35120
org.zilverline.core.FileSystemCollection.parse(IndexCommand)3491
org.zilverline.core.FileSystemCollection.indexStraightFile(IndexCommand)33131
org.zilverline.util.StopWatch.elapsedTime()3381
org.zilverline.web.SearchController.onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)3381
org.zilverline.extractors.AbstractExtractor.extractInfo(File)32131
org.zilverline.extractors.ExcelExtractor.getContent(File)31101
org.zilverline.service.CollectionManagerImpl.expandArchive(FileSystemCollection,File)31101
org.zilverline.web.HandlerValidator.validate(Object,Errors)3161
Program NCSS: NCSS average CCN averageJavadocs average
4,639.006.442.380.87

Explanations

[ packages] [ objects] [ functions] [ explanations]

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.

Actually, the NCSS counter gets incremented by one for each:

 ExamplesComment
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;
No matter how many fields get actually declared through a comma separated list, and no matter if these fields get actually initialized, only one statement is counted. So "int a, b, c = 5, d = 6;" gets only +1 count, not four or even six (let me know if there is good reason to count it differently).
Method declaration- public void cry();

- public void gib() throws DeadException {
 
Constructor declarationpublic Foo() { 
Constructor invocation- this();

- super();
 
Statement- 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
Labelfine :normal, case, default

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.

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:
  • return
  • throw

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