Skip to content

Commit b6066fe

Browse files
committed
Reordering Metrics + more description
1 parent e65b46e commit b6066fe

2 files changed

Lines changed: 20 additions & 17 deletions

File tree

src/com/reveal/codetimemachine/Commits3DView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public Commits3DView(Project project, VirtualFile virtualFile, ArrayList<CommitW
110110
this.project = project;
111111
this.virtualFile = virtualFile;
112112
this.commitList = commitList;
113-
this.currentMetric = CKNumberReader.MetricTypes.NONE;
113+
this.currentMetric = CKNumberReader.MetricTypes.loc;
114114
this.maxCKNumber = maxCKNumber;
115115
this.fullMetricsReport = fullMetricsReport;
116116

src/com/reveal/metrics/CKNumberReader.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,29 @@ public class CKNumberReader
99

1010
private final int INVALID = -1;
1111

12+
// Rearrange enum to change the order of display.
13+
// Remember to keep `MetricTypes_StringRepresntation` variable in sync.
1214
public static enum MetricTypes
13-
{NONE, dit, noc, wmc, cbo, lcom, rfc, nom, nopm, nosm, nof, nopf, nosf, nosi, loc /*update getValueForMetric(..) after addding new item here*/};
15+
{loc,wmc, dit, noc, cbo, lcom, rfc, nom, nopm, nosm, nof, nopf, nosf, nosi,NONE /*update getValueForMetric(..) after adding new item here*/};
1416

17+
// Keep in sync with above enum
1518
public static String[] MetricTypes_StringRepresntation =
1619
{
17-
"",
18-
"Depth Inheritance Tree",
19-
"Number of Children",
20-
"Weight Method Class",
21-
"Coupling between objects",
22-
"Lack of Cohesion of Methods",
23-
"Response for a Class",
24-
"Number of methods",
25-
"Number of public methods",
26-
"Number of static methods",
27-
"Number of fields",
28-
"Number of public fields",
29-
"Number of static fields",
30-
"Number of static invocations",
31-
"Line of code"
20+
"Line of Code",/*LOC: It counts the lines of count, ignoring empty lines.*/
21+
"Class Cyclomatic Complexity",/*WMC: Weight Method Class or McCabe's complexity. It counts the number of branch instructions in a class.*/
22+
"Depth of Inheritance Tree",/*DIT: It counts the number of "fathers" a class has. All classes have DIT at least 1 (everyone inherits java.lang.Object). In order to make it happen, classes must exist in the project (i.e. if a class depends upon X which relies in a jar/dependency file, and X depends upon other classes, DIT is counted as 2).*/
23+
"Number of Children", /*NOC: Counts the number of children a class has.*/
24+
"Coupling Between Objects", /*CBO: Counts the number of dependencies a class has. The tools checks for any type used in the entire class (field declaration, method return types, variable declarations, etc). It ignores dependencies to Java itself (e.g. java.lang.String)*/
25+
"Lack of Cohesion of Methods", /*LCOM: This is the very first version of metric, which is not reliable. LCOM-HS can be better (hopefully, you will send us a pull request)*/
26+
"Response for a Class",/*RFC: Counts the number of unique method invocations in a class. As invocations are resolved via static analysis, this implementation fails when a method has overloads with same number of parameters, but different types.*/
27+
"Number of Methods",
28+
"Number of Public Methods",
29+
"Number of Static Methods",
30+
"Number of Fields",
31+
"Number of Public Fields",
32+
"Number of Static Fields",
33+
"Number of Static Invocations", /*NOSI: Counts the number of invocations to static methods. It can only count the ones that can be resolved by the JDT*/
34+
""
3235
};
3336

3437
static CKNumberReader instance = new CKNumberReader();

0 commit comments

Comments
 (0)