From 878cb606b0f6ce51ec2ca3af761968fccbb880ce Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Fri, 20 May 2011 00:19:10 +0400 Subject: [PATCH] SONAR-2432 Tune best and worst values for coverage metrics * 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 --- .../src/main/java/org/sonar/api/measures/CoreMetrics.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java index cd5c6f0bf75..f0ae320ab20 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java @@ -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"; -- 2.39.5