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
net.sf.logdistiller 44 295 1403 94 481 20 255
net.sf.logdistiller.gui 14 84 732 11 45 15 111
net.sf.logdistiller.logtypes 25 60 474 13 84 12 97
net.sf.logdistiller.util 7 42 457 14 80 22 112
net.sf.logdistiller.xml 6 48 404 4 19 9 52
net.sf.logdistiller.plugins 11 35 274 10 81 9 51
net.sf.logdistiller.reports 5 27 252 3 13 5 39
net.sf.logdistiller.ant 5 35 240 8 50 2 52
net.sf.logdistiller.publishers 5 20 209 8 80 13 65
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
122 646 4445 165 933 107 834

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
net.sf.logdistiller.gui.MainPanel 326 30 1 4
net.sf.logdistiller.LogDistillation 303 26 3 16
net.sf.logdistiller.LogDistiller 301 16 6 15
net.sf.logdistiller.xml.DOMConfigurator 245 31 0 2
net.sf.logdistiller.util.UncompressInputStream 224 9 0 3
net.sf.logdistiller.plugins.FreqPlugin 205 17 7 8
net.sf.logdistiller.ant.LogDistillerTask 167 14 1 4
net.sf.logdistiller.gui.NewDialog 122 13 0 3
net.sf.logdistiller.reports.TextReport 113 7 1 1
net.sf.logdistiller.LogEvent 106 13 2 11
net.sf.logdistiller.reports.XmlReport 104 7 1 1
net.sf.logdistiller.logtypes.WeblogicLogEvent 104 2 3 5
net.sf.logdistiller.Match 96 3 6 2
net.sf.logdistiller.logtypes.Log4jXmlLogEvent 96 3 2 1
net.sf.logdistiller.xml.DOMUtils 90 7 1 2
net.sf.logdistiller.LogDistillation.Group 82 18 0 2
net.sf.logdistiller.publishers.FeedPublisher 76 6 0 4
net.sf.logdistiller.LogType 74 3 3 13
net.sf.logdistiller.LogDistiller.Group 70 15 0 2
net.sf.logdistiller.FactoryMultiplexer 68 6 3 5
net.sf.logdistiller.logtypes.JBossLogEvent 67 2 2 2
net.sf.logdistiller.util.FormatUtil 66 9 0 1
net.sf.logdistiller.gui.SwingAdapter 66 4 4 0
net.sf.logdistiller.LogEventTestCase 63 9 0 7
net.sf.logdistiller.gui.SimpleLayoutConstraintsManager 62 7 1 1
net.sf.logdistiller.publishers.MailPublisher 56 5 0 1
net.sf.logdistiller.logtypes.OracleAlertLogEvent 54 2 2 2
net.sf.logdistiller.LogDistiller.Output 52 16 0 1
net.sf.logdistiller.logtypes.SyslogLogEvent 52 1 2 1
net.sf.logdistiller.util.BufferingReader 51 11 0 6

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
net.sf.logdistiller.xml.DOMConfigurator 245 31 0 2
net.sf.logdistiller.gui.MainPanel 326 30 1 4
net.sf.logdistiller.LogDistillation 303 26 3 16
net.sf.logdistiller.LogDistillation.Group 82 18 0 2
net.sf.logdistiller.plugins.FreqPlugin 205 17 7 8
net.sf.logdistiller.LogDistiller 301 16 6 15
net.sf.logdistiller.LogDistiller.Output 52 16 0 1
net.sf.logdistiller.LogDistiller.Group 70 15 0 2
net.sf.logdistiller.ant.LogDistillerTask 167 14 1 4
net.sf.logdistiller.LogType.Description 45 14 0 9
net.sf.logdistiller.LogEvent 106 13 2 11
net.sf.logdistiller.gui.SimpleContainerLayout 43 13 0 1
net.sf.logdistiller.gui.NewDialog 122 13 0 3
net.sf.logdistiller.util.BufferingReader 51 11 0 6
net.sf.logdistiller.LogDistillation.Category 41 11 0 0
net.sf.logdistiller.LogDistillation.Plugin 21 11 0 6
net.sf.logdistiller.LogDistiller.Report 32 10 0 0
net.sf.logdistiller.util.FormatUtil 66 9 0 1
net.sf.logdistiller.util.UncompressInputStream 224 9 0 3
net.sf.logdistiller.LogEventTestCase 63 9 0 7
net.sf.logdistiller.LogDistiller.Plugin 29 9 0 0
net.sf.logdistiller.ReportFormat 36 8 1 1
net.sf.logdistiller.ant.AntLogEvent 25 8 0 2
net.sf.logdistiller.LogDistiller.LogType 24 8 0 3
net.sf.logdistiller.xml.DOMUtils 90 7 1 2
net.sf.logdistiller.reports.TextReport 113 7 1 1
net.sf.logdistiller.reports.XmlReport 104 7 1 1
net.sf.logdistiller.Plugins 38 7 0 5
net.sf.logdistiller.ant.AntLogDistillation 17 7 0 1
net.sf.logdistiller.LogDistiller.Category 22 7 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
41.64 4,445.00 0.52 5.30 1.60

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
net.sf.logdistiller.util.UncompressInputStream.read(int[],int,int) 110 28 0
net.sf.logdistiller.reports.TextReport.report(LogDistillation.Group,Writer) 43 10 0
net.sf.logdistiller.gui.MainPanel.selectConfigurationFile(File) 41 9 0
net.sf.logdistiller.util.UncompressInputStream.parse_header() 38 18 0
net.sf.logdistiller.logtypes.Log4jXmlLogEvent.Log4jXmlLogEvent(LogEvent.Factory,String) 37 4 0
net.sf.logdistiller.plugins.FreqPlugin.FreqPlugin(LogDistiller.Plugin,boolean) 36 13 0
net.sf.logdistiller.reports.TextReport.report(LogDistillation,Writer) 35 9 0
net.sf.logdistiller.gui.MainPanel.runLogDistillation() 35 6 0
net.sf.logdistiller.plugins.FreqPlugin.oldComputeValue(LogEvent) 34 14 1
net.sf.logdistiller.ant.LogDistillerTask.compatibilityUpdate(LogDistiller) 33 9 1
net.sf.logdistiller.ant.LogDistillerTask.addFile(File,LogType.Description,FactoryMultiplexer) 32 6 0
net.sf.logdistiller.publishers.MailPublisher.sendMail(LogDistillation,LogDistiller.Report,String,String,String,File) 30 9 0
net.sf.logdistiller.ant.LogDistillerTask.execute() 30 10 0
net.sf.logdistiller.xml.DOMUtils.getNodeTypeAsString(Node) 29 25 0
net.sf.logdistiller.reports.XmlReport.report(LogDistillation,Writer) 29 6 0
net.sf.logdistiller.reports.XmlReport.report(LogDistillation.Group,Writer) 29 6 0
net.sf.logdistiller.gui.SimpleLayoutConstraintsManager.getLayoutConstraintsManager(Element) 29 5 0
net.sf.logdistiller.util.FormatUtil.formatPeriod(long) 28 14 0
net.sf.logdistiller.gui.NewDialog.generateConfiguration(PrintWriter) 28 4 1
net.sf.logdistiller.publishers.FeedPublisher.addEntry(SyndEntry,LogDistillation,LogDistiller.Report) 26 8 1
net.sf.logdistiller.gui.MainPanel.buildPanel() 26 1 0
net.sf.logdistiller.xml.DOMConfigurator.parse(Element) 24 5 0
net.sf.logdistiller.LogDistillation.updateRef() 22 6 1
net.sf.logdistiller.xml.DOMUtils.getPCDATA(Element,boolean) 21 8 1
net.sf.logdistiller.logtypes.SyslogLogEvent.SyslogLogEvent(LogEvent.Factory,String) 21 4 0
net.sf.logdistiller.gui.MainPanel.buildMenuBar() 21 1 0
net.sf.logdistiller.gui.NewDialog.buildPanel() 21 1 0
net.sf.logdistiller.LogDistillation.LogDistillation(LogDistiller) 20 4 0
net.sf.logdistiller.xml.DOMConfigurator.read(InputSource,ErrorHandler) 18 5 0
net.sf.logdistiller.xml.DOMConfigurator.parseGroup(Element,LogDistiller.Category) 18 4 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
4,445.00 5.29 2.13 0.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 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).