aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-08-16 12:15:04 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-08-16 13:58:44 +0200
commit3b68b76704109654e105a393105aa41ced907890 (patch)
tree462a706a061e3e9ec735495a9531ff2f7000d65f /sonar-plugin-api
parent7730cf3831bc22de8a01a45c68cfac9548bad906 (diff)
downloadsonarqube-3b68b76704109654e105a393105aa41ced907890.tar.gz
sonarqube-3b68b76704109654e105a393105aa41ced907890.zip
SONAR-7953 New metric « New Duplicated Lines (%) »
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java24
1 files changed, 22 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 58bce43ac4b..4289ac363e3 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
@@ -1332,11 +1332,12 @@ public final class CoreMetrics {
/**
* @since 6.1
*/
- public static final String NEW_LINES_DUPLICATED_KEY = "new_duplicated_lines";
+ public static final String NEW_DUPLICATED_LINES_KEY = "new_duplicated_lines";
+
/**
* @since 6.1
*/
- public static final Metric<Integer> NEW_LINES_DUPLICATED = new Metric.Builder(NEW_LINES_DUPLICATED_KEY, "New Duplicated Lines", Metric.ValueType.INT)
+ public static final Metric<Integer> NEW_DUPLICATED_LINES = new Metric.Builder(NEW_DUPLICATED_LINES_KEY, "New Duplicated Lines", Metric.ValueType.INT)
.setDescription("New duplicated lines")
.setDirection(Metric.DIRECTION_WORST)
.setQualitative(true)
@@ -1387,6 +1388,7 @@ public final class CoreMetrics {
.create();
public static final String DUPLICATED_LINES_DENSITY_KEY = "duplicated_lines_density";
+
public static final Metric<Double> DUPLICATED_LINES_DENSITY = new Metric.Builder(DUPLICATED_LINES_DENSITY_KEY, "Duplicated Lines (%)", Metric.ValueType.PERCENT)
.setDescription("Duplicated lines balanced by statements")
.setDirection(Metric.DIRECTION_WORST)
@@ -1398,6 +1400,24 @@ public final class CoreMetrics {
.create();
/**
+ * @since 6.1
+ */
+ public static final String NEW_DUPLICATED_LINES_DENSITY_KEY = "new_duplicated_lines_density";
+
+ /**
+ * @since 6.1
+ */
+ public static final Metric<Integer> NEW_DUPLICATED_LINES_DENSITY = new Metric.Builder(NEW_DUPLICATED_LINES_DENSITY_KEY, "Duplicated Lines on New Code (%)",
+ Metric.ValueType.PERCENT)
+ .setDescription("Duplicated lines on new code balanced by statements")
+ .setDirection(Metric.DIRECTION_WORST)
+ .setQualitative(true)
+ .setDomain(DOMAIN_DUPLICATIONS)
+ .setBestValue(0.0)
+ .setDeleteHistoricalData(true)
+ .create();
+
+ /**
* @deprecated since 4.5. Internal storage of duplication is not an API.
*/
@Deprecated