summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-squid-java-plugin
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-11-21 19:18:32 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2011-11-21 19:18:32 +0100
commitbd6a64011a3003c577089a494be31fc95b9e7fc6 (patch)
tree444184b2e69ede41a083bb0fde34212b1d7e8003 /plugins/sonar-squid-java-plugin
parent038521049d805ff6cf1b9d2cf98dcf59b8d665db (diff)
downloadsonarqube-bd6a64011a3003c577089a494be31fc95b9e7fc6.tar.gz
sonarqube-bd6a64011a3003c577089a494be31fc95b9e7fc6.zip
Add comment to ChidamberKemererBridge
Diffstat (limited to 'plugins/sonar-squid-java-plugin')
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChidamberKemererBridge.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChidamberKemererBridge.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChidamberKemererBridge.java
index a262b639b5d..abcb04d99a6 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChidamberKemererBridge.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChidamberKemererBridge.java
@@ -39,6 +39,9 @@ public class ChidamberKemererBridge extends Bridge {
}
static double getLcom4(SourceFile squidFile) {
+ // Squid API does not support null values, so sometimes it returns LCOM4 values with value 0. It occurs
+ // for example with files without any classes, like package-info.java.
+ // Minimum value must be 1.
return Math.max(squidFile.getDouble(Metric.LCOM4), 1.0);
}
}