diff --git a/src/main/java/org/jpeek/App.java b/src/main/java/org/jpeek/App.java
index c23fb5dd..5ceac544 100644
--- a/src/main/java/org/jpeek/App.java
+++ b/src/main/java/org/jpeek/App.java
@@ -68,12 +68,12 @@
* @checkstyle MethodLengthCheck (500 lines)
* @checkstyle JavaNCSSCheck (500 lines)
*
- * @todo #9:30min LCC metric has impediments (see puzzles in LCC.xml).
+ * @todo #9:30min LCC metric has impediments (see puzzles in LCC.xsl).
* Once they are resolved, cover the metric with autotests and add it
* to reports list.
* (details on how to test the metrics are to be negotiated here - #107)
*
- * @todo #17:30min MWE metric has impediments (see puzzles in MWE.xml).
+ * @todo #17:30min MWE metric has impediments (see puzzles in MWE.xsl).
* Once they are resolved, cover the metric with autotests and add it
* to reports list.
* (details on how to test the metrics are to be negotiated here - #107)
@@ -124,7 +124,8 @@ public App(final Path source, final Path target) {
new MapEntry<>("MMAC", true),
new MapEntry<>("OCC", true),
new MapEntry<>("PCC", true),
- new MapEntry<>("TCC", true)
+ new MapEntry<>("TCC", true),
+ new MapEntry<>("LCC", true)
)
);
}
@@ -257,6 +258,14 @@ public void analyze() throws IOException {
)
);
}
+ if (this.params.containsKey("LCC")) {
+ reports.add(
+ new Report(
+ chain.transform(skeleton),
+ "LCC"
+ )
+ );
+ }
new IoCheckedScalar<>(
new AndInThreads(
report -> {
diff --git a/src/main/resources/org/jpeek/metrics/LCC.xsl b/src/main/resources/org/jpeek/metrics/LCC.xsl
index 785980f4..5653321d 100644
--- a/src/main/resources/org/jpeek/metrics/LCC.xsl
+++ b/src/main/resources/org/jpeek/metrics/LCC.xsl
@@ -26,33 +26,35 @@ SOFTWARE.
- TCC
+ LCCLCC(C) = (NDC(C) + NIC(C)) / NP(C), where C is the class, NP(C) is a
maximal possible number of direct or indirect connections - N * (N - 1) / 2,
- NDC(C) is a number of direct connections, NID(C) is a number of indirect
- connections. Value of the metric is in range [0, 1], greater is better.
+ NDC(C) is a number of direct connections,
+ NIC(C) is a number of indirect connections.
+ Value of the metric is in range [0, 1], greater is better.
-
+
+
-
+
-
-
-
-
+
+
+
+
@@ -70,8 +72,8 @@ SOFTWARE.
-->
-
+
@@ -86,6 +88,9 @@ SOFTWARE.
+
+
+
diff --git a/src/main/resources/org/jpeek/metrics/TCC.xsl b/src/main/resources/org/jpeek/metrics/TCC.xsl
index 18879aac..20e6c907 100644
--- a/src/main/resources/org/jpeek/metrics/TCC.xsl
+++ b/src/main/resources/org/jpeek/metrics/TCC.xsl
@@ -30,8 +30,8 @@ SOFTWARE.
TCC(C) = NDC(C) / NP(C), where C is the class, NP(C) is a
maximal possible number of direct or indirect connections - N * (N - 1) / 2,
- NDC(C) is a number of direct connections. Value of the metric is in range [0, 1],
- greater is better.
+ NDC(C) is a number of direct connections.
+ Value of the metric is in range [0, 1], greater is better.
@@ -80,7 +80,8 @@ SOFTWARE.
0
-
+
+
diff --git a/src/test/java/org/jpeek/MetricsTest.java b/src/test/java/org/jpeek/MetricsTest.java
index cdda6a7a..ddf7a4b4 100644
--- a/src/test/java/org/jpeek/MetricsTest.java
+++ b/src/test/java/org/jpeek/MetricsTest.java
@@ -87,7 +87,20 @@ public final class MetricsTest {
@Parameterized.Parameters(name = "{0}:{1}:{2}")
public static Collection