diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-12-05 18:04:06 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-01-10 06:48:47 +0100 |
commit | baccb26f1aecd27b7d7fc06a185e7fdeaf03ea83 (patch) | |
tree | f5e3cb8af2a4d355c415a0f8c7b2d459b4d0ccec /sonar-plugin-api/src | |
parent | 01c3e23df232c1006344f4957bf35af92b17a985 (diff) | |
download | sonarqube-baccb26f1aecd27b7d7fc06a185e7fdeaf03ea83.tar.gz sonarqube-baccb26f1aecd27b7d7fc06a185e7fdeaf03ea83.zip |
SONAR-10117 SONAR-1018 Update measures after relevant issue changes and send webhooks
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java | 22 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java | 13 |
2 files changed, 33 insertions, 2 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 d0eccf976e8..2c1545efbd1 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 @@ -2413,8 +2413,26 @@ public final class CoreMetrics { /** * @since 4.5 */ - public static final Metric<String> DEVELOPMENT_COST = new Metric.Builder(DEVELOPMENT_COST_KEY, "SQALE Development Cost", Metric.ValueType.STRING) - .setDescription("SQALE development cost") + public static final Metric<String> DEVELOPMENT_COST = new Metric.Builder(DEVELOPMENT_COST_KEY, "Development Cost", Metric.ValueType.STRING) + .setDescription("Development cost") + .setDomain(DOMAIN_MAINTAINABILITY) + .setDirection(Metric.DIRECTION_WORST) + .setOptimizedBestValue(true) + .setBestValue(0.0) + .setQualitative(true) + .setHidden(true) + .create(); + + /** + * @since 7.0 + */ + public static final String NEW_DEVELOPMENT_COST_KEY = "new_development_cost"; + + /** + * @since 7.0 + */ + public static final Metric<String> NEW_DEVELOPMENT_COST = new Metric.Builder(NEW_DEVELOPMENT_COST_KEY, "Development Cost on New Code", Metric.ValueType.STRING) + .setDescription("Development cost on new code") .setDomain(DOMAIN_MAINTAINABILITY) .setDirection(Metric.DIRECTION_WORST) .setOptimizedBestValue(true) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java index 96d02ed89cf..8605fd9798c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Qualifiers.java @@ -19,8 +19,12 @@ */ package org.sonar.api.resources; +import java.util.List; import java.util.Objects; +import static java.util.Arrays.asList; +import static java.util.Collections.unmodifiableList; + /** * The qualifier determines the exact type of a resource. * Plugins can define their own qualifiers. @@ -70,6 +74,15 @@ public final class Qualifiers { // ugly, should be replaced by "natures" public static final String UNIT_TEST_FILE = "UTS"; + /** + * List of qualifiers, ordered from bottom to up regarding position + * in tree of components + * + * @since 7.0 + */ + public static final List<String> ORDERED_BOTTOM_UP = unmodifiableList(asList( + FILE, UNIT_TEST_FILE, DIRECTORY, MODULE, PROJECT, APP, SUBVIEW, VIEW)); + private Qualifiers() { // only static methods } |