aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2019-03-05 16:14:47 +0100
committersonartech <sonartech@sonarsource.com>2019-03-06 11:30:44 +0100
commit9e05ef0fb03d6f6efbba3ee4d0e9955aba00d6cd (patch)
tree9545cf6e85e807b44a6e4376dd2e996c1b9c7f9c
parentf02eeba4ef9908da5d6e5ea969e91a22c6c443cd (diff)
downloadsonarqube-9e05ef0fb03d6f6efbba3ee4d0e9955aba00d6cd.tar.gz
sonarqube-9e05ef0fb03d6f6efbba3ee4d0e9955aba00d6cd.zip
SONAR-11794 Remove old deprecated metrics
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/CommentMeasuresStep.java3
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ComplexityMeasuresStep.java2
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java4
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportCommentMeasuresStepTest.java16
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportComplexityMeasuresStepTest.java8
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsCommentMeasuresStepTest.java17
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsComplexityMeasuresStepTest.java8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java334
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java27
9 files changed, 2 insertions, 417 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/CommentMeasuresStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/CommentMeasuresStep.java
index 66ad6b3f139..10fa9455166 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/CommentMeasuresStep.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/CommentMeasuresStep.java
@@ -37,14 +37,12 @@ import org.sonar.ce.task.projectanalysis.metric.Metric;
import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
import org.sonar.ce.task.step.ComputationStep;
-import static org.sonar.api.measures.CoreMetrics.COMMENTED_OUT_CODE_LINES_KEY;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_DENSITY_KEY;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_KEY;
import static org.sonar.api.measures.CoreMetrics.NCLOC_KEY;
import static org.sonar.api.measures.CoreMetrics.PUBLIC_API_KEY;
import static org.sonar.api.measures.CoreMetrics.PUBLIC_DOCUMENTED_API_DENSITY_KEY;
import static org.sonar.api.measures.CoreMetrics.PUBLIC_UNDOCUMENTED_API_KEY;
-import static org.sonar.ce.task.projectanalysis.formula.SumFormula.createIntSumFormula;
/**
* Computes comments measures on files and then aggregates them on higher components.
@@ -61,7 +59,6 @@ public class CommentMeasuresStep implements ComputationStep {
this.metricRepository = metricRepository;
this.measureRepository = measureRepository;
this.formulas = ImmutableList.of(
- createIntSumFormula(COMMENTED_OUT_CODE_LINES_KEY),
new DocumentationFormula(),
new CommentDensityFormula());
}
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ComplexityMeasuresStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ComplexityMeasuresStep.java
index 3eae0bf663a..3911b8e9aa9 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ComplexityMeasuresStep.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ComplexityMeasuresStep.java
@@ -31,7 +31,6 @@ import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
import org.sonar.ce.task.step.ComputationStep;
import static org.sonar.api.measures.CoreMetrics.CLASSES_KEY;
-import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_KEY;
import static org.sonar.api.measures.CoreMetrics.COGNITIVE_COMPLEXITY_KEY;
import static org.sonar.api.measures.CoreMetrics.COMPLEXITY_IN_CLASSES_KEY;
@@ -57,7 +56,6 @@ public class ComplexityMeasuresStep implements ComputationStep {
createIntSumFormula(COGNITIVE_COMPLEXITY_KEY),
new DistributionFormula(FUNCTION_COMPLEXITY_DISTRIBUTION_KEY),
new DistributionFormula(FILE_COMPLEXITY_DISTRIBUTION_KEY),
- new DistributionFormula(CLASS_COMPLEXITY_DISTRIBUTION_KEY),
AverageFormula.Builder.newBuilder().setOutputMetricKey(FILE_COMPLEXITY_KEY)
.setMainMetricKey(COMPLEXITY_KEY)
.setByMetricKey(FILES_KEY)
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java
index 47acdeb5e72..44917e78144 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java
@@ -47,7 +47,6 @@ import org.sonar.db.measure.LiveMeasureDao;
import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableSet;
-import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.api.measures.CoreMetrics.FILE_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.api.measures.CoreMetrics.FUNCTION_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.ce.task.projectanalysis.component.ComponentVisitor.Order.PRE_ORDER;
@@ -59,8 +58,7 @@ public class PersistLiveMeasuresStep implements ComputationStep {
*/
private static final Set<String> NOT_TO_PERSIST_ON_FILE_METRIC_KEYS = unmodifiableSet(new HashSet<>(asList(
FILE_COMPLEXITY_DISTRIBUTION_KEY,
- FUNCTION_COMPLEXITY_DISTRIBUTION_KEY,
- CLASS_COMPLEXITY_DISTRIBUTION_KEY)));
+ FUNCTION_COMPLEXITY_DISTRIBUTION_KEY)));
private final DbClient dbClient;
private final MetricRepository metricRepository;
diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportCommentMeasuresStepTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportCommentMeasuresStepTest.java
index 2fc46047610..0c4d9a305c1 100644
--- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportCommentMeasuresStepTest.java
+++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportCommentMeasuresStepTest.java
@@ -30,8 +30,6 @@ import org.sonar.ce.task.step.TestComputationStepContext;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
-import static org.sonar.api.measures.CoreMetrics.COMMENTED_OUT_CODE_LINES;
-import static org.sonar.api.measures.CoreMetrics.COMMENTED_OUT_CODE_LINES_KEY;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_DENSITY;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_DENSITY_KEY;
@@ -65,7 +63,6 @@ public class ReportCommentMeasuresStepTest {
.add(NCLOC)
.add(COMMENT_LINES)
.add(COMMENT_LINES_DENSITY)
- .add(COMMENTED_OUT_CODE_LINES)
.add(PUBLIC_API)
.add(PUBLIC_UNDOCUMENTED_API)
.add(PUBLIC_DOCUMENTED_API_DENSITY);
@@ -89,19 +86,6 @@ public class ReportCommentMeasuresStepTest {
}
@Test
- public void aggregate_commented_out_code_lines() {
- measureRepository.addRawMeasure(FILE_1_REF, COMMENTED_OUT_CODE_LINES_KEY, newMeasureBuilder().create(100));
- measureRepository.addRawMeasure(FILE_2_REF, COMMENTED_OUT_CODE_LINES_KEY, newMeasureBuilder().create(400));
-
- underTest.execute(new TestComputationStepContext());
-
- assertThat(measureRepository.getAddedRawMeasure(FILE_1_REF, COMMENTED_OUT_CODE_LINES_KEY)).isNotPresent();
- assertThat(measureRepository.getAddedRawMeasure(FILE_2_REF, COMMENTED_OUT_CODE_LINES_KEY)).isNotPresent();
- assertThat(measureRepository.getAddedRawMeasure(DIRECTORY_REF, COMMENTED_OUT_CODE_LINES_KEY).get().getIntValue()).isEqualTo(500);
- assertThat(measureRepository.getAddedRawMeasure(ROOT_REF, COMMENTED_OUT_CODE_LINES_KEY).get().getIntValue()).isEqualTo(500);
- }
-
- @Test
public void aggregate_comment_lines() {
measureRepository.addRawMeasure(FILE_1_REF, COMMENT_LINES_KEY, newMeasureBuilder().create(100));
measureRepository.addRawMeasure(FILE_2_REF, COMMENT_LINES_KEY, newMeasureBuilder().create(400));
diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportComplexityMeasuresStepTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportComplexityMeasuresStepTest.java
index cb53f5eb735..f57297fefa1 100644
--- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportComplexityMeasuresStepTest.java
+++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportComplexityMeasuresStepTest.java
@@ -32,8 +32,6 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.measures.CoreMetrics.CLASSES;
import static org.sonar.api.measures.CoreMetrics.CLASSES_KEY;
import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY;
-import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION;
-import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_KEY;
import static org.sonar.api.measures.CoreMetrics.COGNITIVE_COMPLEXITY;
import static org.sonar.api.measures.CoreMetrics.COGNITIVE_COMPLEXITY_KEY;
@@ -89,7 +87,6 @@ public class ReportComplexityMeasuresStepTest {
.add(COMPLEXITY_IN_FUNCTIONS)
.add(FUNCTION_COMPLEXITY_DISTRIBUTION)
.add(FILE_COMPLEXITY_DISTRIBUTION)
- .add(CLASS_COMPLEXITY_DISTRIBUTION)
.add(FILE_COMPLEXITY)
.add(FILES)
.add(CLASS_COMPLEXITY)
@@ -147,11 +144,6 @@ public class ReportComplexityMeasuresStepTest {
verify_distribution_aggregation(FILE_COMPLEXITY_DISTRIBUTION_KEY);
}
- @Test
- public void aggregate_class_complexity_distribution() {
- verify_distribution_aggregation(CLASS_COMPLEXITY_DISTRIBUTION_KEY);
- }
-
private void verify_distribution_aggregation(String metricKey) {
measureRepository.addRawMeasure(FILE_1_REF, metricKey, newMeasureBuilder().create("0.5=3;3.5=5;6.5=9"));
measureRepository.addRawMeasure(FILE_2_REF, metricKey, newMeasureBuilder().create("0.5=0;3.5=2;6.5=1"));
diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsCommentMeasuresStepTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsCommentMeasuresStepTest.java
index d7ed7bd4c10..6e22becc1c7 100644
--- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsCommentMeasuresStepTest.java
+++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsCommentMeasuresStepTest.java
@@ -30,8 +30,6 @@ import org.sonar.ce.task.step.TestComputationStepContext;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
-import static org.sonar.api.measures.CoreMetrics.COMMENTED_OUT_CODE_LINES;
-import static org.sonar.api.measures.CoreMetrics.COMMENTED_OUT_CODE_LINES_KEY;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_DENSITY;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_DENSITY_KEY;
@@ -67,7 +65,6 @@ public class ViewsCommentMeasuresStepTest {
.add(NCLOC)
.add(COMMENT_LINES)
.add(COMMENT_LINES_DENSITY)
- .add(COMMENTED_OUT_CODE_LINES)
.add(PUBLIC_API)
.add(PUBLIC_UNDOCUMENTED_API)
.add(PUBLIC_DOCUMENTED_API_DENSITY);
@@ -95,20 +92,6 @@ public class ViewsCommentMeasuresStepTest {
}
@Test
- public void aggregate_commented_out_code_lines() {
- addRawMeasure(PROJECTVIEW_1_REF, COMMENTED_OUT_CODE_LINES_KEY, 100);
- addRawMeasure(PROJECTVIEW_2_REF, COMMENTED_OUT_CODE_LINES_KEY, 400);
- addRawMeasure(PROJECTVIEW_3_REF, COMMENTED_OUT_CODE_LINES_KEY, 500);
-
- underTest.execute(new TestComputationStepContext());
-
- assertProjectViewsHasNoNewRawMeasure();
- assertRawMeasureValue(SUB_MODULE_REF, COMMENTED_OUT_CODE_LINES_KEY, 500);
- assertRawMeasureValue(MODULE_REF, COMMENTED_OUT_CODE_LINES_KEY, 500);
- assertRawMeasureValue(ROOT_REF, COMMENTED_OUT_CODE_LINES_KEY, 1000);
- }
-
- @Test
public void aggregate_comment_lines() {
addRawMeasure(PROJECTVIEW_1_REF, COMMENT_LINES_KEY, 100);
addRawMeasure(PROJECTVIEW_2_REF, COMMENT_LINES_KEY, 400);
diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsComplexityMeasuresStepTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsComplexityMeasuresStepTest.java
index 2b8e03fe67b..d6127526fdd 100644
--- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsComplexityMeasuresStepTest.java
+++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsComplexityMeasuresStepTest.java
@@ -33,8 +33,6 @@ import static org.assertj.guava.api.Assertions.assertThat;
import static org.sonar.api.measures.CoreMetrics.CLASSES;
import static org.sonar.api.measures.CoreMetrics.CLASSES_KEY;
import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY;
-import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION;
-import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_KEY;
import static org.sonar.api.measures.CoreMetrics.COGNITIVE_COMPLEXITY;
import static org.sonar.api.measures.CoreMetrics.COGNITIVE_COMPLEXITY_KEY;
@@ -98,7 +96,6 @@ public class ViewsComplexityMeasuresStepTest {
.add(COMPLEXITY_IN_FUNCTIONS)
.add(FUNCTION_COMPLEXITY_DISTRIBUTION)
.add(FILE_COMPLEXITY_DISTRIBUTION)
- .add(CLASS_COMPLEXITY_DISTRIBUTION)
.add(FILE_COMPLEXITY)
.add(FILES)
.add(CLASS_COMPLEXITY)
@@ -156,11 +153,6 @@ public class ViewsComplexityMeasuresStepTest {
verify_distribution_aggregation(FILE_COMPLEXITY_DISTRIBUTION_KEY);
}
- @Test
- public void aggregate_class_complexity_distribution() {
- verify_distribution_aggregation(CLASS_COMPLEXITY_DISTRIBUTION_KEY);
- }
-
private void verify_distribution_aggregation(String metricKey) {
addRawMeasure(PROJECT_VIEW_1_REF, metricKey, "0.5=3;3.5=5;6.5=9");
addRawMeasure(PROJECT_VIEW_2_REF, metricKey, "0.5=0;3.5=2;6.5=1");
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 ab1968bc924..6456a70b0c4 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
@@ -35,23 +35,6 @@ public final class CoreMetrics {
public static String DOMAIN_SIZE = "Size";
public static String DOMAIN_COVERAGE = "Coverage";
- /**
- * @deprecated in 5.5. Merged into {@link #DOMAIN_COVERAGE}
- */
- @Deprecated
- public static String DOMAIN_TESTS = "Tests";
-
- /**
- * @deprecated in 5.5. Merged into {@link #DOMAIN_COVERAGE}
- */
- @Deprecated
- public static String DOMAIN_INTEGRATION_TESTS = "Tests (Integration)";
-
- /**
- * @deprecated in 5.5. Merged into {@link #DOMAIN_COVERAGE}
- */
- @Deprecated
- public static String DOMAIN_OVERALL_TESTS = "Tests (Overall)";
public static String DOMAIN_COMPLEXITY = "Complexity";
/**
* @deprecated since 6.2. Merged into {@link #DOMAIN_SIZE}
@@ -68,7 +51,6 @@ public final class CoreMetrics {
*/
@Deprecated
public static String DOMAIN_DUPLICATION = "Duplication";
- public static String DOMAIN_DESIGN = "Design";
/**
* SonarQube Quality Model
@@ -92,13 +74,6 @@ public final class CoreMetrics {
public static String DOMAIN_SECURITY = "Security";
/**
- * @since 4.0
- * @deprecated in 5.5. Replaced by {@link #DOMAIN_MAINTAINABILITY}
- */
- @Deprecated
- public static String DOMAIN_TECHNICAL_DEBT = "Technical Debt";
-
- /**
* @since 5.5
*/
public static String DOMAIN_RELEASABILITY = "Releasability";
@@ -309,26 +284,6 @@ public final class CoreMetrics {
.setHidden(true)
.create();
- /**
- * @deprecated since 4.2 - see SONAR-4990
- */
- @Deprecated
- public static final String COMMENTED_OUT_CODE_LINES_KEY = "commented_out_code_lines";
-
- /**
- * @deprecated since 4.2 - see SONAR-4990
- */
- @Deprecated
- public static final Metric<Integer> COMMENTED_OUT_CODE_LINES = new Metric.Builder(COMMENTED_OUT_CODE_LINES_KEY, "Commented-Out LOC", Metric.ValueType.INT)
- .setDescription("Commented lines of code")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(true)
- .setDomain(DOMAIN_DOCUMENTATION)
- .setBestValue(0.0)
- .setOptimizedBestValue(true)
- .setHidden(true)
- .create();
-
// --------------------------------------------------------------------------------------------------------------------
//
// COMPLEXITY
@@ -444,24 +399,6 @@ public final class CoreMetrics {
.create();
/**
- * @deprecated in 3.0 - see SONAR-3289
- */
- @Deprecated
- public static final String CLASS_COMPLEXITY_DISTRIBUTION_KEY = "class_complexity_distribution";
- /**
- * @deprecated in 3.0 - see SONAR-3289
- */
- @Deprecated
- public static final Metric<String> CLASS_COMPLEXITY_DISTRIBUTION = new Metric.Builder(CLASS_COMPLEXITY_DISTRIBUTION_KEY, "Class Distribution / Complexity",
- Metric.ValueType.DISTRIB)
- .setDescription("Classes distribution /complexity")
- .setDirection(Metric.DIRECTION_NONE)
- .setQualitative(true)
- .setDomain(DOMAIN_COMPLEXITY)
- .setHidden(true)
- .create();
-
- /**
* @deprecated since 6.7
*/
@Deprecated
@@ -578,21 +515,6 @@ public final class CoreMetrics {
.setOptimizedBestValue(true)
.create();
- /**
- * @deprecated since 5.2 use {@link MutableTestPlan}
- */
- @Deprecated
- public static final String TEST_DATA_KEY = "test_data";
- /**
- * @deprecated since 5.2 use {@link MutableTestPlan}
- */
- @Deprecated
- public static final Metric<String> TEST_DATA = new Metric.Builder(TEST_DATA_KEY, "Unit Test Details", Metric.ValueType.DATA)
- .setDescription("Unit tests details")
- .setDirection(Metric.DIRECTION_WORST)
- .setDomain(DOMAIN_COVERAGE)
- .create();
-
public static final String COVERAGE_KEY = "coverage";
public static final Metric<Double> COVERAGE = new Metric.Builder(COVERAGE_KEY, "Coverage", Metric.ValueType.PERCENT)
.setDescription("Coverage by tests")
@@ -1998,262 +1920,6 @@ public final class CoreMetrics {
// --------------------------------------------------------------------------------------------------------------------
//
- // DESIGN
- //
- // --------------------------------------------------------------------------------------------------------------------
-
- /**
- * @deprecated since 5.0 this is an internal metric that should not be accessed by plugins
- */
- @Deprecated
- public static final String DEPENDENCY_MATRIX_KEY = "dsm";
- /**
- * @deprecated since 5.0 this is an internal metric that should not be accessed by plugins
- */
- @Deprecated
- public static final transient Metric<String> DEPENDENCY_MATRIX = new Metric.Builder(DEPENDENCY_MATRIX_KEY, "Dependency Matrix", Metric.ValueType.DATA)
- .setDescription("Dependency Matrix")
- .setDirection(Metric.DIRECTION_NONE)
- .setQualitative(false)
- .setDomain(DOMAIN_DESIGN)
- .setDeleteHistoricalData(true)
- .create();
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String DIRECTORY_CYCLES_KEY = "package_cycles";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> DIRECTORY_CYCLES = new Metric.Builder(DIRECTORY_CYCLES_KEY, "Directory Cycles", Metric.ValueType.INT)
- .setDescription("Directory cycles")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(true)
- .setDomain(DOMAIN_DESIGN)
- .setBestValue(0.0)
- .create();
-
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_CYCLES_KEY}
- */
- @Deprecated
- public static final String PACKAGE_CYCLES_KEY = DIRECTORY_CYCLES_KEY;
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_CYCLES}
- */
- @Deprecated
- public static final transient Metric<Integer> PACKAGE_CYCLES = DIRECTORY_CYCLES;
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String DIRECTORY_TANGLE_INDEX_KEY = "package_tangle_index";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Double> DIRECTORY_TANGLE_INDEX = new Metric.Builder(DIRECTORY_TANGLE_INDEX_KEY, "Directory Tangle Index", Metric.ValueType.PERCENT)
- .setDescription("Directory tangle index")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(true)
- .setBestValue(0.0)
- .setDomain(DOMAIN_DESIGN)
- .create();
-
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_TANGLE_INDEX_KEY}
- */
- @Deprecated
- public static final String PACKAGE_TANGLE_INDEX_KEY = DIRECTORY_TANGLE_INDEX_KEY;
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_TANGLE_INDEX}
- */
- @Deprecated
- public static final transient Metric<Double> PACKAGE_TANGLE_INDEX = DIRECTORY_TANGLE_INDEX;
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String DIRECTORY_TANGLES_KEY = "package_tangles";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> DIRECTORY_TANGLES = new Metric.Builder(DIRECTORY_TANGLES_KEY, "File Dependencies to Cut", Metric.ValueType.INT)
- .setDescription("File dependencies to cut")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
- .setDomain(DOMAIN_DESIGN)
- .create();
-
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_TANGLES_KEY}
- */
- @Deprecated
- public static final String PACKAGE_TANGLES_KEY = DIRECTORY_TANGLES_KEY;
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_TANGLES}
- */
- @Deprecated
- public static final transient Metric<Integer> PACKAGE_TANGLES = DIRECTORY_TANGLES;
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String DIRECTORY_FEEDBACK_EDGES_KEY = "package_feedback_edges";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> DIRECTORY_FEEDBACK_EDGES = new Metric.Builder(DIRECTORY_FEEDBACK_EDGES_KEY, "Package Dependencies to Cut", Metric.ValueType.INT)
- .setDescription("Package dependencies to cut")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
- .setDomain(DOMAIN_DESIGN)
- .setBestValue(0.0)
- .create();
-
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_FEEDBACK_EDGES_KEY}
- */
- @Deprecated
- public static final String PACKAGE_FEEDBACK_EDGES_KEY = DIRECTORY_FEEDBACK_EDGES_KEY;
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_FEEDBACK_EDGES}
- */
- @Deprecated
- public static final transient Metric<Integer> PACKAGE_FEEDBACK_EDGES = DIRECTORY_FEEDBACK_EDGES;
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String DIRECTORY_EDGES_WEIGHT_KEY = "package_edges_weight";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> DIRECTORY_EDGES_WEIGHT = new Metric.Builder(DIRECTORY_EDGES_WEIGHT_KEY, "Directory Edges Weight", Metric.ValueType.INT)
- .setDescription("Directory edges weight")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(false)
- .setDomain(DOMAIN_DESIGN)
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .create();
-
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_EDGES_WEIGHT_KEY}
- */
- @Deprecated
- public static final String PACKAGE_EDGES_WEIGHT_KEY = DIRECTORY_EDGES_WEIGHT_KEY;
- /**
- * @deprecated since 5.0 use {@link #DIRECTORY_EDGES_WEIGHT}
- */
- @Deprecated
- public static final transient Metric<Integer> PACKAGE_EDGES_WEIGHT = DIRECTORY_EDGES_WEIGHT;
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String FILE_CYCLES_KEY = "file_cycles";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> FILE_CYCLES = new Metric.Builder(FILE_CYCLES_KEY, "File Cycles", Metric.ValueType.INT)
- .setDescription("File cycles")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(true)
- .setDomain(DOMAIN_DESIGN)
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .setBestValue(0.0)
- .create();
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String FILE_TANGLE_INDEX_KEY = "file_tangle_index";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Double> FILE_TANGLE_INDEX = new Metric.Builder(FILE_TANGLE_INDEX_KEY, "File Tangle Index", Metric.ValueType.PERCENT)
- .setDescription("File tangle index")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(true)
- .setDomain(DOMAIN_DESIGN)
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .setBestValue(0.0)
- .create();
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String FILE_TANGLES_KEY = "file_tangles";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> FILE_TANGLES = new Metric.Builder(FILE_TANGLES_KEY, "File Tangles", Metric.ValueType.INT)
- .setDescription("Files tangles")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
- .setDomain(DOMAIN_DESIGN)
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .create();
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String FILE_FEEDBACK_EDGES_KEY = "file_feedback_edges";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> FILE_FEEDBACK_EDGES = new Metric.Builder(FILE_FEEDBACK_EDGES_KEY, "Suspect File Dependencies", Metric.ValueType.INT)
- .setDescription("Suspect file dependencies")
- .setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
- .setDomain(DOMAIN_DESIGN)
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .setBestValue(0.0)
- .create();
-
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final String FILE_EDGES_WEIGHT_KEY = "file_edges_weight";
- /**
- * @deprecated since 5.2 No more design features
- */
- @Deprecated
- public static final transient Metric<Integer> FILE_EDGES_WEIGHT = new Metric.Builder(FILE_EDGES_WEIGHT_KEY, "File Edges Weight", Metric.ValueType.INT)
- .setDescription("File edges weight")
- .setDirection(Metric.DIRECTION_BETTER)
- .setQualitative(false)
- .setDomain(DOMAIN_DESIGN)
- .setHidden(true)
- .setDeleteHistoricalData(true)
- .create();
-
- // --------------------------------------------------------------------------------------------------------------------
- //
// MAINTAINABILITY CHARACTERISTIC
//
// --------------------------------------------------------------------------------------------------------------------
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java
index 68716b84f37..ab27aa0b0fa 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java
@@ -73,7 +73,6 @@ import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableSet;
import static java.util.stream.Collectors.toList;
import static org.sonar.api.measures.CoreMetrics.BRANCH_COVERAGE;
-import static org.sonar.api.measures.CoreMetrics.COMMENTED_OUT_CODE_LINES_KEY;
import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_DATA_KEY;
import static org.sonar.api.measures.CoreMetrics.CONDITIONS_BY_LINE;
import static org.sonar.api.measures.CoreMetrics.CONDITIONS_BY_LINE_KEY;
@@ -84,17 +83,6 @@ import static org.sonar.api.measures.CoreMetrics.COVERAGE_LINE_HITS_DATA;
import static org.sonar.api.measures.CoreMetrics.COVERAGE_LINE_HITS_DATA_KEY;
import static org.sonar.api.measures.CoreMetrics.COVERED_CONDITIONS_BY_LINE;
import static org.sonar.api.measures.CoreMetrics.COVERED_CONDITIONS_BY_LINE_KEY;
-import static org.sonar.api.measures.CoreMetrics.DEPENDENCY_MATRIX_KEY;
-import static org.sonar.api.measures.CoreMetrics.DIRECTORY_CYCLES_KEY;
-import static org.sonar.api.measures.CoreMetrics.DIRECTORY_EDGES_WEIGHT_KEY;
-import static org.sonar.api.measures.CoreMetrics.DIRECTORY_FEEDBACK_EDGES_KEY;
-import static org.sonar.api.measures.CoreMetrics.DIRECTORY_TANGLES_KEY;
-import static org.sonar.api.measures.CoreMetrics.DIRECTORY_TANGLE_INDEX_KEY;
-import static org.sonar.api.measures.CoreMetrics.FILE_CYCLES_KEY;
-import static org.sonar.api.measures.CoreMetrics.FILE_EDGES_WEIGHT_KEY;
-import static org.sonar.api.measures.CoreMetrics.FILE_FEEDBACK_EDGES_KEY;
-import static org.sonar.api.measures.CoreMetrics.FILE_TANGLES_KEY;
-import static org.sonar.api.measures.CoreMetrics.FILE_TANGLE_INDEX_KEY;
import static org.sonar.api.measures.CoreMetrics.IT_BRANCH_COVERAGE_KEY;
import static org.sonar.api.measures.CoreMetrics.IT_CONDITIONS_BY_LINE_KEY;
import static org.sonar.api.measures.CoreMetrics.IT_CONDITIONS_TO_COVER_KEY;
@@ -139,20 +127,7 @@ public class DefaultSensorStorage implements SensorStorage {
* The metrics in this list should not be declared in {@link ScannerMetrics#ALLOWED_CORE_METRICS}.
*/
private static final Set<String> DEPRECATED_METRICS_KEYS = unmodifiableSet(new HashSet<>(asList(
- COMMENT_LINES_DATA_KEY,
- DEPENDENCY_MATRIX_KEY,
- DIRECTORY_CYCLES_KEY,
- DIRECTORY_EDGES_WEIGHT_KEY,
- DIRECTORY_FEEDBACK_EDGES_KEY,
- DIRECTORY_TANGLE_INDEX_KEY,
- DIRECTORY_TANGLES_KEY,
- FILE_CYCLES_KEY,
- FILE_EDGES_WEIGHT_KEY,
- FILE_FEEDBACK_EDGES_KEY,
- FILE_TANGLE_INDEX_KEY,
- FILE_TANGLES_KEY,
- // SONARPHP-621
- COMMENTED_OUT_CODE_LINES_KEY)));
+ COMMENT_LINES_DATA_KEY)));
/**
* Metrics that were computed by analyzers and that are now computed