Skip to content

Available Code Metrics

Felipe Gustavo De Souza Gomes edited this page Oct 7, 2017 · 4 revisions

Here you will find informations about the code metrics that are currently supported. All the metrics implementations can be found in the project rm-core at the package org.repositoryminer.metric.

Metric Description Applies To Data Type
AMW - Average Method Weight The average static complexity of all methods in a class. McCabe’s cyclomatic number is used to quantify the method’s complexity [1]. Classes Float*
ATFD - Access To Foreign Data The number of attributes from unrelated classes that are accessed directly or by invoking accessor methods [1]. Classes and Methods Integer
CYCLO - McCabe’s Cyclomatic Number he number of linearly-independent paths through an operation [1]. Methods Integer
FDP - Foreign Data Providers The number of classes in which the attributes accessed — in conformity with the ATFD metric — are defined [1]. Methods Integer
LAA - Locality of Attribute Accesses The number of attributes from the method’s definition class, divided by the total number of variables accessed (including attributes used via accessor methods, see ATFD), whereby the number of local attributes accessed is computed in conformity with the LAA specifications [1]. Methods Float*
LOC - Lines of Code The number of lines of code of an operation, including blank lines and comment [1]. Files, Classes and Methods Integer
LVAR - Local Variables Number of local variables of a method. Methods Integer
MAXNESTING - Maximum Nesting Level The maximum nesting level of control structures within an operation [1]. Methods Integer
NOA - Number of Attributes Number of attributes of a class [2]. Classes Integer
NOAM - Number of Accessor Methods The number of accessor (getter and setter) methods of a class [1]. Methods Integer
NOAV - Number of Accessed Variables The total number of variables accessed directly from the measured operation. Variables include parameters, local variables, but also instance variables and global variables [1]. Methods Integer
NOM - Number of Methods Number of methods of a class [1]. Classes Integer
NOPA - Number of Public Attributes The number of public attributes of a class [1]. Classes Integer
NProtM - Number of Protected Members The number of protected methods and attributes of a class [1]. Classes Integer
PAR - Number of Parameters Number of parameters of a method [3]. Methods Integer
TCC - Tight Class Cohesion The relative number of method pairs of a class that access in common at least one attribute of the measured class [1]. Classes Float*
WMC - Weighted Method Count The sum of the statical complexity of all methods of a class. The CYCLO metric is used to quantify the method’s complexity [1]. Classes Integer
WOC - Weight Of a Class The number of “functional” public methods divided by the total number of public members [1]. Classes Float*

Notes

* Float with 2 decimal places

References

[1] - LANZA, M.; MARINESCU, R. Object-oriented metrics in practice: using software me- trics to characterize, evaluate, and improve the design of object-oriented systems. [S.l.]: Springer Science & Business Media, 2007.

[2] - OLIVEIRA, P.; VALENTE, M. T.; LIMA, F. P. Extracting relative thresholds for source code metrics. In: IEEE. Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE), 2014 Software Evolution Week-IEEE Conference on. [S.l.], 2014. p. 254–263.

[3] - FILÓ, T.; BIGONHA, M. da S.; FERREIRA, K. A catalogue of thresholds for object- oriented software metrics. In: The First Int. Conf. on Advances and Trends in Software Engineering. [S.l.: s.n.], 2015. p. 48–55.