]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22727 Move SoftwareQualitiesMetrics to sonar-core
authorDejan Milisavljevic <dejan.milisavljevic@sonarsource.com>
Mon, 12 Aug 2024 12:42:07 +0000 (14:42 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 26 Aug 2024 20:03:06 +0000 (20:03 +0000)
22 files changed:
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/EffortAggregator.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/NewEffortAggregator.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/MaintainabilityMeasuresVisitor.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/NewMaintainabilityMeasuresVisitor.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/NewReliabilityAndSecurityRatingMeasuresVisitor.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/NewSecurityReviewMeasuresVisitor.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/ReliabilityAndSecurityRatingMeasuresVisitor.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualitymodel/SecurityReviewMeasuresVisitor.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/EffortAggregatorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/NewEffortAggregatorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/qualitymodel/MaintainabilityMeasuresVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/qualitymodel/NewMaintainabilityMeasuresVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/qualitymodel/NewReliabilityAndSecurityRatingMeasuresVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/qualitymodel/NewSecurityReviewMeasuresVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/qualitymodel/ReliabilityAndSecurityRatingMeasuresVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/qualitymodel/SecurityReviewMeasuresVisitorTest.java
server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
server/sonar-server-common/src/main/java/org/sonar/server/metric/SoftwareQualitiesMetrics.java [deleted file]
server/sonar-server-common/src/test/java/org/sonar/server/metric/SoftwareQualitiesMetricsTest.java [deleted file]
server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
sonar-core/src/main/java/org/sonar/core/metric/SoftwareQualitiesMetrics.java [new file with mode: 0644]
sonar-core/src/test/java/org/sonar/core/metric/SoftwareQualitiesMetricsTest.java [new file with mode: 0644]

index 434e328b35b1f7cef01b46ef8182b245f45b5dc2..5f18c1acffebcc7c588d912ccac195486b8b69ca 100644 (file)
@@ -28,14 +28,14 @@ import org.sonar.ce.task.projectanalysis.measure.MeasureRepository;
 import org.sonar.ce.task.projectanalysis.metric.Metric;
 import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
 import org.sonar.core.issue.DefaultIssue;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 
 import static org.sonar.api.measures.CoreMetrics.RELIABILITY_REMEDIATION_EFFORT_KEY;
 import static org.sonar.api.measures.CoreMetrics.SECURITY_REMEDIATION_EFFORT_KEY;
 import static org.sonar.api.measures.CoreMetrics.TECHNICAL_DEBT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
 
 /**
  * Compute effort related measures :
index 5006fe2fe1637ac6453ee1114b021523020b57ca..25c0e5202c95ad48d73fe2581d7f575d2e7d6b13 100644 (file)
@@ -29,14 +29,14 @@ import org.sonar.ce.task.projectanalysis.measure.MeasureRepository;
 import org.sonar.ce.task.projectanalysis.metric.Metric;
 import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
 import org.sonar.core.issue.DefaultIssue;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 
 import static org.sonar.api.measures.CoreMetrics.NEW_RELIABILITY_REMEDIATION_EFFORT_KEY;
 import static org.sonar.api.measures.CoreMetrics.NEW_SECURITY_REMEDIATION_EFFORT_KEY;
 import static org.sonar.api.measures.CoreMetrics.NEW_TECHNICAL_DEBT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
 
 /**
  * Compute new effort related measures :
index ec9221056c131bb5f4f7f763c120d94e552437cf..32b15ebaacaafbd7c206a634a00606d269498624 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.ce.task.projectanalysis.measure.RatingMeasures;
 import org.sonar.ce.task.projectanalysis.metric.Metric;
 import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
 import org.sonar.server.measure.Rating;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 
 import static org.sonar.api.measures.CoreMetrics.DEVELOPMENT_COST_KEY;
 import static org.sonar.api.measures.CoreMetrics.EFFORT_TO_REACH_MAINTAINABILITY_RATING_A_KEY;
@@ -39,10 +39,10 @@ import static org.sonar.api.measures.CoreMetrics.SQALE_DEBT_RATIO_KEY;
 import static org.sonar.api.measures.CoreMetrics.SQALE_RATING_KEY;
 import static org.sonar.api.measures.CoreMetrics.TECHNICAL_DEBT_KEY;
 import static org.sonar.ce.task.projectanalysis.measure.Measure.newMeasureBuilder;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
 
 /**
  * Compute measures related to maintainability for projects and descendants :
index 0a59cbd50c1f7462ba9e9230afacede7fae9f664..f39acc0c7d23828aec2249ba8d9b60a9ae3b4543 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.ce.task.projectanalysis.measure.MeasureRepository;
 import org.sonar.ce.task.projectanalysis.metric.Metric;
 import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
 import org.sonar.ce.task.projectanalysis.source.NewLinesRepository;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 
 import static org.sonar.api.measures.CoreMetrics.NCLOC_DATA_KEY;
 import static org.sonar.api.measures.CoreMetrics.NEW_DEVELOPMENT_COST_KEY;
@@ -46,8 +46,8 @@ import static org.sonar.api.measures.CoreMetrics.NEW_TECHNICAL_DEBT_KEY;
 import static org.sonar.api.utils.KeyValueFormat.newIntegerConverter;
 import static org.sonar.ce.task.projectanalysis.component.ComponentVisitor.Order.POST_ORDER;
 import static org.sonar.ce.task.projectanalysis.measure.Measure.newMeasureBuilder;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
 
 /**
  * This visitor depends on {@link IntegrateIssuesVisitor} for the computation of
index dc5b216cc092e0cb12d5884e78a8603cfbcbae5b..178d39e78e704a7f3f1451048144bc79048bf6fa 100644 (file)
@@ -34,7 +34,7 @@ import org.sonar.ce.task.projectanalysis.metric.Metric;
 import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
 import org.sonar.core.issue.DefaultIssue;
 import org.sonar.server.measure.Rating;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 
 import static org.sonar.api.measures.CoreMetrics.NEW_RELIABILITY_RATING_KEY;
 import static org.sonar.api.measures.CoreMetrics.NEW_SECURITY_RATING_KEY;
@@ -53,8 +53,8 @@ import static org.sonar.server.measure.Rating.B;
 import static org.sonar.server.measure.Rating.C;
 import static org.sonar.server.measure.Rating.D;
 import static org.sonar.server.measure.Rating.E;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY;
 
 /**
  * Compute following measures :
index 1b6c33094274b54d4d2e616971e54ce4c1f82a5d..e1b92e9b8fbba300c5dca693234573f8a54283ef 100644 (file)
@@ -36,7 +36,7 @@ import static org.sonar.api.measures.CoreMetrics.NEW_SECURITY_REVIEW_RATING_KEY;
 import static org.sonar.api.rules.RuleType.SECURITY_HOTSPOT;
 import static org.sonar.ce.task.projectanalysis.component.ComponentVisitor.Order.POST_ORDER;
 import static org.sonar.ce.task.projectanalysis.component.CrawlerDepthLimit.FILE;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
 import static org.sonar.server.security.SecurityReviewRating.computeAToDRating;
 import static org.sonar.server.security.SecurityReviewRating.computePercent;
 import static org.sonar.server.security.SecurityReviewRating.computeRating;
index 6ecb9f0c3e7c8c6120d7199a3c41088632184cbe..6525640a193100101643f4221c50b0e12e8c362a 100644 (file)
@@ -33,7 +33,7 @@ import org.sonar.ce.task.projectanalysis.metric.Metric;
 import org.sonar.ce.task.projectanalysis.metric.MetricRepository;
 import org.sonar.core.issue.DefaultIssue;
 import org.sonar.server.measure.Rating;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 
 import static org.sonar.api.measures.CoreMetrics.RELIABILITY_RATING_KEY;
 import static org.sonar.api.measures.CoreMetrics.SECURITY_RATING_KEY;
@@ -41,8 +41,8 @@ import static org.sonar.api.rules.RuleType.BUG;
 import static org.sonar.api.rules.RuleType.VULNERABILITY;
 import static org.sonar.ce.task.projectanalysis.component.CrawlerDepthLimit.FILE;
 import static org.sonar.server.measure.Rating.RATING_BY_SEVERITY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING_KEY;
 
 /**
  * Compute following measures for projects and descendants:
index 34f3949b1e60f16a2cb92972b635381c0f81645f..df9029b03288569f1371866f8d3cdef8b25a58a7 100644 (file)
@@ -37,7 +37,7 @@ import static org.sonar.api.rules.RuleType.SECURITY_HOTSPOT;
 import static org.sonar.ce.task.projectanalysis.component.ComponentVisitor.Order.POST_ORDER;
 import static org.sonar.ce.task.projectanalysis.component.CrawlerDepthLimit.FILE;
 import static org.sonar.ce.task.projectanalysis.measure.Measure.newMeasureBuilder;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
 import static org.sonar.server.security.SecurityReviewRating.computeAToDRating;
 import static org.sonar.server.security.SecurityReviewRating.computePercent;
 import static org.sonar.server.security.SecurityReviewRating.computeRating;
index 720b2eb3dea117d79a7be98ec6b7a247afa05b8f..35690d621e390fb8502baf94e1348c25c10b6b01 100644 (file)
@@ -46,12 +46,12 @@ import static org.sonar.api.measures.CoreMetrics.TECHNICAL_DEBT_KEY;
 import static org.sonar.api.rules.RuleType.BUG;
 import static org.sonar.api.rules.RuleType.CODE_SMELL;
 import static org.sonar.api.rules.RuleType.VULNERABILITY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
 
 class EffortAggregatorTest {
 
index 9aef4e37ac58e01a55b83b59052f869c6e9a31a9..88894bdaff0a6978bc8419a9db2487a6ecd85566 100644 (file)
@@ -58,12 +58,12 @@ import static org.sonar.api.measures.CoreMetrics.NEW_TECHNICAL_DEBT_KEY;
 import static org.sonar.api.rules.RuleType.BUG;
 import static org.sonar.api.rules.RuleType.CODE_SMELL;
 import static org.sonar.api.rules.RuleType.VULNERABILITY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY;
 
 class NewEffortAggregatorTest {
   private static final Component FILE = ReportComponent.builder(Component.Type.FILE, 1).setUuid("FILE").build();
index e944aee492da27e7c035dca73c6d024fc83f38cf..e2741c6a5da10eebaa4ccf54e7e5fad36bb09044 100644 (file)
@@ -65,14 +65,14 @@ import static org.sonar.server.measure.Rating.A;
 import static org.sonar.server.measure.Rating.C;
 import static org.sonar.server.measure.Rating.D;
 import static org.sonar.server.measure.Rating.E;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
 
 class MaintainabilityMeasuresVisitorTest {
 
index fb1eb27c5959ad8e9b84e757d183d33b2c581f7f..19415757cec960cb278c10e39c07638dda6b2083 100644 (file)
@@ -69,12 +69,12 @@ import static org.sonar.ce.task.projectanalysis.measure.MeasureAssert.assertThat
 import static org.sonar.server.measure.Rating.A;
 import static org.sonar.server.measure.Rating.D;
 import static org.sonar.server.measure.Rating.E;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY;
 
 public class NewMaintainabilityMeasuresVisitorTest {
 
index db3e90f845d184a113d01d2ff1d8973eb672dc31..f2d94abce7acc1153d747d74e06158a49f474402 100644 (file)
@@ -71,10 +71,10 @@ import static org.sonar.server.measure.Rating.B;
 import static org.sonar.server.measure.Rating.C;
 import static org.sonar.server.measure.Rating.D;
 import static org.sonar.server.measure.Rating.E;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY;
 
 class NewReliabilityAndSecurityRatingMeasuresVisitorTest {
 
index e13d1590a9f5a29cfeb5628ed1cc01f9b8fc4ff2..2fe66648466787b7fb43aee3c09731118d28b517 100644 (file)
@@ -68,8 +68,8 @@ import static org.sonar.server.measure.Rating.B;
 import static org.sonar.server.measure.Rating.C;
 import static org.sonar.server.measure.Rating.D;
 import static org.sonar.server.measure.Rating.E;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
 
 class NewSecurityReviewMeasuresVisitorTest {
   private static final Offset<Double> VALUE_COMPARISON_OFFSET = Offset.offset(0.01);
index d89c7fbae1e221c0e39b8556dcf825eabf1087fe..fae829957bb1f9acc1ab4f7b28b2b8d1bbb7e8e2 100644 (file)
@@ -67,11 +67,10 @@ import static org.sonar.server.measure.Rating.B;
 import static org.sonar.server.measure.Rating.C;
 import static org.sonar.server.measure.Rating.D;
 import static org.sonar.server.measure.Rating.E;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING_KEY;
 
 class ReliabilityAndSecurityRatingMeasuresVisitorTest {
 
index eb931585aa9f44fc1e23b6b7553ccf420cec75c4..8d33cc5ddf5e56400ff29b726ed965202030bd75 100644 (file)
@@ -59,8 +59,8 @@ import static org.sonar.server.measure.Rating.B;
 import static org.sonar.server.measure.Rating.C;
 import static org.sonar.server.measure.Rating.D;
 import static org.sonar.server.measure.Rating.E;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING;
-import static org.sonar.server.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING;
+import static org.sonar.core.metric.SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY;
 
 class SecurityReviewMeasuresVisitorTest {
 
index 72a083736edc9326168e56bd9355580d6e5edcf6..fe78a50fff39dbc2ebd8a74a5069adc20dc68db3 100644 (file)
@@ -109,7 +109,7 @@ import org.sonar.server.l18n.ServerI18n;
 import org.sonar.server.log.ServerLogging;
 import org.sonar.server.measure.index.ProjectMeasuresIndexer;
 import org.sonar.server.metric.IssueCountMetrics;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 import org.sonar.server.metric.UnanalyzedLanguageMetrics;
 import org.sonar.server.notification.DefaultNotificationManager;
 import org.sonar.server.notification.NotificationService;
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/metric/SoftwareQualitiesMetrics.java b/server/sonar-server-common/src/main/java/org/sonar/server/metric/SoftwareQualitiesMetrics.java
deleted file mode 100644 (file)
index de1e0c8..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2024 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.metric;
-
-import java.util.List;
-import org.sonar.api.measures.Metric;
-import org.sonar.api.measures.Metrics;
-
-import static org.sonar.api.measures.CoreMetrics.DOMAIN_MAINTAINABILITY;
-import static org.sonar.api.measures.CoreMetrics.DOMAIN_RELIABILITY;
-import static org.sonar.api.measures.CoreMetrics.DOMAIN_SECURITY;
-import static org.sonar.api.measures.CoreMetrics.DOMAIN_SECURITY_REVIEW;
-
-public class SoftwareQualitiesMetrics implements Metrics {
-
-  public static final String SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY = "software_quality_maintainability_rating";
-
-  public static final Metric<Integer> SOFTWARE_QUALITY_MAINTAINABILITY_RATING =
-    new Metric.Builder(SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY, "Software Quality Maintainability Rating", Metric.ValueType.RATING)
-      .setDescription("Software quality maintainability rating")
-      .setDomain(DOMAIN_MAINTAINABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setQualitative(true)
-      .setBestValue(1.0)
-      .setWorstValue(4.0)
-      .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY = "new_software_quality_maintainability_rating";
-
-  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING =
-    new Metric.Builder(NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY, "Software Quality Maintainability Rating on New Code",
-      Metric.ValueType.RATING)
-      .setDescription("Software quality maintainability rating on new code")
-      .setDomain(DOMAIN_MAINTAINABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setDeleteHistoricalData(true)
-      .setOptimizedBestValue(true)
-      .setQualitative(true)
-      .setBestValue(1.0)
-      .setWorstValue(4.0)
-      .create();
-
-  public static final String SOFTWARE_QUALITY_RELIABILITY_RATING_KEY = "software_quality_reliability_rating";
-
-  public static final Metric<Integer> SOFTWARE_QUALITY_RELIABILITY_RATING = new Metric.Builder(SOFTWARE_QUALITY_RELIABILITY_RATING_KEY,
-    "Software Quality Reliability Rating", Metric.ValueType.RATING)
-    .setDescription("Software quality reliability rating")
-    .setDomain(DOMAIN_RELIABILITY)
-    .setDirection(Metric.DIRECTION_WORST)
-    .setQualitative(true)
-    .setBestValue(1.0)
-    .setWorstValue(4.0)
-    .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY = "new_software_quality_reliability_rating";
-
-  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_RELIABILITY_RATING =
-    new Metric.Builder(NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY,
-    "Software Quality Reliability Rating on New Code", Metric.ValueType.RATING)
-    .setDescription("Software quality reliability rating on new code")
-    .setDomain(DOMAIN_RELIABILITY)
-    .setDirection(Metric.DIRECTION_WORST)
-    .setDeleteHistoricalData(true)
-    .setOptimizedBestValue(true)
-    .setQualitative(true)
-    .setBestValue(1.0)
-    .setWorstValue(4.0)
-    .create();
-
-  public static final String SOFTWARE_QUALITY_SECURITY_RATING_KEY = "software_quality_security_rating";
-
-  public static final Metric<Integer> SOFTWARE_QUALITY_SECURITY_RATING = new Metric.Builder(SOFTWARE_QUALITY_SECURITY_RATING_KEY,
-    "Software Quality Security Rating", Metric.ValueType.RATING)
-    .setDescription("Software quality security rating")
-    .setDomain(DOMAIN_SECURITY)
-    .setDirection(Metric.DIRECTION_WORST)
-    .setQualitative(true)
-    .setBestValue(1.0)
-    .setWorstValue(4.0)
-    .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY = "new_software_quality_security_rating";
-
-  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_SECURITY_RATING = new Metric.Builder(NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY,
-    "Software Quality Security Rating on New Code", Metric.ValueType.RATING)
-    .setDescription("Software quality security rating on new code")
-    .setDomain(DOMAIN_SECURITY)
-    .setDirection(Metric.DIRECTION_WORST)
-    .setDeleteHistoricalData(true)
-    .setOptimizedBestValue(true)
-    .setQualitative(true)
-    .setBestValue(1.0)
-    .setWorstValue(4.0)
-    .create();
-
-  public static final String SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY = "software_quality_security_review_rating";
-
-  public static final Metric<Integer> SOFTWARE_QUALITY_SECURITY_REVIEW_RATING =
-    new Metric.Builder(SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY, "Software Quality Security Review Rating", Metric.ValueType.RATING)
-      .setDescription("Software quality security review rating")
-      .setDomain(DOMAIN_SECURITY_REVIEW)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setQualitative(true)
-      .setBestValue(1.0)
-      .setWorstValue(4.0)
-      .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY = "new_software_quality_security_review_rating";
-
-  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING =
-    new Metric.Builder(NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY, "Software Quality Security Review Rating on New Code",
-      Metric.ValueType.RATING)
-      .setDescription("Software quality security review rating on new code")
-      .setDomain(DOMAIN_SECURITY_REVIEW)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setDeleteHistoricalData(true)
-      .setOptimizedBestValue(true)
-      .setQualitative(true)
-      .setBestValue(1.0)
-      .setWorstValue(4.0)
-      .create();
-
-  public static final String EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY =
-    "effort_to_reach_software_quality_maintainability_rating_a";
-
-  public static final Metric<Long> EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A =
-    new Metric.Builder(EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY,
-      "Software Quality Effort to Reach Maintainability Rating A", Metric.ValueType.WORK_DUR)
-      .setDescription("Software quality effort to reach maintainability rating A")
-      .setDomain(DOMAIN_MAINTAINABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setQualitative(true)
-      .setBestValue(0.0)
-      .setOptimizedBestValue(true)
-      .create();
-
-  public static final String SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY =
-    "software_quality_maintainability_remediation_effort";
-
-  public static final Metric<Long> SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT =
-    new Metric.Builder(SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Maintainability Remediation Effort",
-      Metric.ValueType.WORK_DUR)
-      .setDescription("Software quality total effort (in minutes) to fix all the maintainability issues on the component and therefore to comply to all the requirements.")
-      .setDomain(DOMAIN_MAINTAINABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY =
-    "new_software_quality_maintainability_remediation_effort";
-
-  public static final Metric<Long> NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT =
-    new Metric.Builder(NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Maintainability Remediation Effort on new code",
-      Metric.ValueType.WORK_DUR)
-      .setDescription("Software quality total effort (in minutes) to fix all the maintainability issues on new code on the component and therefore to comply to all the requirements.")
-      .setDomain(DOMAIN_MAINTAINABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .setDeleteHistoricalData(true)
-      .create();
-
-
-  public static final String SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY = "software_quality_security_remediation_effort";
-
-  public static final Metric<Long> SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT =
-    new Metric.Builder(SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY, "Software Quality Security Remediation Effort",
-      Metric.ValueType.WORK_DUR)
-      .setDescription("Software quality security remediation effort")
-      .setDomain(DOMAIN_SECURITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY = "new_software_quality_security_remediation_effort";
-
-  public static final Metric<Long> NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT =
-    new Metric.Builder(NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY, "Software Quality Security Remediation Effort on New Code",
-      Metric.ValueType.WORK_DUR)
-      .setDescription("Software quality security remediation effort on new code")
-      .setDomain(DOMAIN_SECURITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .setDeleteHistoricalData(true)
-      .create();
-
-  public static final String SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY = "software_quality_reliability_remediation_effort";
-
-  public static final Metric<Long> SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT =
-    new Metric.Builder(SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Reliability Remediation Effort",
-      Metric.ValueType.WORK_DUR)
-      .setDescription("Software quality reliability remediation effort")
-      .setDomain(DOMAIN_RELIABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY =
-    "new_software_quality_reliability_remediation_effort";
-
-  public static final Metric<Long> NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT =
-    new Metric.Builder(NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Reliability Remediation Effort on New Code",
-      Metric.ValueType.WORK_DUR)
-      .setDescription("Software quality reliability remediation effort on new code")
-      .setDomain(DOMAIN_RELIABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .setDeleteHistoricalData(true)
-      .create();
-
-  public static final String SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY = "software_quality_maintainability_debt_ratio";
-
-  public static final Metric<Double> SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO =
-    new Metric.Builder(SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY, "Software Quality Technical Debt Ratio", Metric.ValueType.PERCENT)
-      .setDescription("Software quality ratio of the actual technical debt compared to the estimated cost to develop the whole source code from scratch")
-      .setDomain(DOMAIN_MAINTAINABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .create();
-
-  public static final String NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY = "new_software_quality_maintainability_debt_ratio";
-
-  public static final Metric<Double> NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO =
-    new Metric.Builder(NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY, "Software Quality Technical Debt Ratio on New Code",
-      Metric.ValueType.PERCENT)
-      .setDescription("Software quality technical debt ratio software quality of new/changed code.")
-      .setDomain(DOMAIN_MAINTAINABILITY)
-      .setDirection(Metric.DIRECTION_WORST)
-      .setOptimizedBestValue(true)
-      .setBestValue(0.0)
-      .setQualitative(true)
-      .create();
-
-  @Override
-  public List<Metric> getMetrics() {
-    return List.of(
-      SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
-      NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
-      SOFTWARE_QUALITY_RELIABILITY_RATING,
-      NEW_SOFTWARE_QUALITY_RELIABILITY_RATING,
-      SOFTWARE_QUALITY_SECURITY_RATING,
-      NEW_SOFTWARE_QUALITY_SECURITY_RATING,
-      SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
-      NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
-      EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A,
-      SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
-      NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
-      SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
-      NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
-      SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
-      NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
-      SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO,
-      NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO
-    );
-  }
-}
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/metric/SoftwareQualitiesMetricsTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/metric/SoftwareQualitiesMetricsTest.java
deleted file mode 100644 (file)
index 2c8f511..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2024 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.metric;
-
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-class SoftwareQualitiesMetricsTest {
-  @Test
-  void getMetrics() {
-    assertThat(new SoftwareQualitiesMetrics().getMetrics())
-      .containsExactlyInAnyOrder(
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING,
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING,
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
-        SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A,
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
-        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO,
-        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO);
-  }
-}
index f6d3eef8ccd5ba6fbc5594f6b27c4f4bd94423ed..03e3dd084cd9e12f2441bf7854e24b163e2b13f9 100644 (file)
@@ -159,7 +159,7 @@ import org.sonar.server.measure.index.ProjectsEsModule;
 import org.sonar.server.measure.live.LiveMeasureModule;
 import org.sonar.server.measure.ws.MeasuresWsModule;
 import org.sonar.server.metric.IssueCountMetrics;
-import org.sonar.server.metric.SoftwareQualitiesMetrics;
+import org.sonar.core.metric.SoftwareQualitiesMetrics;
 import org.sonar.server.metric.UnanalyzedLanguageMetrics;
 import org.sonar.server.metric.ws.MetricsWsModule;
 import org.sonar.server.monitoring.ComputeEngineMetricStatusTask;
diff --git a/sonar-core/src/main/java/org/sonar/core/metric/SoftwareQualitiesMetrics.java b/sonar-core/src/main/java/org/sonar/core/metric/SoftwareQualitiesMetrics.java
new file mode 100644 (file)
index 0000000..6cc6350
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.core.metric;
+
+import java.util.List;
+import org.sonar.api.measures.Metric;
+import org.sonar.api.measures.Metrics;
+
+import static org.sonar.api.measures.CoreMetrics.DOMAIN_MAINTAINABILITY;
+import static org.sonar.api.measures.CoreMetrics.DOMAIN_RELIABILITY;
+import static org.sonar.api.measures.CoreMetrics.DOMAIN_SECURITY;
+import static org.sonar.api.measures.CoreMetrics.DOMAIN_SECURITY_REVIEW;
+
+public class SoftwareQualitiesMetrics implements Metrics {
+
+  public static final String SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY = "software_quality_maintainability_rating";
+
+  public static final Metric<Integer> SOFTWARE_QUALITY_MAINTAINABILITY_RATING =
+    new Metric.Builder(SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY, "Software Quality Maintainability Rating", Metric.ValueType.RATING)
+      .setDescription("Software quality maintainability rating")
+      .setDomain(DOMAIN_MAINTAINABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setQualitative(true)
+      .setBestValue(1.0)
+      .setWorstValue(4.0)
+      .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY = "new_software_quality_maintainability_rating";
+
+  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING =
+    new Metric.Builder(NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY, "Software Quality Maintainability Rating on New Code",
+      Metric.ValueType.RATING)
+      .setDescription("Software quality maintainability rating on new code")
+      .setDomain(DOMAIN_MAINTAINABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setDeleteHistoricalData(true)
+      .setOptimizedBestValue(true)
+      .setQualitative(true)
+      .setBestValue(1.0)
+      .setWorstValue(4.0)
+      .create();
+
+  public static final String SOFTWARE_QUALITY_RELIABILITY_RATING_KEY = "software_quality_reliability_rating";
+
+  public static final Metric<Integer> SOFTWARE_QUALITY_RELIABILITY_RATING = new Metric.Builder(SOFTWARE_QUALITY_RELIABILITY_RATING_KEY,
+    "Software Quality Reliability Rating", Metric.ValueType.RATING)
+    .setDescription("Software quality reliability rating")
+    .setDomain(DOMAIN_RELIABILITY)
+    .setDirection(Metric.DIRECTION_WORST)
+    .setQualitative(true)
+    .setBestValue(1.0)
+    .setWorstValue(4.0)
+    .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY = "new_software_quality_reliability_rating";
+
+  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_RELIABILITY_RATING =
+    new Metric.Builder(NEW_SOFTWARE_QUALITY_RELIABILITY_RATING_KEY,
+    "Software Quality Reliability Rating on New Code", Metric.ValueType.RATING)
+    .setDescription("Software quality reliability rating on new code")
+    .setDomain(DOMAIN_RELIABILITY)
+    .setDirection(Metric.DIRECTION_WORST)
+    .setDeleteHistoricalData(true)
+    .setOptimizedBestValue(true)
+    .setQualitative(true)
+    .setBestValue(1.0)
+    .setWorstValue(4.0)
+    .create();
+
+  public static final String SOFTWARE_QUALITY_SECURITY_RATING_KEY = "software_quality_security_rating";
+
+  public static final Metric<Integer> SOFTWARE_QUALITY_SECURITY_RATING = new Metric.Builder(SOFTWARE_QUALITY_SECURITY_RATING_KEY,
+    "Software Quality Security Rating", Metric.ValueType.RATING)
+    .setDescription("Software quality security rating")
+    .setDomain(DOMAIN_SECURITY)
+    .setDirection(Metric.DIRECTION_WORST)
+    .setQualitative(true)
+    .setBestValue(1.0)
+    .setWorstValue(4.0)
+    .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY = "new_software_quality_security_rating";
+
+  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_SECURITY_RATING = new Metric.Builder(NEW_SOFTWARE_QUALITY_SECURITY_RATING_KEY,
+    "Software Quality Security Rating on New Code", Metric.ValueType.RATING)
+    .setDescription("Software quality security rating on new code")
+    .setDomain(DOMAIN_SECURITY)
+    .setDirection(Metric.DIRECTION_WORST)
+    .setDeleteHistoricalData(true)
+    .setOptimizedBestValue(true)
+    .setQualitative(true)
+    .setBestValue(1.0)
+    .setWorstValue(4.0)
+    .create();
+
+  public static final String SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY = "software_quality_security_review_rating";
+
+  public static final Metric<Integer> SOFTWARE_QUALITY_SECURITY_REVIEW_RATING =
+    new Metric.Builder(SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY, "Software Quality Security Review Rating", Metric.ValueType.RATING)
+      .setDescription("Software quality security review rating")
+      .setDomain(DOMAIN_SECURITY_REVIEW)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setQualitative(true)
+      .setBestValue(1.0)
+      .setWorstValue(4.0)
+      .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY = "new_software_quality_security_review_rating";
+
+  public static final Metric<Integer> NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING =
+    new Metric.Builder(NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY, "Software Quality Security Review Rating on New Code",
+      Metric.ValueType.RATING)
+      .setDescription("Software quality security review rating on new code")
+      .setDomain(DOMAIN_SECURITY_REVIEW)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setDeleteHistoricalData(true)
+      .setOptimizedBestValue(true)
+      .setQualitative(true)
+      .setBestValue(1.0)
+      .setWorstValue(4.0)
+      .create();
+
+  public static final String EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY =
+    "effort_to_reach_software_quality_maintainability_rating_a";
+
+  public static final Metric<Long> EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A =
+    new Metric.Builder(EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY,
+      "Software Quality Effort to Reach Maintainability Rating A", Metric.ValueType.WORK_DUR)
+      .setDescription("Software quality effort to reach maintainability rating A")
+      .setDomain(DOMAIN_MAINTAINABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setQualitative(true)
+      .setBestValue(0.0)
+      .setOptimizedBestValue(true)
+      .create();
+
+  public static final String SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY =
+    "software_quality_maintainability_remediation_effort";
+
+  public static final Metric<Long> SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT =
+    new Metric.Builder(SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Maintainability Remediation Effort",
+      Metric.ValueType.WORK_DUR)
+      .setDescription("Software quality total effort (in minutes) to fix all the maintainability issues on the component and therefore to comply to all the requirements.")
+      .setDomain(DOMAIN_MAINTAINABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY =
+    "new_software_quality_maintainability_remediation_effort";
+
+  public static final Metric<Long> NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT =
+    new Metric.Builder(NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Maintainability Remediation Effort on new code",
+      Metric.ValueType.WORK_DUR)
+      .setDescription("Software quality total effort (in minutes) to fix all the maintainability issues on new code on the component and therefore to comply to all the requirements.")
+      .setDomain(DOMAIN_MAINTAINABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .setDeleteHistoricalData(true)
+      .create();
+
+
+  public static final String SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY = "software_quality_security_remediation_effort";
+
+  public static final Metric<Long> SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT =
+    new Metric.Builder(SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY, "Software Quality Security Remediation Effort",
+      Metric.ValueType.WORK_DUR)
+      .setDescription("Software quality security remediation effort")
+      .setDomain(DOMAIN_SECURITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY = "new_software_quality_security_remediation_effort";
+
+  public static final Metric<Long> NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT =
+    new Metric.Builder(NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY, "Software Quality Security Remediation Effort on New Code",
+      Metric.ValueType.WORK_DUR)
+      .setDescription("Software quality security remediation effort on new code")
+      .setDomain(DOMAIN_SECURITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .setDeleteHistoricalData(true)
+      .create();
+
+  public static final String SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY = "software_quality_reliability_remediation_effort";
+
+  public static final Metric<Long> SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT =
+    new Metric.Builder(SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Reliability Remediation Effort",
+      Metric.ValueType.WORK_DUR)
+      .setDescription("Software quality reliability remediation effort")
+      .setDomain(DOMAIN_RELIABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY =
+    "new_software_quality_reliability_remediation_effort";
+
+  public static final Metric<Long> NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT =
+    new Metric.Builder(NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY, "Software Quality Reliability Remediation Effort on New Code",
+      Metric.ValueType.WORK_DUR)
+      .setDescription("Software quality reliability remediation effort on new code")
+      .setDomain(DOMAIN_RELIABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .setDeleteHistoricalData(true)
+      .create();
+
+  public static final String SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY = "software_quality_maintainability_debt_ratio";
+
+  public static final Metric<Double> SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO =
+    new Metric.Builder(SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY, "Software Quality Technical Debt Ratio", Metric.ValueType.PERCENT)
+      .setDescription("Software quality ratio of the actual technical debt compared to the estimated cost to develop the whole source code from scratch")
+      .setDomain(DOMAIN_MAINTAINABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .create();
+
+  public static final String NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY = "new_software_quality_maintainability_debt_ratio";
+
+  public static final Metric<Double> NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO =
+    new Metric.Builder(NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY, "Software Quality Technical Debt Ratio on New Code",
+      Metric.ValueType.PERCENT)
+      .setDescription("Software quality technical debt ratio software quality of new/changed code.")
+      .setDomain(DOMAIN_MAINTAINABILITY)
+      .setDirection(Metric.DIRECTION_WORST)
+      .setOptimizedBestValue(true)
+      .setBestValue(0.0)
+      .setQualitative(true)
+      .create();
+
+  @Override
+  public List<Metric> getMetrics() {
+    return List.of(
+      SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
+      NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
+      SOFTWARE_QUALITY_RELIABILITY_RATING,
+      NEW_SOFTWARE_QUALITY_RELIABILITY_RATING,
+      SOFTWARE_QUALITY_SECURITY_RATING,
+      NEW_SOFTWARE_QUALITY_SECURITY_RATING,
+      SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
+      NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
+      EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A,
+      SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
+      NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
+      SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
+      NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
+      SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
+      NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
+      SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO,
+      NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO
+    );
+  }
+}
diff --git a/sonar-core/src/test/java/org/sonar/core/metric/SoftwareQualitiesMetricsTest.java b/sonar-core/src/test/java/org/sonar/core/metric/SoftwareQualitiesMetricsTest.java
new file mode 100644 (file)
index 0000000..1f46975
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.core.metric;
+
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class SoftwareQualitiesMetricsTest {
+  @Test
+  void getMetrics() {
+    assertThat(new SoftwareQualitiesMetrics().getMetrics())
+      .containsExactlyInAnyOrder(
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_RATING,
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_RATING,
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_RATING,
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REVIEW_RATING,
+        SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A,
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT,
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT,
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT,
+        SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO,
+        SoftwareQualitiesMetrics.NEW_SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO);
+  }
+}