CKJM Chidamber and Kemerer Java Metrics

Designed for use with CKJM and Ant.


Top 25: wmc

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.jdbc.jdbcDatabaseMetaData172106197146921165
org.hsqldb.jdbc.jdbcResultSet1471018198103335139
org.hsqldb.Table142224133081174624
org.hsqldb.Expression901022190581182
org.hsqldb.jdbc.jdbcCallableStatement833071213397181
org.hsqldb.DatabaseCommandInterpreter721044301021
org.hsqldb.Server7211231871896545
org.hsqldb.Library711061392473564
org.hsqldb.Parser60102719184240
org.hsqldb.Result60101210410543627
org.hsqldb.Session59102915710974214
org.hsqldb.Database59102914913873518
org.hsqldb.jdbc.jdbcPreparedStatement5121221291111245
org.hsqldb.util.DatabaseManagerSwing476012244849518
org.hsqldb.jdbc.jdbcConnection46101693837838
org.hsqldb.DITableInfo4310990010
org.hsqldb.Column421014131769237
org.hsqldb.DITypeInfo4210363040
org.hsqldb.jdbc.jdbcStatement4111862654337
org.hsqldb.lib.ArrayUtil40101557781936
org.hsqldb.Index40101267396162
org.hsqldb.util.SqlFile3710817540266
org.hsqldb.HsqlDateTime35101734771224
org.hsqldb.lib.DoubleIntIndex34102400221
org.hsqldb.util.TableSorter3420879377519

Top 25: dit

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.util.ZaurusConnectionDialog11601554317
org.hsqldb.util.DatabaseManagerSwing476012244849518
org.hsqldb.util.FontDialogSwing860968286
org.hsqldb.util.ConnectionDialogSwing8603871415
org.hsqldb.util.ZaurusDatabaseManager116071052507
org.hsqldb.util.Transfer31508143269214
org.hsqldb.rowio.RowOutputTextQuoted350210311
org.hsqldb.util.ConnectionDialog11514703554
org.hsqldb.util.DatabaseManager32517190336116
org.hsqldb.rowio.RowInputTextQuoted350317112
org.hsqldb.util.QueryTool21502102170012
org.hsqldb.rowio.RowOutputText294186133829
hsqlServlet14012001
org.hsqldb.rowio.RowInputBinary234095024399
org.hsqldb.util.ZaurusEditor13401783025
org.hsqldb.rowio.RowOutputBinary324010704781116
org.hsqldb.HsqlInternalException14015020
org.hsqldb.rowio.RowInputText254194927229
org.hsqldb.util.Tree184005375214
org.hsqldb.rowio.RowOutputTextLog2740751325111
org.hsqldb.util.SqlFile$ContinueException24024012
org.hsqldb.util.SqlFile$QuitNow24024012
org.hsqldb.util.SqlFile$BreakException24024012
org.hsqldb.util.ZaurusTextField9401152419
org.hsqldb.util.Grid2340053121316

Top 25: noc

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.store.BaseHashMap26182410173
org.hsqldb.util.TransferHelper1716438116110
org.hsqldb.rowio.RowInputBase2633532313413
org.hsqldb.rowio.RowOutputBase28331037372313
org.hsqldb.util.SqlToolError33306353
org.hsqldb.lib.BaseList6133161343
org.hsqldb.scriptio.ScriptReaderBase1612820120412
org.hsqldb.Table142224133081174624
org.hsqldb.BaseMemoryNode13223155220
org.hsqldb.Node211292720890
org.hsqldb.util.DataAccessPoint191272715153
org.hsqldb.scriptio.ScriptWriterBase30122073405516
org.hsqldb.Servlet631953714
org.hsqldb.rowio.RowOutputText294186133829
org.hsqldb.lib.HsqlByteArrayInputStream2521134190325
org.hsqldb.scriptio.ScriptReaderBinary112111402122
org.hsqldb.CachedRow20211138781114
org.hsqldb.persist.HsqlProperties2811573962227
org.hsqldb.util.ConnectionDialog11514703554
org.hsqldb.HSQLClientConnection20111146136212
org.hsqldb.util.DatabaseManager32517190336116
org.hsqldb.Server7211231871896545
org.hsqldb.DatabaseInformation9115192640
org.hsqldb.rowio.RowInputText254194927229
org.hsqldb.HsqlException6311110866

Top 25: cbo

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.DatabaseCommandInterpreter721044301021
org.hsqldb.Table142224133081174624
org.hsqldb.DatabaseInformationFull293041182000
org.hsqldb.DatabaseInformationMain302133187010
org.hsqldb.Session59102915710974214
org.hsqldb.Database59102914913873518
org.hsqldb.Parser60102719184240
org.hsqldb.DatabaseScript1110271025522
org.hsqldb.persist.DataFileCache321124118236922
org.hsqldb.DINameSpace32102410931431
org.hsqldb.Server7211231871896545
org.hsqldb.persist.DataFileDefrag4102354010
org.hsqldb.persist.Log3310221099810
org.hsqldb.persist.TextCache182022837357
org.hsqldb.Expression901022190581182
org.hsqldb.CompiledStatementExecutor10102253010
org.hsqldb.jdbc.jdbcPreparedStatement5121221291111245
org.hsqldb.scriptio.ScriptWriterBase30122073405516
org.hsqldb.TableWorks11102072020
org.hsqldb.Select291018108108122
org.hsqldb.jdbc.jdbcResultSet1471018198103335139
org.hsqldb.View93017361060
org.hsqldb.DatabaseManager22101785149126
org.hsqldb.jdbc.jdbcConnection46101693837838
org.hsqldb.Function231016907951

Top 25: rfc

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.Table142224133081174624
org.hsqldb.DatabaseCommandInterpreter721044301021
org.hsqldb.util.DatabaseManagerSwing476012244849518
org.hsqldb.jdbc.jdbcResultSet1471018198103335139
org.hsqldb.jdbc.jdbcDatabaseMetaData172106197146921165
org.hsqldb.Parser60102719184240
org.hsqldb.util.DatabaseManager32517190336116
org.hsqldb.Expression901022190581182
org.hsqldb.Server7211231871896545
org.hsqldb.DatabaseInformationMain302133187010
org.hsqldb.DatabaseInformationFull293041182000
org.hsqldb.util.SqlFile3710817540266
org.hsqldb.Session59102915710974214
org.hsqldb.Database59102914913873518
org.hsqldb.util.Transfer31508143269214
org.hsqldb.Library711061392473564
org.hsqldb.Column421014131769237
org.hsqldb.jdbc.jdbcPreparedStatement5121221291111245
org.hsqldb.jdbc.jdbcCallableStatement833071213397181
org.hsqldb.persist.DataFileCache321124118236922
org.hsqldb.persist.Log3310221099810
org.hsqldb.DINameSpace32102410931431
org.hsqldb.Select291018108108122
org.hsqldb.util.ZaurusDatabaseManager116071052507
org.hsqldb.Result60101210410543627

Top 25: lcom

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.jdbc.jdbcDatabaseMetaData172106197146921165
org.hsqldb.jdbc.jdbcResultSet1471018198103335139
org.hsqldb.Table142224133081174624
org.hsqldb.jdbc.jdbcCallableStatement833071213397181
org.hsqldb.Library711061392473564
org.hsqldb.Server7211231871896545
org.hsqldb.Database59102914913873518
org.hsqldb.jdbc.jdbcPreparedStatement5121221291111245
org.hsqldb.Session59102915710974214
org.hsqldb.Result60101210410543627
org.hsqldb.util.DatabaseManagerSwing476012244849518
org.hsqldb.Parser60102719184240
org.hsqldb.jdbc.jdbcConnection46101693837838
org.hsqldb.lib.ArrayUtil40101557781936
org.hsqldb.Column421014131769237
org.hsqldb.jdbc.jdbcStatement4111862654337
org.hsqldb.Expression901022190581182
org.hsqldb.rowio.RowOutputBinary324010704781116
org.hsqldb.HsqlDateTime35101734771224
org.hsqldb.scriptio.ScriptWriterBase30122073405516
org.hsqldb.util.SqlFile3710817540266
org.hsqldb.Index40101267396162
org.hsqldb.util.TableSorter3420879377519
org.hsqldb.rowio.RowOutputBase28331037372313
org.hsqldb.DIProcedureInfo311076434911

Top 25: ca

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.HsqlException6311110866
org.hsqldb.Trace24103522646615
org.hsqldb.Table142224133081174624
org.hsqldb.Session59102915710974214
org.hsqldb.lib.Iterator5100510405
org.hsqldb.Result60101210410543627
org.hsqldb.Database59102914913873518
org.hsqldb.HsqlNameManager$HsqlName151053771334
org.hsqldb.Column421014131769237
org.hsqldb.persist.HsqlProperties2811573962227
org.hsqldb.lib.HashSet1021420452210
org.hsqldb.lib.HsqlArrayList162043002115
org.hsqldb.lib.ArrayUtil40101557781936
org.hsqldb.Result$ResultMetaData121032036181
org.hsqldb.Types21105491961815
org.hsqldb.NumberSequence13101160184
org.hsqldb.lib.Set1010210451810
org.hsqldb.lib.HashMap1321625761811
org.hsqldb.Expression901022190581182
org.hsqldb.store.BaseHashMap26182410173
org.hsqldb.Row22117251971715
org.hsqldb.Record110020160
org.hsqldb.store.ValuePool1410128591611
org.hsqldb.Index40101267396162
org.hsqldb.lib.Collection8101828158

Top 25: npm

[wmc] [dit] [noc] [cbo] [rfc] [lcom] [ca] [npm] [explanations]
namewmcditnoccborfclcomcanpm
org.hsqldb.jdbc.jdbcDatabaseMetaData172106197146921165
org.hsqldb.jdbc.jdbcResultSet1471018198103335139
org.hsqldb.jdbc.jdbcCallableStatement833071213397181
org.hsqldb.Library711061392473564
org.hsqldb.Server7211231871896545
org.hsqldb.jdbc.jdbcPreparedStatement5121221291111245
org.hsqldb.jdbc.jdbcConnection46101693837838
org.hsqldb.jdbc.jdbcStatement4111862654337
org.hsqldb.lib.ArrayUtil40101557781936
org.hsqldb.persist.HsqlProperties2811573962227
org.hsqldb.Result60101210410543627
org.hsqldb.lib.HsqlByteArrayOutputStream292114101527
org.hsqldb.lib.HsqlByteArrayInputStream2521134190325
org.hsqldb.persist.Logger2410146601224
org.hsqldb.HsqlDateTime35101734771224
org.hsqldb.Table142224133081174624
org.hsqldb.jdbc.jdbcResultSetMetaData27107530222
org.hsqldb.persist.DataFileCache321124118236922
org.hsqldb.lib.FileUtil22104462311321
org.hsqldb.lib.DoubleIntIndex34102400221
org.hsqldb.util.TableSorter3420879377519
org.hsqldb.util.DatabaseManagerSwing476012244849518
org.hsqldb.Database59102914913873518
org.hsqldb.lib.HsqlTimer2210654205617
org.hsqldb.rowio.RowOutputBinary324010704781116

Explanations

WMC - Weighted methods per class
A class's weighted methods per class WMC metric is simply the sum of the complexities of its methods. As a measure of complexity we can use the cyclomatic complexity, or we can abritrarily assign a complexity value of 1 to each method. The ckjm program assigns a complexity value of 1 to each method, and therefore the value of the WMC is equal to the number of methods in the class.
DIT - Depth of Inheritance Tree
The depth of inheritance tree (DIT) metric provides for each class a measure of the inheritance levels from the object hierarchy top. In Java where all classes inherit Object the minimum value of DIT is 1.
NOC - Number of Children
A class's number of children (NOC) metric simply measures the number of immediate descendants of the class.
CBO - Coupling between object classes
The coupling between object classes (CBO) metric represents the number of classes coupled to a given class. This coupling can occur through method calls, field accesses, inheritance, arguments, return types, and exceptions.
RFC - Response for a Class
The metric called the response for a class (RFC) measures the number of different methods that can be executed when an object of that class receives a message (when a method is invoked for that object). Ideally, we would want to find for each method of the class, the methods that class will call, and repeat this for each called method, calculating what is called the transitive closure of the method's call graph. This process can however be both expensive and quite inaccurate. In ckjm, we calculate a rough approximation to the response set by simply inspecting method calls within the class's method bodies. This simplification was also used in the 1994 Chidamber and Kemerer description of the metrics.
LCOM - Lack of cohesion in methods
A class's lack of cohesion in methods (LCOM) metric counts the sets of methods in a class that are not related through the sharing of some of the class's fields. The original definition of this metric (which is the one used in ckjm) considers all pairs of a class's methods. In some of these pairs both methods access at least one common field of the class, while in other pairs the two methods to not share any common field accesses. The lack of cohesion in methods is then calculated by subtracting from the number of method pairs that don't share a field access the number of method pairs that do. Note that subsequent definitions of this metric used as a measurement basis the number of disjoint graph components of the class's methods. Others modified the definition of connectedness to include calls between the methods of the class. The program ckjm follows the original (1994) definition by Chidamber and Kemerer.
Ca - Afferent couplings
A class's afferent couplings is a measure of how many other classes use the specific class. Ca is calculated using the same definition as that used for calculating CBO.
NPM - Number of Public Methods
The NPM metric simply counts all the methods in a class that are declared as public. It can be used to measure the size of an API provided by a package.