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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
net.sf.imca.model.entities272621014342020591
net.sf.imca.services8638892618437123
net.sf.imca.model12727293723811224
net.sf.imca.web.backingbeans81386417651105
net.sf.imca.web3212361362489
net.sf.imca.taglibs52222700315
net.sf.imca.model.exceptions331500054
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
665813751117751561201

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
net.sf.imca.model.PersonBO3423206
net.sf.imca.services.CommitteeService27426011
net.sf.imca.web.DataAdminServlet1671808
net.sf.imca.web.backingbeans.CommitteeBean1534301
net.sf.imca.services.ReflectionUtil1311001
net.sf.imca.services.JoinImcaService1151101
net.sf.imca.model.AssociationBO1141209
net.sf.imca.web.backingbeans.JoinBean1062401
net.sf.imca.services.LoginRegisterService92303
net.sf.imca.model.BoatBO80503
net.sf.imca.web.backingbeans.LoginBean791801
net.sf.imca.model.entities.PersonEntity783101
net.sf.imca.services.EditDataService74502
net.sf.imca.model.entities.BoatEntity682301
net.sf.imca.model.entities.AssociationEntity591801
net.sf.imca.web.backingbeans.MemTypeBean561401
net.sf.imca.web.backingbeans.WebUser551201
net.sf.imca.taglibs.ImcaNationalCommittee54700
net.sf.imca.web.backingbeans.MyDataBean531501
net.sf.imca.model.entities.AddressEntity5016016
net.sf.imca.model.entities.EventEntryEntity481901
net.sf.imca.taglibs.Rider45200
net.sf.imca.taglibs.Riders44300
net.sf.imca.web.backingbeans.MembershipTableModel43610
net.sf.imca.model.entities.AssociationDAO39800
net.sf.imca.services.UiService39302
net.sf.imca.model.entities.BoatDAO38200
net.sf.imca.model.entities.SailEntity381301
net.sf.imca.model.entities.MembershipEntity351301
net.sf.imca.model.entities.BoatVersionEntity331301

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
net.sf.imca.web.backingbeans.CommitteeBean1534301
net.sf.imca.model.PersonBO3423206
net.sf.imca.model.entities.PersonEntity783101
net.sf.imca.services.CommitteeService27426011
net.sf.imca.web.backingbeans.JoinBean1062401
net.sf.imca.model.entities.BoatEntity682301
net.sf.imca.model.entities.EventEntryEntity481901
net.sf.imca.model.entities.AssociationEntity591801
net.sf.imca.web.backingbeans.LoginBean791801
net.sf.imca.web.DataAdminServlet1671808
net.sf.imca.model.entities.AddressEntity5016016
net.sf.imca.web.backingbeans.MyDataBean531501
net.sf.imca.web.backingbeans.MemTypeBean561401
net.sf.imca.model.entities.BoatVersionEntity331301
net.sf.imca.model.entities.MembershipEntity351301
net.sf.imca.model.entities.MembershipTypeEntity331302
net.sf.imca.model.entities.SailEntity381301
net.sf.imca.model.AssociationBO1141209
net.sf.imca.web.backingbeans.WebUser551201
net.sf.imca.model.entities.DesignEntity281101
net.sf.imca.model.entities.EquipmentSupplierEntity281101
net.sf.imca.model.entities.EventEntity281101
net.sf.imca.services.JoinImcaService1151101
net.sf.imca.services.ReflectionUtil1311001
net.sf.imca.model.entities.CommitteeMemberEntity23901
net.sf.imca.model.entities.FoilEntity28901
net.sf.imca.model.entities.MastEntity28901
net.sf.imca.model.entities.SailingClubEntity23901
net.sf.imca.model.entities.AssociationDAO39800
net.sf.imca.model.entities.FeeEntity18701

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
48.653,751.000.038.801.77

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
net.sf.imca.model.PersonBO.PersonBO(EntityManager,NodeList)96270
net.sf.imca.model.BoatBO.BoatBO(EntityManager,NodeList)60210
net.sf.imca.web.DataAdminServlet.doHttp(HttpServletRequest,HttpServletResponse)58180
net.sf.imca.model.AssociationBO.AssociationBO(EntityManager,NodeList)57151
net.sf.imca.services.LoginRegisterService.register(String,String,String,String,String,String)54270
net.sf.imca.model.PersonBO.convertOldXmlCountryCodesToISO(String)50341
net.sf.imca.services.ReflectionUtil.setEntityValuesFromParameterMap(Object,Hashtable)49180
net.sf.imca.model.PersonBO.PersonBO(EntityManager,String,String)35200
net.sf.imca.services.EditDataService.saveMyData(PersonEntity,String,String)34110
net.sf.imca.web.DataAdminServlet.doFormRow(PrintWriter,Object,Method)2780
net.sf.imca.model.entities.BoatDAO.findBoat(EntityManager,BoatEntity)26100
net.sf.imca.taglibs.Rider.setPageAttributes(PersonBO)2420
net.sf.imca.services.CommitteeService.addMember(long,String)2350
net.sf.imca.services.JoinImcaService.makeMembershipRequest(PersonBO,String,String,long)2350
net.sf.imca.services.UiService.getMembersWithWebsites()2380
net.sf.imca.services.ReflectionUtil.getClasses(String)21110
net.sf.imca.taglibs.Riders.setPageAttributes()2120
net.sf.imca.services.LoginRegisterService.sendPassword(String)2091
net.sf.imca.services.CommitteeService.saveNewMembershipType(long,String,String,double,Date,Date)1820
net.sf.imca.taglibs.Rider.doStartTag()1890
net.sf.imca.services.CommitteeService.getEditableMembershipTypes(PersonBO)1760
net.sf.imca.services.CommitteeService.saveMembershipType(long,String,String,double,Date,Date)1731
net.sf.imca.taglibs.ImcaNationalCommittee.doStartTag()1770
net.sf.imca.model.entities.AssociationEntity.toString()1641
net.sf.imca.services.CommitteeService.confirmPaidMembershipEntity(long)1641
net.sf.imca.services.JoinImcaService.getJoinableAssociation(String,String)1660
net.sf.imca.services.LoginRegisterService.login(String,String)1661
net.sf.imca.taglibs.ImcaNationalCommittee.setPageAttributes()1620
net.sf.imca.web.RidersDataServlet.doGet(HttpServletRequest,HttpServletResponse)1641
net.sf.imca.model.PersonBO.resetPassword(EntityManager,InternetAddress)1540

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
3,751.004.941.980.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 declarationpackage java.lang;
Import declarationimport java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declarationpublic interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declarationpublic Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
Label declarationfine :
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).