JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis.
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
org.astrogrid.applications.uws 12 78 1090 15 106 74 599
org.astrogrid.applications.commandline.hyperz 3 10 274 11 49 26 65
org.jdesktop.swingworker 3 31 216 33 636 7 84
org.astrogrid.applications.chiba 3 4 199 4 21 21 82
org.astrogrid.applications.commandline.sextractor 3 10 165 7 37 21 46
org.astrogrid.applications.docs 1 2 74 1 6 0 20
org.astrogrid.applications.vosi 1 7 68 5 25 7 10
org.astrogrid.applications.commandline.dft 1 3 40 2 16 1 23
org.astrogrid.applications.common.io 1 3 34 3 17 4 12
org.astrogrid.applications.commandline 1 2 25 3 13 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
29 150 2185 84 926 161 941

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.astrogrid.applications.uws.UWSController 258 24 1 1
org.jdesktop.swingworker.SwingWorker 160 22 10 23
org.astrogrid.applications.commandline.hyperz.HyperZVOTableWriter 129 4 1 5
org.astrogrid.applications.uws.InitServlet 115 7 0 2
org.astrogrid.applications.uws.MetaDataController 87 10 1 0
org.astrogrid.applications.uws.AbstractAccessProtocolController 82 7 0 3
org.astrogrid.applications.uws.AbstractMetadataController 74 6 1 1
org.astrogrid.applications.commandline.hyperz.HyperZVOTableReader 65 4 0 2
org.astrogrid.applications.commandline.sextractor.ASCII2VOTableConverter 61 3 0 3
org.astrogrid.applications.uws.JobCreationController 61 3 1 0
org.astrogrid.applications.chiba.XformsFilter 56 1 0 2
org.astrogrid.applications.chiba.SubmissionResponseServlet 50 1 0 1
org.astrogrid.applications.vosi.VosiServlet 49 7 0 5
org.astrogrid.applications.docs.DocServlet 46 2 0 1
org.astrogrid.applications.uws.UWSUtils 44 6 0 3
org.astrogrid.applications.chiba.RedirectingHttpSubmissionHandler 39 2 0 1
org.astrogrid.applications.commandline.sextractor.OutputParams 38 3 0 2
org.astrogrid.applications.uws.AppDefinitionController 33 4 0 0
org.astrogrid.applications.uws.SyncJobCreationController 32 3 0 0
org.astrogrid.applications.common.io.StreamPiperold 28 3 0 3
org.astrogrid.applications.commandline.sextractor.SExtractor 23 4 0 2
org.astrogrid.applications.commandline.hyperz.HyperZ 22 2 1 4
org.astrogrid.applications.commandline.dft.Dft 21 3 0 2
org.jdesktop.swingworker.SwingPropertyChangeSupport 19 4 1 4
org.jdesktop.swingworker.AccumulativeRunnable 19 5 0 6
org.astrogrid.applications.uws.LifecycleListener 18 4 0 5
org.astrogrid.applications.uws.SiapController 18 2 0 0
org.astrogrid.applications.commandline.AbortionServlet 13 2 0 3
org.astrogrid.applications.uws.AppJobCreationController 10 2 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.astrogrid.applications.uws.UWSController 258 24 1 1
org.jdesktop.swingworker.SwingWorker 160 22 10 23
org.astrogrid.applications.uws.MetaDataController 87 10 1 0
org.astrogrid.applications.uws.AbstractAccessProtocolController 82 7 0 3
org.astrogrid.applications.uws.InitServlet 115 7 0 2
org.astrogrid.applications.vosi.VosiServlet 49 7 0 5
org.astrogrid.applications.uws.UWSUtils 44 6 0 3
org.astrogrid.applications.uws.AbstractMetadataController 74 6 1 1
org.jdesktop.swingworker.AccumulativeRunnable 19 5 0 6
org.jdesktop.swingworker.SwingPropertyChangeSupport 19 4 1 4
org.astrogrid.applications.commandline.sextractor.SExtractor 23 4 0 2
org.astrogrid.applications.commandline.hyperz.HyperZVOTableReader 65 4 0 2
org.astrogrid.applications.commandline.hyperz.HyperZVOTableWriter 129 4 1 5
org.astrogrid.applications.uws.LifecycleListener 18 4 0 5
org.astrogrid.applications.uws.AppDefinitionController 33 4 0 0
org.astrogrid.applications.common.io.StreamPiperold 28 3 0 3
org.astrogrid.applications.commandline.dft.Dft 21 3 0 2
org.astrogrid.applications.commandline.sextractor.ASCII2VOTableConverter 61 3 0 3
org.astrogrid.applications.commandline.sextractor.OutputParams 38 3 0 2
org.astrogrid.applications.uws.JobCreationController 61 3 1 0
org.astrogrid.applications.uws.SyncJobCreationController 32 3 0 0
org.astrogrid.applications.docs.DocServlet 46 2 0 1
org.astrogrid.applications.commandline.AbortionServlet 13 2 0 3
org.astrogrid.applications.commandline.hyperz.HyperZ 22 2 1 4
org.astrogrid.applications.chiba.RedirectingHttpSubmissionHandler 39 2 0 1
org.astrogrid.applications.uws.AppJobCreationController 10 2 0 0
org.astrogrid.applications.uws.SiapController 18 2 0 0
org.astrogrid.applications.chiba.XformsFilter 56 1 0 2
org.astrogrid.applications.chiba.SubmissionResponseServlet 50 1 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
57.59 2,185.00 0.59 5.17 2.90

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.astrogrid.applications.commandline.hyperz.HyperZVOTableWriter.internalAddToVOTable(SavotVOTable,File) 102 8 1
org.astrogrid.applications.chiba.XformsFilter.doFilter(ServletRequest,ServletResponse,FilterChain) 54 18 1
org.astrogrid.applications.chiba.SubmissionResponseServlet.doGet(HttpServletRequest,HttpServletResponse) 48 15 0
org.astrogrid.applications.uws.InitServlet.doGet(HttpServletRequest,HttpServletResponse) 48 12 0
org.astrogrid.applications.commandline.hyperz.HyperZVOTableReader.readInternal(File,File) 47 12 0
org.jdesktop.swingworker.SwingWorker.getWorkersExecutorService() 45 2 1
org.astrogrid.applications.uws.UWSController.showResult(String,SecurityGuard,HttpServletRequest,HttpServletResponse) 44 7 0
org.astrogrid.applications.commandline.sextractor.ASCII2VOTableConverter.internalWriteVOTable(FileReader,FileOutputStream) 35 5 1
org.astrogrid.applications.chiba.RedirectingHttpSubmissionHandler.execute(HttpMethod) 34 13 0
org.astrogrid.applications.uws.UWSController.changeApplicationPhase(String,HttpServletRequest,HttpServletResponse,String,SecurityGuard) 29 15 0
org.astrogrid.applications.uws.AbstractAccessProtocolController.configureTool(HttpServletRequest) 28 7 1
org.astrogrid.applications.uws.InitServlet.getExecutionLog(HttpServletResponse,String,String) 27 8 1
org.astrogrid.applications.uws.JobCreationController.createJob(HttpServletRequest,HttpServletResponse) 27 6 0
org.astrogrid.applications.docs.DocServlet.doGet(HttpServletRequest,HttpServletResponse) 26 6 0
org.astrogrid.applications.uws.AbstractAccessProtocolController.sendMetadata(ApplicationDefinition,PrintWriter) 26 3 0
org.astrogrid.applications.uws.UWSController.determinMime(ParameterValue,ParameterDescription) 24 9 1
org.astrogrid.applications.uws.UWSController.results(String,HttpServletRequest,HttpServletResponse) 23 4 0
org.astrogrid.applications.commandline.sextractor.OutputParams.getParamAsVOTableField(int) 22 6 0
org.astrogrid.applications.vosi.VosiServlet.doGet(HttpServletRequest,HttpServletResponse) 20 6 0
org.astrogrid.applications.uws.JobCreationController.listJobs(HttpServletRequest,HttpServletResponse) 19 4 0
org.astrogrid.applications.uws.MetaDataController.makeTool(String,String) 19 3 0
org.astrogrid.applications.uws.SyncJobCreationController.waitForJob(HttpServletRequest,HttpServletResponse) 18 5 0
org.jdesktop.swingworker.SwingWorker.setProgress(int) 17 9 1
org.jdesktop.swingworker.SwingWorker.ThreadPoolExecutor$7.execute(Runnable) 16 1 0
org.astrogrid.applications.docs.DocServlet.init(ServletConfig) 15 3 0
org.astrogrid.applications.uws.SiapController.runApplication(HttpServletRequest,HttpServletResponse) 15 7 0
org.astrogrid.applications.uws.UWSUtils.needsxml(HttpServletRequest) 14 8 1
org.astrogrid.applications.uws.UWSController.showJob(String,SecurityGuard,HttpServletRequest,HttpServletResponse) 14 2 0
org.astrogrid.applications.uws.UWSController.writeTextFile(HttpServletResponse,File) 14 3 0
org.jdesktop.swingworker.SwingWorker.SwingWorker() 13 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,185.00 8.40 2.44 0.32

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