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
ch.busyboxes.agoo.dao.impl 7 20 211 23 90 3 0
ch.busyboxes.agoo.service.impl 3 20 140 23 103 7 0
ch.busyboxes.agoo.controller 4 15 125 19 105 4 1
ch.busyboxes.agoo.model 3 26 107 29 144 0 14
ch.busyboxes.agoo.controller.model 2 18 51 20 111 0 0
ch.busyboxes.agoo.dao 4 16 32 20 111 0 0
ch.busyboxes.agoo.service.impl.adapter 2 3 32 5 29 0 0
ch.busyboxes.agoo.service 3 12 22 15 79 0 0
ch.busyboxes.agoo.job 1 2 12 3 15 0 0
ch.busyboxes.agoo.validator 1 2 9 3 11 1 0
ch.busyboxes.agoo.controller.form 1 2 7 3 16 0 0
ch.busyboxes.agoo.model.enumeration 3 0 6 0 0 0 34
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
34 136 754 163 814 15 49

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
ch.busyboxes.agoo.dao.impl.FileSystemDAOImpl 69 3 0 4
ch.busyboxes.agoo.controller.FolderController 56 8 0 9
ch.busyboxes.agoo.dao.impl.WatchedFolderDAOImpl 45 6 0 7
ch.busyboxes.agoo.service.impl.WatchedFileServiceImpl 40 6 0 7
ch.busyboxes.agoo.service.impl.WatcherTaskServiceImpl 36 6 0 7
ch.busyboxes.agoo.service.impl.WatchedFolderServiceImpl 32 8 0 9
ch.busyboxes.agoo.controller.model.WebWatchedFile 31 12 0 13
ch.busyboxes.agoo.model.WatchedFile 29 11 0 12
ch.busyboxes.agoo.model.WatcherTask 26 10 0 11
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl 24 4 1 5
ch.busyboxes.agoo.dao.impl.WatcherTaskDAOImpl 23 4 1 5
ch.busyboxes.agoo.controller.model.WebWatchedFolder 16 6 0 7
ch.busyboxes.agoo.model.WatchedFolder 14 5 0 6
ch.busyboxes.agoo.service.impl.adapter.WatchedFileAdapter 14 2 0 3
ch.busyboxes.agoo.controller.FileController 12 2 0 3
ch.busyboxes.agoo.controller.IndexController 10 3 0 4
ch.busyboxes.agoo.service.impl.adapter.WatchedFolderAdapter 10 1 0 2
ch.busyboxes.agoo.job.JobOrchestrator 9 2 0 3
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl.HibernateCallback 7 1 0 0
ch.busyboxes.agoo.dao.WatchedFolderDAO 7 6 0 7
ch.busyboxes.agoo.controller.AboutController 6 2 0 3
ch.busyboxes.agoo.controller.form.FolderAdditionForm 6 2 0 3
ch.busyboxes.agoo.dao.impl.WatcherTaskDAOImpl.HibernateCallback 6 1 0 0
ch.busyboxes.agoo.service.WatchedFolderService 6 5 0 6
ch.busyboxes.agoo.dao.WatchedFileDAO 5 4 0 5
ch.busyboxes.agoo.dao.WatcherTaskDAO 5 4 0 5
ch.busyboxes.agoo.service.WatchedFileService 5 4 0 5
ch.busyboxes.agoo.validator.FolderAdditionValidator 5 2 0 3
ch.busyboxes.agoo.dao.impl.AbstractHibernateDAO 4 1 0 2
ch.busyboxes.agoo.service.WatcherTaskService 4 3 0 4

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
ch.busyboxes.agoo.controller.model.WebWatchedFile 31 12 0 13
ch.busyboxes.agoo.model.WatchedFile 29 11 0 12
ch.busyboxes.agoo.model.WatcherTask 26 10 0 11
ch.busyboxes.agoo.controller.FolderController 56 8 0 9
ch.busyboxes.agoo.service.impl.WatchedFolderServiceImpl 32 8 0 9
ch.busyboxes.agoo.controller.model.WebWatchedFolder 16 6 0 7
ch.busyboxes.agoo.dao.impl.WatchedFolderDAOImpl 45 6 0 7
ch.busyboxes.agoo.dao.WatchedFolderDAO 7 6 0 7
ch.busyboxes.agoo.service.impl.WatchedFileServiceImpl 40 6 0 7
ch.busyboxes.agoo.service.impl.WatcherTaskServiceImpl 36 6 0 7
ch.busyboxes.agoo.model.WatchedFolder 14 5 0 6
ch.busyboxes.agoo.service.WatchedFolderService 6 5 0 6
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl 24 4 1 5
ch.busyboxes.agoo.dao.impl.WatcherTaskDAOImpl 23 4 1 5
ch.busyboxes.agoo.dao.WatchedFileDAO 5 4 0 5
ch.busyboxes.agoo.dao.WatcherTaskDAO 5 4 0 5
ch.busyboxes.agoo.service.WatchedFileService 5 4 0 5
ch.busyboxes.agoo.controller.IndexController 10 3 0 4
ch.busyboxes.agoo.dao.impl.FileSystemDAOImpl 69 3 0 4
ch.busyboxes.agoo.service.WatcherTaskService 4 3 0 4
ch.busyboxes.agoo.controller.AboutController 6 2 0 3
ch.busyboxes.agoo.controller.FileController 12 2 0 3
ch.busyboxes.agoo.controller.form.FolderAdditionForm 6 2 0 3
ch.busyboxes.agoo.dao.FileSystemDAO 3 2 0 3
ch.busyboxes.agoo.job.JobOrchestrator 9 2 0 3
ch.busyboxes.agoo.service.impl.adapter.WatchedFileAdapter 14 2 0 3
ch.busyboxes.agoo.validator.FolderAdditionValidator 5 2 0 3
ch.busyboxes.agoo.dao.impl.AbstractHibernateDAO 4 1 0 2
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl.HibernateCallback 7 1 0 0
ch.busyboxes.agoo.dao.impl.WatcherTaskDAOImpl.HibernateCallback 6 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
16.71 754.00 0.06 4.00 4.79

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
ch.busyboxes.agoo.dao.impl.FileSystemDAOImpl.computeMd5Hash(String) 30 10 1
ch.busyboxes.agoo.service.impl.WatchedFileServiceImpl.checkWatchedFile(long) 24 5 1
ch.busyboxes.agoo.service.impl.WatcherTaskServiceImpl.runNextTask() 21 6 1
ch.busyboxes.agoo.dao.impl.FileSystemDAOImpl.getFilesInPath(String) 19 7 1
ch.busyboxes.agoo.dao.impl.FileSystemDAOImpl.getNewFilesInPath(String,File,String) 18 8 1
ch.busyboxes.agoo.dao.impl.WatchedFolderDAOImpl.addWatchedFilesToFolder(WatchedFolder,String) 18 6 1
ch.busyboxes.agoo.controller.FolderController.addFolder(FolderAdditionForm,BindingResult,ModelMap) 16 5 1
ch.busyboxes.agoo.controller.FolderController.folderDetails(Long,Integer) 14 4 1
ch.busyboxes.agoo.dao.impl.WatchedFolderDAOImpl.addWatchedFileToFolder(WatchedFolder,String) 14 5 1
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl.getWatchedFilesByFolderPaged(Long,int,int) 10 1 1
ch.busyboxes.agoo.dao.impl.WatcherTaskDAOImpl.createNewTask(TaskType,Long) 9 2 1
ch.busyboxes.agoo.service.impl.adapter.WatchedFolderAdapter.adaptWatchedFolderShallow(WatchedFolder) 9 2 1
ch.busyboxes.agoo.dao.impl.WatcherTaskDAOImpl.fetchNextPendingTask() 8 1 1
ch.busyboxes.agoo.service.impl.adapter.WatchedFileAdapter.adaptWatchedFile(WatchedFile) 8 1 1
ch.busyboxes.agoo.controller.FileController.fileDetails(Long) 7 2 1
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl.HibernateCallback.doInHibernate(Session) 7 1 0
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl.getTotalFilesWatched() 6 3 1
ch.busyboxes.agoo.dao.impl.WatcherTaskDAOImpl.HibernateCallback.doInHibernate(Session) 6 1 0
ch.busyboxes.agoo.service.impl.WatchedFolderServiceImpl.getAllWatchedFolders() 6 2 1
ch.busyboxes.agoo.service.impl.WatchedFolderServiceImpl.createWatchedFolderByPath(String) 6 1 1
ch.busyboxes.agoo.service.impl.WatchedFolderServiceImpl.refreshWatchedFilesInWatchedFolder(Long) 6 2 1
ch.busyboxes.agoo.controller.FolderController.refreshFolder(Long) 5 2 1
ch.busyboxes.agoo.controller.FolderController.deleteFolder(Long) 5 2 1
ch.busyboxes.agoo.service.impl.adapter.WatchedFileAdapter.adaptWatchedFiles(WatchedFile) 5 2 1
ch.busyboxes.agoo.controller.FolderController.folderHomepage(ModelMap) 4 1 1
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl.saveWatchedFile(WatchedFile) 4 2 1
ch.busyboxes.agoo.job.JobOrchestrator.run() 4 1 1
ch.busyboxes.agoo.controller.FolderController.addFolder(ModelMap) 3 1 1
ch.busyboxes.agoo.controller.IndexController.indexPage(ModelMap) 3 1 1
ch.busyboxes.agoo.dao.impl.WatchedFileDAOImpl.getWatchedFileById(Long) 3 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
754.00 3.58 1.43 0.99

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