Metric Thresholds
Component level and sub-component level thresholds for all metrics Embold supports.
Component level and sub-component level thresholds for all metrics Embold supports.
Response for Class (RFC) is the number of methods that will be executed when any method of the class is invoked. In other words, it as a count of methods implemented by this class (including inherited methods, if any) plus a number of methods called on other classes (excluding base classes). Higher…
Depth of Inheritance Hierarchy (DOIH) is the inheritance level of a class from its topmost class in the hierarchy. It is the maximum length of the path from a class to its root class in the inheritance structure. High DOIH indicates high reuse. However, a high DOIH makes the behaviour unpredictable.
Lines of Code (LOC) as the name suggests is the total number of lines in a class or method. The comment lines and the blank lines are also counted. A longer class is often difficult to maintain. LOC is the most basic metric. Example: LOC is 14 in below code…
Comment Ratio (CR) is simply the ratio of the line of comments to the total number of lines of code. A good comment ratio makes the code easier to understand, maintain and expand. If the comment ratio is too low, the file will be hard to maintain. A new developer…
NOP is the number of parameters used in a method (or function). If a method has too many parameters, it is difficult to call and also difficult to change if it is called from many different clients.
Coupling Between Objects (CBO) is the degree by which one object depends on each of the other objects. The coupling can occur through method calls, field accesses, inheritance, arguments, return types, etc. The degree of coupling should be low. A high value represents poor encapsulation. This makes reuse of components…
Cyclomatic Complexity (CC) is a measure of the program’s complexity achieved by measuring the number of linearly independent paths through a program’s source code. This measure needs to be applied to sections of source like methods of each class. Presence of IF-ELSE statements or SWITCH statements and FOR loops increases…
The number of Public Attributes (NOPA) is the measure of publicly exposed data of a class. It is the count of public fields. Example: Class ‘SimplePojo’ have a NOPA of 19 which is high. /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements.…
Lack of Cohesion of Methods (LCOM) is a measure of cohesiveness of a class. The low LCOM value means the methods in a class is authored to achieve a common goal. Thus, a low LCOM value is desirable as it indicates good encapsulation. LCOM is measured in percent (%). Example:…