diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-11 15:02:55 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-11 15:02:55 +0100 |
commit | 78191d8da12c5dee05c739def39a40a1771d3a00 (patch) | |
tree | 6a22f5d309ee93cad651ccccc84ad58f0cb3c21c /plugins | |
parent | a231215ec2b547e44092afa347f4739c72dea97f (diff) | |
download | sonarqube-78191d8da12c5dee05c739def39a40a1771d3a00.tar.gz sonarqube-78191d8da12c5dee05c739def39a40a1771d3a00.zip |
LCOM4 must not be 1 when bytecode is not available
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChidamberKemererBridge.java | 7 |
1 files changed, 5 insertions, 2 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 4b09d64d2c6..8a103e593ea 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 @@ -32,12 +32,15 @@ public class ChidamberKemererBridge extends Bridge { super(true); } - @Override public final void onFile(SourceFile squidFile, Resource sonarFile) { context.saveMeasure(sonarFile, CoreMetrics.DEPTH_IN_TREE, squidFile.getDouble(Metric.DIT)); context.saveMeasure(sonarFile, CoreMetrics.NUMBER_OF_CHILDREN, squidFile.getDouble(Metric.NOC)); context.saveMeasure(sonarFile, CoreMetrics.RFC, squidFile.getDouble(Metric.RFC)); - context.saveMeasure(sonarFile, CoreMetrics.LCOM4, squidFile.getDouble(Metric.LCOM4)); + + double lcom4 = squidFile.getDouble(Metric.LCOM4); + if (lcom4>0.0) { + context.saveMeasure(sonarFile, CoreMetrics.LCOM4, lcom4); + } } } |