]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2432 Tune best and worst values for coverage metrics
authorEvgeny Mandrikov <mandrikov@gmail.com>
Thu, 19 May 2011 20:19:10 +0000 (00:19 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Thu, 19 May 2011 20:28:12 +0000 (00:28 +0400)
* Define "0" best value on uncovered_lines, uncovered_conditions,
  new_uncovered_lines and new_uncovered_conditions

* Define "100" best value and "0" worst value on line_coverage

sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java

index cd5c6f0bf752eff9eccf391f496d538608348011..f0ae320ab209981c126c39becfd376646134ffa5 100644 (file)
@@ -299,6 +299,7 @@ public final class CoreMetrics {
       .setDirection(Metric.DIRECTION_WORST)
       .setDomain(DOMAIN_TESTS)
       .setFormula(new SumChildValuesFormula(false))
+      .setBestValue(0.0)
       .create();
 
   public static final String NEW_UNCOVERED_LINES_KEY = "new_uncovered_lines";
@@ -307,6 +308,7 @@ public final class CoreMetrics {
       .setDirection(Metric.DIRECTION_WORST)
       .setDomain(DOMAIN_TESTS)
       .setFormula(new SumChildValuesFormula(false))
+      .setBestValue(0.0)
       .create();
 
   public static final String LINE_COVERAGE_KEY = "line_coverage";
@@ -315,6 +317,8 @@ public final class CoreMetrics {
       .setDirection(Metric.DIRECTION_BETTER)
       .setQualitative(true)
       .setDomain(DOMAIN_TESTS)
+      .setWorstValue(0.0)
+      .setBestValue(100.0)
       .create();
 
   public static final String NEW_LINE_COVERAGE_KEY = "new_line_coverage";
@@ -365,6 +369,7 @@ public final class CoreMetrics {
       .setDirection(Metric.DIRECTION_WORST)
       .setDomain(DOMAIN_TESTS)
       .setFormula(new SumChildValuesFormula(false))
+      .setBestValue(0.0)
       .create();
 
   public static final String NEW_UNCOVERED_CONDITIONS_KEY = "new_uncovered_conditions";
@@ -373,6 +378,7 @@ public final class CoreMetrics {
       .setDirection(Metric.DIRECTION_WORST)
       .setDomain(DOMAIN_TESTS)
       .setFormula(new SumChildValuesFormula(false))
+      .setBestValue(0.0)
       .create();
 
   public static final String BRANCH_COVERAGE_KEY = "branch_coverage";