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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
net.sf.logdistiller4429514369447820262
net.sf.logdistiller.gui1484732114515111
net.sf.logdistiller.logtypes205545213841297
net.sf.logdistiller.util63944113752299
net.sf.logdistiller.xml649406419952
net.sf.logdistiller.plugins113426810811051
net.sf.logdistiller.reports527268313439
net.sf.logdistiller.ant535242850252
net.sf.logdistiller.publishers5202098801365
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
1166384454164925107828

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
net.sf.logdistiller.gui.MainPanel3263014
net.sf.logdistiller.LogDistillation31126316
net.sf.logdistiller.LogDistiller30316615
net.sf.logdistiller.xml.DOMConfigurator2463102
net.sf.logdistiller.util.UncompressInputStream224903
net.sf.logdistiller.plugins.FreqPlugin2031778
net.sf.logdistiller.ant.LogDistillerTask1691414
net.sf.logdistiller.gui.NewDialog1221303
net.sf.logdistiller.reports.TextReport120711
net.sf.logdistiller.reports.XmlReport111711
net.sf.logdistiller.LogEvent10613211
net.sf.logdistiller.logtypes.WeblogicLogEvent100235
net.sf.logdistiller.Match96362
net.sf.logdistiller.logtypes.Log4jXmlLogEvent92321
net.sf.logdistiller.xml.DOMUtils92712
net.sf.logdistiller.LogDistillation.Group821802
net.sf.logdistiller.publishers.FeedPublisher76604
net.sf.logdistiller.LogType753313
net.sf.logdistiller.FactoryMultiplexer74635
net.sf.logdistiller.LogDistiller.Group701502
net.sf.logdistiller.gui.SwingAdapter66440
net.sf.logdistiller.util.FormatUtil66901
net.sf.logdistiller.logtypes.JBossLogEvent63222
net.sf.logdistiller.LogEventTestCase63907
net.sf.logdistiller.gui.SimpleLayoutConstraintsManager61711
net.sf.logdistiller.publishers.MailPublisher56501
net.sf.logdistiller.LogDistiller.Output521601
net.sf.logdistiller.logtypes.SyslogLogEvent51121
net.sf.logdistiller.util.BufferingReader511106
net.sf.logdistiller.logtypes.OracleAlertLogEvent50222

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
net.sf.logdistiller.xml.DOMConfigurator2463102
net.sf.logdistiller.gui.MainPanel3263014
net.sf.logdistiller.LogDistillation31126316
net.sf.logdistiller.LogDistillation.Group821802
net.sf.logdistiller.plugins.FreqPlugin2031778
net.sf.logdistiller.LogDistiller30316615
net.sf.logdistiller.LogDistiller.Output521601
net.sf.logdistiller.LogDistiller.Group701502
net.sf.logdistiller.ant.LogDistillerTask1691414
net.sf.logdistiller.LogType.Description461409
net.sf.logdistiller.gui.SimpleContainerLayout431301
net.sf.logdistiller.gui.NewDialog1221303
net.sf.logdistiller.LogEvent10613211
net.sf.logdistiller.LogDistillation.Category491100
net.sf.logdistiller.LogDistillation.Plugin211106
net.sf.logdistiller.util.BufferingReader511106
net.sf.logdistiller.LogDistiller.Report321000
net.sf.logdistiller.util.FormatUtil66901
net.sf.logdistiller.util.UncompressInputStream224903
net.sf.logdistiller.LogEventTestCase63907
net.sf.logdistiller.LogDistiller.Plugin29900
net.sf.logdistiller.ReportFormat36811
net.sf.logdistiller.ant.AntLogEvent25802
net.sf.logdistiller.LogDistiller.LogType24803
net.sf.logdistiller.logtypes.WeblogicLogEvent.Description21703
net.sf.logdistiller.xml.DOMUtils92712
net.sf.logdistiller.gui.SimpleLayoutConstraintsManager61711
net.sf.logdistiller.ant.AntLogDistillation17701
net.sf.logdistiller.Plugins42705
net.sf.logdistiller.reports.XmlReport111711

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
43.844,454.000.505.501.67

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
net.sf.logdistiller.util.UncompressInputStream.read(int[],int,int)110280
net.sf.logdistiller.reports.TextReport.report(LogDistillation.Group,Writer)43100
net.sf.logdistiller.reports.TextReport.report(LogDistillation,Writer)4290
net.sf.logdistiller.gui.MainPanel.selectConfigurationFile(File)4190
net.sf.logdistiller.util.UncompressInputStream.parse_header()38180
net.sf.logdistiller.logtypes.Log4jXmlLogEvent.Log4jXmlLogEvent(Factory,String)3740
net.sf.logdistiller.gui.MainPanel.runLogDistillation()3560
net.sf.logdistiller.plugins.FreqPlugin.oldComputeValue(LogEvent)34141
net.sf.logdistiller.reports.XmlReport.report(LogDistillation,Writer)3460
net.sf.logdistiller.ant.LogDistillerTask.compatibilityUpdate(LogDistiller)3391
net.sf.logdistiller.ant.LogDistillerTask.addFile(File,LogType.Description,FactoryMultiplexer)3260
net.sf.logdistiller.publishers.MailPublisher.sendMail(LogDistillation,LogDistiller.Report,String,String,String,File)3090
net.sf.logdistiller.ant.LogDistillerTask.execute()30100
net.sf.logdistiller.xml.DOMUtils.getNodeTypeAsString(Node)29250
net.sf.logdistiller.gui.SimpleLayoutConstraintsManager.getLayoutConstraintsManager(Element)2950
net.sf.logdistiller.plugins.FreqPlugin.FreqPlugin(LogDistiller.Plugin,boolean)29110
net.sf.logdistiller.reports.XmlReport.report(LogDistillation.Group,Writer)2960
net.sf.logdistiller.gui.NewDialog.generateConfiguration(PrintWriter)2841
net.sf.logdistiller.util.FormatUtil.formatPeriod(long)28140
net.sf.logdistiller.gui.MainPanel.buildPanel()2610
net.sf.logdistiller.publishers.FeedPublisher.addEntry(SyndEntry,LogDistillation,LogDistiller.Report)2681
net.sf.logdistiller.xml.DOMConfigurator.parse(Element)2450
net.sf.logdistiller.LogDistillation.updateRef()2261
net.sf.logdistiller.logtypes.SyslogLogEvent.SyslogLogEvent(Factory,String)2140
net.sf.logdistiller.xml.DOMUtils.getPCDATA(Element,boolean)2181
net.sf.logdistiller.gui.NewDialog.buildPanel()2110
net.sf.logdistiller.gui.MainPanel.buildMenuBar()2110
net.sf.logdistiller.FactoryMultiplexer.init()2061
net.sf.logdistiller.LogDistillation.LogDistillation(LogDistiller)2040
net.sf.logdistiller.logtypes.WeblogicLogEvent.WeblogicLogEvent(Factory,String)1820

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
4,454.005.382.130.15

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 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 {
Label declarationfine :

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