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
eu.europa.tmsearch.services.resources 5 64 410 1 49 0 221
eu.europa.tmsearch.services.business 10 48 232 20 214 4 180
eu.europa.tmsearch.services.dao 8 16 123 12 85 2 144
eu.europa.tmsearch.services.resources.util 4 17 114 6 64 2 72
eu.europa.tmsearch.services.business.util 5 12 100 14 114 0 90
eu.europa.tmsearch.services.resources.exceptions 3 6 27 1 4 0 57
eu.europa.tmsearch.services.resources.BodyWriters 1 3 20 0 0 0 18
eu.europa.tmsearch.services.business.exception 2 8 19 0 0 0 39
eu.europa.tmsearch.services.model 1 2 8 0 0 0 18
eu.europa.tmsearch.services 1 2 6 0 0 0 18
eu.europa.tmsearch.services.dao.exception 1 0 2 0 0 0 18
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
41 178 1061 54 530 8 875

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
eu.europa.tmsearch.services.resources.TradeMarkResource 72 14 0 1
eu.europa.tmsearch.services.resources.RepresentativeResource 66 14 0 0
eu.europa.tmsearch.services.resources.ApplicantResource 66 14 0 0
eu.europa.tmsearch.services.dao.ResourceDAOSupport 62 7 0 2
eu.europa.tmsearch.services.business.TradeMarkThumbnailServiceImpl 48 15 0 2
eu.europa.tmsearch.services.resources.util.CacheableResponseSupport 46 9 0 3
eu.europa.tmsearch.services.business.TradeMarkImageServiceImpl 45 11 0 2
eu.europa.tmsearch.services.resources.TradeMarkImageResource 41 11 0 0
eu.europa.tmsearch.services.resources.TradeMarkThumbnailResource 41 11 0 0
eu.europa.tmsearch.services.resources.util.MD5ETagGenerator 36 4 0 3
eu.europa.tmsearch.services.business.util.JMagickImageProcessorImpl 28 3 0 3
eu.europa.tmsearch.services.business.TradeMarkServiceImpl 26 7 0 2
eu.europa.tmsearch.services.business.util.AWTImageProcessorImpl 25 3 0 2
eu.europa.tmsearch.services.business.RepresentativeServiceImpl 20 5 0 2
eu.europa.tmsearch.services.business.ApplicantServiceImpl 17 5 0 2
eu.europa.tmsearch.services.resources.exceptions.ResourceNotFoundException 10 4 0 1
eu.europa.tmsearch.services.business.exception.BusinessServiceException 9 4 0 0
eu.europa.tmsearch.services.resources.BodyWriters.TradeMarkImageBodyWriterImpl 8 3 0 0
eu.europa.tmsearch.services.business.exception.ImageProcessorRuntimeException 8 4 0 0
eu.europa.tmsearch.services.model.TradeMarkImage 6 2 0 0
eu.europa.tmsearch.services.dao.CacheableDaoSupport 5 2 0 0
eu.europa.tmsearch.services.dao.CacheableJpaDaoSupport 5 2 0 0
eu.europa.tmsearch.services.business.util.ST13ConverterDummyImpl 5 2 0 3
eu.europa.tmsearch.services.Cacheable 3 2 0 0
eu.europa.tmsearch.services.resources.util.ResponseProvider 3 2 0 0
eu.europa.tmsearch.services.resources.util.ETagGenerator 3 2 0 0
eu.europa.tmsearch.services.resources.exceptions.ResourceNotFoundExceptionMapper 3 1 0 0
eu.europa.tmsearch.services.resources.exceptions.BusinessServiceExceptionMapper 3 1 0 0
eu.europa.tmsearch.services.business.util.ST13Converter 3 2 0 3
eu.europa.tmsearch.services.business.util.ImageProcessor 3 2 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
eu.europa.tmsearch.services.business.TradeMarkThumbnailServiceImpl 48 15 0 2
eu.europa.tmsearch.services.resources.RepresentativeResource 66 14 0 0
eu.europa.tmsearch.services.resources.TradeMarkResource 72 14 0 1
eu.europa.tmsearch.services.resources.ApplicantResource 66 14 0 0
eu.europa.tmsearch.services.resources.TradeMarkImageResource 41 11 0 0
eu.europa.tmsearch.services.resources.TradeMarkThumbnailResource 41 11 0 0
eu.europa.tmsearch.services.business.TradeMarkImageServiceImpl 45 11 0 2
eu.europa.tmsearch.services.resources.util.CacheableResponseSupport 46 9 0 3
eu.europa.tmsearch.services.dao.ResourceDAOSupport 62 7 0 2
eu.europa.tmsearch.services.business.TradeMarkServiceImpl 26 7 0 2
eu.europa.tmsearch.services.business.ApplicantServiceImpl 17 5 0 2
eu.europa.tmsearch.services.business.RepresentativeServiceImpl 20 5 0 2
eu.europa.tmsearch.services.resources.util.MD5ETagGenerator 36 4 0 3
eu.europa.tmsearch.services.resources.exceptions.ResourceNotFoundException 10 4 0 1
eu.europa.tmsearch.services.business.exception.BusinessServiceException 9 4 0 0
eu.europa.tmsearch.services.business.exception.ImageProcessorRuntimeException 8 4 0 0
eu.europa.tmsearch.services.resources.BodyWriters.TradeMarkImageBodyWriterImpl 8 3 0 0
eu.europa.tmsearch.services.business.util.AWTImageProcessorImpl 25 3 0 2
eu.europa.tmsearch.services.business.util.JMagickImageProcessorImpl 28 3 0 3
eu.europa.tmsearch.services.dao.CacheableDaoSupport 5 2 0 0
eu.europa.tmsearch.services.dao.CacheableJpaDaoSupport 5 2 0 0
eu.europa.tmsearch.services.Cacheable 3 2 0 0
eu.europa.tmsearch.services.resources.util.ResponseProvider 3 2 0 0
eu.europa.tmsearch.services.resources.util.ETagGenerator 3 2 0 0
eu.europa.tmsearch.services.business.util.ST13Converter 3 2 0 3
eu.europa.tmsearch.services.business.util.ImageProcessor 3 2 0 3
eu.europa.tmsearch.services.business.util.ST13ConverterDummyImpl 5 2 0 3
eu.europa.tmsearch.services.model.TradeMarkImage 6 2 0 0
eu.europa.tmsearch.services.dao.TradeMarkDAO 2 1 0 2
eu.europa.tmsearch.services.dao.RepresentativeDAO 2 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
17.98 1,061.00 0.00 4.34 1.32

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
eu.europa.tmsearch.services.resources.TradeMarkResource.buildResource() 25 3 0
eu.europa.tmsearch.services.dao.ResourceDAOSupport.getResource(String) 22 10 1
eu.europa.tmsearch.services.resources.RepresentativeResource.buildResource() 20 1 0
eu.europa.tmsearch.services.resources.ApplicantResource.buildResource() 20 1 0
eu.europa.tmsearch.services.business.util.JMagickImageProcessorImpl.getThumbnailImage(TradeMarkImage,int,int) 20 8 1
eu.europa.tmsearch.services.dao.ResourceDAOSupport.getLastModified(String) 17 10 0
eu.europa.tmsearch.services.business.TradeMarkImageServiceImpl.getImage(String) 17 6 1
eu.europa.tmsearch.services.resources.TradeMarkResource.getTradeMark(String) 15 6 0
eu.europa.tmsearch.services.resources.RepresentativeResource.getRepresentative(String) 14 6 0
eu.europa.tmsearch.services.resources.TradeMarkImageResource.getTradeMarkImage(String) 14 6 0
eu.europa.tmsearch.services.resources.TradeMarkThumbnailResource.getTradeMarkThumbnail(String) 14 6 0
eu.europa.tmsearch.services.resources.ApplicantResource.getApplicant(String) 14 6 0
eu.europa.tmsearch.services.business.util.AWTImageProcessorImpl.getThumbnailImage(TradeMarkImage,int,int) 14 4 1
eu.europa.tmsearch.services.resources.util.MD5ETagGenerator.objToByteArray(Object) 12 2 1
eu.europa.tmsearch.services.business.TradeMarkThumbnailServiceImpl.getThumbnail(String) 12 4 1
eu.europa.tmsearch.services.resources.util.MD5ETagGenerator.getMd5Digest(byte[]) 10 3 1
eu.europa.tmsearch.services.resources.util.CacheableResponseSupport.getDateTimeStamp(Date) 10 3 0
eu.europa.tmsearch.services.resources.util.MD5ETagGenerator.setSourceObject(Object) 9 4 1
eu.europa.tmsearch.services.business.RepresentativeServiceImpl.getRepresentative(String) 9 2 1
eu.europa.tmsearch.services.resources.util.CacheableResponseSupport.checkForStaleResource(Request) 8 4 1
eu.europa.tmsearch.services.resources.util.CacheableResponseSupport.checkForValidResource(Request) 8 4 1
eu.europa.tmsearch.services.business.TradeMarkServiceImpl.getTradeMark(String) 8 3 1
eu.europa.tmsearch.services.business.util.AWTImageProcessorImpl.createResizedCopy(Image,int,int) 7 1 0
eu.europa.tmsearch.services.business.ApplicantServiceImpl.getApplicant(String) 6 2 1
eu.europa.tmsearch.services.dao.ResourceDAOSupport.safeClose(InputStream) 5 3 0
eu.europa.tmsearch.services.dao.ResourceDAOSupport.safeClose(OutputStream) 5 3 0
eu.europa.tmsearch.services.dao.ResourceDAOSupport.isValidPath(String) 5 3 0
eu.europa.tmsearch.services.resources.util.CacheableResponseSupport.getETagGenerator() 4 2 0
eu.europa.tmsearch.services.business.util.JMagickImageProcessorImpl.JMagickImageProcessorImpl() 4 2 1
eu.europa.tmsearch.services.resources.util.CacheableResponseSupport.setETagGenerator(ETagGenerator) 3 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,061.00 3.54 1.51 0.17

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