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.sourceforge.vlibrary.user.dao 9 160 1265 130 706 30 188
org.sourceforge.vlibrary.user.actions 15 21 718 28 204 51 122
org.sourceforge.vlibrary.user.forms 7 122 585 41 234 13 58
org.sourceforge.vlibrary.user.logic 1 55 462 49 425 36 71
org.sourceforge.vlibrary.user.domain 5 85 300 16 88 0 0
org.sourceforge.vlibrary.user.workers 3 43 288 32 205 9 1
org.sourceforge.vlibrary.util 5 22 232 20 166 3 12
org.sourceforge.vlibrary.user.valuebeans 3 44 112 45 149 0 0
org.sourceforge.vlibrary.security.actions 3 3 91 6 33 2 28
org.sourceforge.vlibrary 1 0 51 1 4 12 43
org.sourceforge.vlibrary.security.forms 2 10 44 7 30 1 0
org.sourceforge.vlibrary.user.exceptions 5 10 38 6 22 0 8
org.sourceforge.vlibrary.exceptions 1 4 11 1 3 0 3
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
60 579 4197 382 2269 157 534

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.sourceforge.vlibrary.user.logic.LibraryManager 432 55 0 49
org.sourceforge.vlibrary.user.dao.BookDAO 322 50 0 42
org.sourceforge.vlibrary.user.dao.LibraryTransactionDAO 246 24 0 13
org.sourceforge.vlibrary.user.dao.ReaderDAOSpringJDBCImpl 239 36 0 36
org.sourceforge.vlibrary.user.forms.BookForm 212 37 0 6
org.sourceforge.vlibrary.util.SruSrwClientImpl 148 13 1 14
org.sourceforge.vlibrary.user.workers.MailSenderImpl 132 16 0 4
org.sourceforge.vlibrary.user.domain.Reader 127 33 0 3
org.sourceforge.vlibrary.user.dao.LocationDAO 126 11 0 12
org.sourceforge.vlibrary.user.forms.ReaderForm 121 31 0 3
org.sourceforge.vlibrary.user.dao.SubjectDAOSpringJDBCImpl 117 10 0 11
org.sourceforge.vlibrary.user.workers.MailWorker 116 11 0 11
org.sourceforge.vlibrary.user.domain.Book 103 27 0 3
org.sourceforge.vlibrary.user.dao.AuthorDAOSpringJDBCImpl 83 9 0 6
org.sourceforge.vlibrary.user.forms.BookSearchForm 79 19 0 5
org.sourceforge.vlibrary.user.actions.EditBookAction 67 1 0 2
org.sourceforge.vlibrary.user.valuebeans.LibraryTransaction 64 26 0 25
org.sourceforge.vlibrary.user.forms.TransactionForm 63 18 0 14
org.sourceforge.vlibrary.user.actions.ListBookAction 60 1 0 2
org.sourceforge.vlibrary.user.actions.BookListSortAction 58 4 3 1
org.sourceforge.vlibrary.user.actions.RequestBookAction 51 1 0 2
org.sourceforge.vlibrary.Constants 50 0 0 1
org.sourceforge.vlibrary.user.actions.SaveBookAction 47 1 0 1
org.sourceforge.vlibrary.user.actions.SaveReaderAction 42 1 0 2
org.sourceforge.vlibrary.util.CryptoImpl 36 5 0 2
org.sourceforge.vlibrary.user.actions.LibraryAction 31 4 0 4
org.sourceforge.vlibrary.user.forms.ForgotPasswordForm 30 7 0 3
org.sourceforge.vlibrary.user.actions.EditReaderAction 29 1 0 2
org.sourceforge.vlibrary.user.domain.Author 29 11 0 1
org.sourceforge.vlibrary.user.actions.StatusBookAction 28 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.sourceforge.vlibrary.user.logic.LibraryManager 432 55 0 49
org.sourceforge.vlibrary.user.dao.BookDAO 322 50 0 42
org.sourceforge.vlibrary.user.forms.BookForm 212 37 0 6
org.sourceforge.vlibrary.user.dao.ReaderDAOSpringJDBCImpl 239 36 0 36
org.sourceforge.vlibrary.user.domain.Reader 127 33 0 3
org.sourceforge.vlibrary.user.forms.ReaderForm 121 31 0 3
org.sourceforge.vlibrary.user.domain.Book 103 27 0 3
org.sourceforge.vlibrary.user.valuebeans.LibraryTransaction 64 26 0 25
org.sourceforge.vlibrary.user.dao.LibraryTransactionDAO 246 24 0 13
org.sourceforge.vlibrary.user.forms.BookSearchForm 79 19 0 5
org.sourceforge.vlibrary.user.forms.TransactionForm 63 18 0 14
org.sourceforge.vlibrary.user.workers.MailSender 17 16 0 17
org.sourceforge.vlibrary.user.workers.MailSenderImpl 132 16 0 4
org.sourceforge.vlibrary.user.dao.ReaderDAO 14 13 0 2
org.sourceforge.vlibrary.util.SruSrwClientImpl 148 13 1 14
org.sourceforge.vlibrary.user.dao.LocationDAO 126 11 0 12
org.sourceforge.vlibrary.user.domain.Author 29 11 0 1
org.sourceforge.vlibrary.user.valuebeans.BookMoveTransaction 27 11 0 12
org.sourceforge.vlibrary.user.workers.MailWorker 116 11 0 11
org.sourceforge.vlibrary.user.dao.SubjectDAOSpringJDBCImpl 117 10 0 11
org.sourceforge.vlibrary.user.dao.AuthorDAOSpringJDBCImpl 83 9 0 6
org.sourceforge.vlibrary.user.domain.Location 18 7 0 8
org.sourceforge.vlibrary.user.domain.Subject 16 7 0 1
org.sourceforge.vlibrary.user.forms.ForgotPasswordForm 30 7 0 3
org.sourceforge.vlibrary.user.forms.ManageReaderForm 18 7 0 8
org.sourceforge.vlibrary.user.valuebeans.BookEditTransaction 17 7 0 8
org.sourceforge.vlibrary.security.forms.PasswordResetForm 24 6 0 2
org.sourceforge.vlibrary.util.CryptoImpl 36 5 0 2
org.sourceforge.vlibrary.exceptions.LibraryException 10 4 0 1
org.sourceforge.vlibrary.security.forms.AdminPasswordResetForm 12 4 0 5

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
61.13 4,197.00 0.07 9.65 6.37

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.sourceforge.vlibrary.user.actions.EditBookAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 65 14 1
org.sourceforge.vlibrary.user.actions.ListBookAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 58 15 1
org.sourceforge.vlibrary.user.actions.RequestBookAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 49 12 1
org.sourceforge.vlibrary.util.SruSrwClientImpl.getRecordFields(SOAPEnvelope) 49 19 1
org.sourceforge.vlibrary.user.logic.LibraryManager.processExchange(long,long,String,long) 48 19 1
org.sourceforge.vlibrary.user.logic.LibraryManager.processRequest(long,long,long) 46 13 1
org.sourceforge.vlibrary.user.actions.SaveBookAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 45 12 0
org.sourceforge.vlibrary.user.dao.LibraryTransactionDAO.retrieve(long) 43 11 0
org.sourceforge.vlibrary.util.SruSrwClientImpl.callSruSrwProvider(String) 43 18 1
org.sourceforge.vlibrary.user.actions.SaveReaderAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 40 13 1
org.sourceforge.vlibrary.user.workers.MailSenderImpl.send(SimpleMailMessage) 38 13 0
org.sourceforge.vlibrary.user.workers.MailSenderImpl.getSession() 35 11 1
org.sourceforge.vlibrary.user.dao.ReaderDAOSpringJDBCImpl.insert(Reader) 33 19 1
org.sourceforge.vlibrary.user.forms.ReaderForm.validate(ActionMapping,HttpServletRequest) 32 22 1
org.sourceforge.vlibrary.user.logic.LibraryManager.getTransactions(long) 29 6 0
org.sourceforge.vlibrary.user.actions.EditReaderAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 27 8 1
org.sourceforge.vlibrary.user.actions.StatusBookAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 26 5 0
org.sourceforge.vlibrary.util.SruSrwClientImpl.getSOAPPayload(String) 26 2 1
org.sourceforge.vlibrary.user.dao.BookDAO.addSubject(Book,Subject) 25 11 0
org.sourceforge.vlibrary.user.dao.LibraryTransactionDAO.processCheckout(long,long,String,long) 25 10 0
org.sourceforge.vlibrary.user.domain.Reader.equals(Object) 25 60 1
org.sourceforge.vlibrary.user.logic.LibraryManager.processCheckout(long,long,long) 25 9 0
org.sourceforge.vlibrary.security.actions.PasswordResetAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 24 5 1
org.sourceforge.vlibrary.user.dao.SubjectDAOSpringJDBCImpl.getSubjects() 24 7 1
org.sourceforge.vlibrary.user.dao.BookDAO.getAuthors(Book) 23 10 0
org.sourceforge.vlibrary.user.actions.BookListSortAction.executeAction(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,MessageResources) 22 9 1
org.sourceforge.vlibrary.user.dao.AuthorDAOSpringJDBCImpl.findAuthorByFirstLastName(Author) 22 9 0
org.sourceforge.vlibrary.user.dao.LocationDAO.getLocationIdByDescription(Location) 22 10 1
org.sourceforge.vlibrary.user.dao.LocationDAO.insert(Location) 22 10 1
org.sourceforge.vlibrary.user.dao.ReaderDAOSpringJDBCImpl.persistAdminStatus(Reader) 22 8 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
4,197.00 5.63 2.47 0.55

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