diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-07-31 15:47:08 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-07-31 15:56:00 +0200 |
commit | f462e365e2fb13c79c3b077455522e5391cedda9 (patch) | |
tree | e670fb59618dd17f1801b74c6c61320516261f3b /sonar-plugin-api | |
parent | f30100815bc53fc95109dc89dbb478306a50d155 (diff) | |
download | sonarqube-f462e365e2fb13c79c3b077455522e5391cedda9.tar.gz sonarqube-f462e365e2fb13c79c3b077455522e5391cedda9.zip |
SONAR-5513 Deprecate measure duplication_data and provide alternative to dev cockpit
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java | 25 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/resources/CoreMetricsTest.java | 2 |
2 files changed, 26 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 dc72077af41..c88a2c18974 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 @@ -1318,6 +1318,10 @@ public final class CoreMetrics { .setOptimizedBestValue(true) .create(); + /** + * @deprecated since 4.5. Internal storage of duplication is not an API. No more available on batch side. + */ + @Deprecated public static final String DUPLICATIONS_DATA_KEY = "duplications_data"; /** @@ -1336,7 +1340,9 @@ public final class CoreMetrics { * </duplications> * </pre> * </p> + * @deprecated since 4.5. Internal storage of duplication is not an API. No more available on batch side. */ + @Deprecated public static final Metric<String> DUPLICATIONS_DATA = new Metric.Builder(DUPLICATIONS_DATA_KEY, "Duplications details", Metric.ValueType.DATA) .setDescription("Duplications details") .setDirection(Metric.DIRECTION_NONE) @@ -1345,6 +1351,25 @@ public final class CoreMetrics { .setDeleteHistoricalData(true) .create(); + /** + * @since 4.5 used by dev cockpit. + */ + @Beta + public static final String DUPLICATION_LINES_DATA_KEY = "comment_lines_data"; + + /** + * Information about duplication in file. + * Key-value pairs, where key - is a number of line, and value - is an indicator of whether line is duplicated somewhere (1) or not (0). + * + * @see org.sonar.api.measures.FileLinesContext + * @since 4.5 used by dev cockpit + */ + @Beta + public static final Metric<String> DUPLICATION_LINES_DATA = new Metric.Builder(DUPLICATION_LINES_DATA_KEY, "duplication_lines_data", Metric.ValueType.DATA) + .setHidden(true) + .setDomain(DOMAIN_DUPLICATION) + .create(); + // -------------------------------------------------------------------------------------------------------------------- // // CODING RULES 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 6d4156dc668..204fcfc71e6 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(153); + assertThat(metrics).hasSize(154); assertThat(metrics).contains(CoreMetrics.NCLOC, CoreMetrics.DIRECTORIES); } |