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.magicproject.action72466375220522481951949
net.sf.magicproject.xml1411129551291056154414
net.sf.magicproject.clickable.targetable.card1629821971761500188489
net.sf.magicproject.stack1217818161711373173694
net.sf.magicproject.tools2824717252071583114730
net.sf.magicproject.ui.wizard239817057582284558
net.sf.magicproject.test6323216161701648171709
net.sf.magicproject.modifier381991494130152550876
net.sf.magicproject.xml.action606213921191156881172
net.sf.magicproject.event3423112151812200151040
net.sf.magicproject.ui157910988060987469
net.sf.magicproject349106427155115137
net.sf.magicproject.zone13140105110883951416
net.sf.magicproject.ui.component178410146444173423
net.sf.magicproject.clickable.ability181548718981745538
net.sf.magicproject.xml.tbs7148012021898200
net.sf.magicproject.deckbuilder10577815636563352
net.sf.magicproject.network13507285432889442
net.sf.magicproject.ui.layout10776474848627265
net.sf.magicproject.expression26876457071112548
net.sf.magicproject.clickable.targetable.player5676433828350154
net.sf.magicproject.database7636416352258211
net.sf.magicproject.operation281166018541621021
net.sf.magicproject.action.targetlist2376590524754455
net.sf.magicproject.xml.test35375546969511690
net.sf.magicproject.action.intlist1963540424814398
net.sf.magicproject.token1742448483396845
net.sf.magicproject.xml.event28284185657062556
net.sf.magicproject.xml.expression28284135656314557
net.sf.magicproject.action.target7514112429924146
net.sf.magicproject.clickable.action3262892217016100
net.sf.magicproject.clickable.mana227230252182357
net.sf.magicproject.xml.modifier11112232221917216
net.sf.magicproject.action.context1032215382856229
net.sf.magicproject.chart739209231231165
net.sf.magicproject.chart.datasets52518919122518
net.sf.magicproject.event.phase533186232540157
net.sf.magicproject.database.propertyconfig724164211453129
net.sf.magicproject.expression.intlist1019151191630218
net.sf.magicproject.clickable.targetable23214133218762
net.sf.magicproject.ui.i18n322137241595105
net.sf.magicproject.action.objectmap5221351199094
net.sf.magicproject.event.context43612928230184
net.sf.magicproject.mail391189531374
net.sf.magicproject.expression.targetlist612101131140125
net.sf.magicproject.management2121001398442
net.sf.magicproject.ui.component.task415861291579
net.sf.magicproject.database.data5168514121090
fabdouglas1382421718
net.sf.magicproject.stack.phasetype4859101031103
net.sf.magicproject.action.listener72850232100126
org.mortbay.util1343446120
net.sf.magicproject.action.handler61140171910108
net.sf.magicproject.clickable11135741518
net.sf.magicproject.annotation00700027
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
803396037030314628217209320918

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
net.sf.magicproject.xml.Oracle2Xml167516012
net.sf.magicproject.clickable.targetable.card.MCard63891066
net.sf.magicproject.stack.StackManager49251150
net.sf.magicproject.DeckBuilder44523013
net.sf.magicproject.stack.ActionManager42438035
net.sf.magicproject.xml.tbs.Tbs413707
net.sf.magicproject.tools.MToolKit39852053
net.sf.magicproject.Magic3611018
net.sf.magicproject.ui.MagicUIComponents359427
net.sf.magicproject.clickable.targetable.card.VirtualCard3401709
net.sf.magicproject.clickable.targetable.player.Player32844026
net.sf.magicproject.xml.XmlTools32229028
net.sf.magicproject.xml.XmlParser3075326
net.sf.magicproject.test.TestOn25718017
net.sf.magicproject.action.target.ChoosenTarget2512208
net.sf.magicproject.action.MoveCard2421405
net.sf.magicproject.zone.MZone23645039
net.sf.magicproject.action.PayMana2272307
net.sf.magicproject.stack.EventManager21810711
net.sf.magicproject.clickable.targetable.card.CardFactory19411012
net.sf.magicproject.stack.MPhase18127017
net.sf.magicproject.ui.layout.SectorLayout17118014
net.sf.magicproject.xml.tbs.Card168102
net.sf.magicproject.action.ActionFactory167506
net.sf.magicproject.tools.RevertedArrayList1652604
net.sf.magicproject.ui.component.ChatArea1631104
net.sf.magicproject.database.DatabaseFactory160909
net.sf.magicproject.clickable.targetable.card.TriggeredCard15833011
net.sf.magicproject.xml.XmlConfiguration156809
net.sf.magicproject.database.DatabaseCard15427026

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
net.sf.magicproject.clickable.targetable.card.MCard63891066
net.sf.magicproject.tools.MToolKit39852053
net.sf.magicproject.stack.StackManager49251150
net.sf.magicproject.zone.MZone23645039
net.sf.magicproject.clickable.targetable.player.Player32844026
net.sf.magicproject.stack.ActionManager42438035
net.sf.magicproject.clickable.ability.Ability12436031
net.sf.magicproject.clickable.targetable.card.TriggeredCard15833011
net.sf.magicproject.clickable.targetable.Targetable9830030
net.sf.magicproject.clickable.targetable.card.LastKnownCard792903
net.sf.magicproject.xml.XmlTools32229028
net.sf.magicproject.database.DatabaseCard15427026
net.sf.magicproject.stack.MPhase18127017
net.sf.magicproject.clickable.targetable.card.CardModelImpl1132608
net.sf.magicproject.tools.RevertedArrayList1652604
net.sf.magicproject.ui.MListModel9724023
net.sf.magicproject.action.PayMana2272307
net.sf.magicproject.DeckBuilder44523013
net.sf.magicproject.tools.Log11623023
net.sf.magicproject.action.target.ChoosenTarget2512208
net.sf.magicproject.clickable.targetable.card.AbstractCard5922018
net.sf.magicproject.tools.MCardCompare7420015
net.sf.magicproject.event.MEventListener5719018
net.sf.magicproject.clickable.ability.UserAbility1121805
net.sf.magicproject.test.TestOn25718017
net.sf.magicproject.ui.layout.SectorLayout17118014
net.sf.magicproject.clickable.targetable.card.CardModel1817015
net.sf.magicproject.clickable.targetable.card.VirtualCard3401709
net.sf.magicproject.stack.TargetedList8417017
net.sf.magicproject.AbstractMainForm741606

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
36.4637,030.000.044.933.92

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
net.sf.magicproject.xml.Oracle2Xml.serialize(File,File,File)7761750
net.sf.magicproject.xml.Oracle2Xml.writeActions(PrintWriter,String,boolean,boolean)5701710
net.sf.magicproject.xml.tbs.Tbs.buildMdb(Node,OutputStream)363901
net.sf.magicproject.ui.MagicUIComponents.initComponents()280141
net.sf.magicproject.stack.ActionManager.playNextAction()177920
net.sf.magicproject.xml.tbs.Card.buildMdb(Node,OutputStream)167641
net.sf.magicproject.clickable.targetable.card.VirtualCard.getTooltipString()149531
net.sf.magicproject.test.TestOn.getTargetable(Ability,MCard,ContextEventListener,Targetable)1461451
net.sf.magicproject.DeckBuilder.DeckBuilder()14251
net.sf.magicproject.Magic.actionPerformed(ActionEvent)139500
net.sf.magicproject.ui.layout.SectorLayout.layoutContainer(Container)128341
net.sf.magicproject.action.ActionFactory.readAction(InputStream,Modifier)1231201
net.sf.magicproject.ui.wizard.About.About(JFrame)11721
net.sf.magicproject.network.Client.run()115280
net.sf.magicproject.test.TestFactory.readNextTest(InputStream)1131081
net.sf.magicproject.network.Server.run()104290
net.sf.magicproject.action.target.ChoosenTarget.init(ActionContextWrapper,ContextEventListener,Ability)102321
net.sf.magicproject.xml.action.Targetlist.buildMdb(XmlParser.Node,OutputStream)95221
net.sf.magicproject.xml.action.Intlist.buildMdb(XmlParser.Node,OutputStream)94331
net.sf.magicproject.DeckBuilder.actionPerformed(ActionEvent)91321
net.sf.magicproject.clickable.targetable.card.VirtualCard.paintComponent(Graphics)88340
net.sf.magicproject.Magic.Magic()85191
net.sf.magicproject.action.PayMana.choose(ActionContextWrapper,ContextEventListener,Ability)74340
net.sf.magicproject.network.MSocketListener.run()70240
net.sf.magicproject.stack.EventManager.gotoNextPhase()69251
net.sf.magicproject.Magic.main(String[])68211
net.sf.magicproject.operation.OperationFactory.getOperation(int)68661
net.sf.magicproject.clickable.targetable.player.Player.Player(int,ManaPool,ZoneManager,JPanel)6711
net.sf.magicproject.ui.component.SplashScreen.SplashScreen(String,Frame,int)6741
net.sf.magicproject.stack.EventManager.init()6611

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
37,030.006.632.790.59

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