]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11794 Remove old deprecated metrics
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 5 Mar 2019 15:14:47 +0000 (16:14 +0100)
committersonartech <sonartech@sonarsource.com>
Wed, 6 Mar 2019 10:30:44 +0000 (11:30 +0100)
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/CommentMeasuresStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ComplexityMeasuresStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportCommentMeasuresStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ReportComplexityMeasuresStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsCommentMeasuresStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/ViewsComplexityMeasuresStepTest.java
sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java

index 66ad6b3f139ab8de204ae16ff38ade8e5a5365b2..10fa945516600fb668dcde49e8e9bdf046061fea 100644 (file)
@@ -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());
   }
index 3eae0bf663ad151c5199cfd985dd8c1df9e69534..3911b8e9aa9300eaba78ebe0dd2e91146365e3ec 100644 (file)
@@ -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)
index 47acdeb5e7203714add275af346e43f96b42cda1..44917e781444960da0ebc6436185381c65143d0a 100644 (file)
@@ -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;
index 2fc460476109b62a1c3384ceeead5825d296b930..0c4d9a305c102d579f5ab694ab5053eb4a3cf53b 100644 (file)
@@ -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);
@@ -88,19 +85,6 @@ public class ReportCommentMeasuresStepTest {
         .build());
   }
 
-  @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));
index cb53f5eb735f9eba1476905845cd45628366665f..f57297fefa10a397b6cd4c9e4c8ad069467cf0f8 100644 (file)
@@ -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"));
index d7ed7bd4c109b81a03bca11f8c391bd68034d41b..6e22becc1c78452e355fc98ed01de4c5bb3bccfe 100644 (file)
@@ -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);
@@ -94,20 +91,6 @@ public class ViewsCommentMeasuresStepTest {
         .build());
   }
 
-  @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);
index 2b8e03fe67b15cbab9d758ba12e24d3f12dfd476..d6127526fddbfb13cfc6b8d5c0ba02baedab7bd6 100644 (file)
@@ -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");
index ab1968bc9247b154d840d7bee9702145e676751e..6456a70b0c4adaeef4605d201fd30c7994c771e0 100644 (file)
@@ -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
@@ -91,13 +73,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
    */
@@ -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
@@ -443,24 +398,6 @@ public final class CoreMetrics {
     .setHidden(true)
     .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
    */
@@ -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")
@@ -1996,262 +1918,6 @@ public final class CoreMetrics {
     .setDeleteHistoricalData(true)
     .create();
 
-  // --------------------------------------------------------------------------------------------------------------------
-  //
-  // 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
index 68716b84f3793b64dc67095c530d31569975eaa4..ab27aa0b0fa71d1105488c619db58468328e789b 100644 (file)
@@ -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