diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-07-10 17:20:58 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-07-10 17:20:58 +0200 |
commit | 239c1c798c2c7685ab71c1b063072dab0be06aae (patch) | |
tree | 1226f18b272474a227dd473d9857720aaca18da1 /sonar-plugin-api | |
parent | e1f4102e815edcf784fba3387613079cfed76559 (diff) | |
download | sonarqube-239c1c798c2c7685ab71c1b063072dab0be06aae.tar.gz sonarqube-239c1c798c2c7685ab71c1b063072dab0be06aae.zip |
SONAR-5445 Introduce new metric "SQALE Debt Ratio"
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java | 17 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java | 2 |
2 files changed, 18 insertions, 1 deletions
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 c0d57a89728..2545bd0699a 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 @@ -2155,6 +2155,23 @@ public final class CoreMetrics { .setHidden(true) .create(); + /** + * @since 4.5 + */ + public static final String SQALE_DEBT_RATIO_KEY = "sqale_debt_ratio"; + + /** + * @since 4.5 + */ + public static final Metric<Double> SQALE_DEBT_RATIO = new Metric.Builder(SQALE_DEBT_RATIO_KEY, "SQALE Technical Debt Ratio", Metric.ValueType.PERCENT) + .setDescription("Ratio of the technical debt compared to what it would cost to develop the whole source code from scratch.") + .setDomain(DOMAIN_TECHNICAL_DEBT) + .setDirection(Metric.DIRECTION_WORST) + .setOptimizedBestValue(true) + .setBestValue(0.0) + .setQualitative(true) + .create(); + // -------------------------------------------------------------------------------------------------------------------- // // FILE DATA diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java index 086005be0f8..6d4156dc668 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java @@ -32,7 +32,7 @@ public class CoreMetricsTest { @Test public void read_metrics_from_class_reflection() { List<Metric> metrics = CoreMetrics.getMetrics(); - assertThat(metrics).hasSize(152); + assertThat(metrics).hasSize(153); assertThat(metrics).contains(CoreMetrics.NCLOC, CoreMetrics.DIRECTORIES); } |