]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20021 Update plugin-api version
authorLéo Geoffroy <leo.geoffroy@sonarsource.com>
Fri, 28 Jul 2023 13:57:26 +0000 (15:57 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 18 Aug 2023 20:02:47 +0000 (20:02 +0000)
gradle.properties
sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
sonar-core/src/main/resources/org/sonar/l10n/core.properties
sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssue.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRule.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssueTest.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRuleTest.java

index b2bb763418fa830ee6a9497160ac7813806c6102..860b6f703cf9410a35faaaaab7f11b9685f10446 100644 (file)
@@ -1,6 +1,6 @@
 group=org.sonarsource.sonarqube
 version=10.2
-pluginApiVersion=10.0.0.695
+pluginApiVersion=10.0.0.778
 description=Open source platform for continuous inspection of code quality
 projectTitle=SonarQube
 org.gradle.jvmargs=-Xmx2048m
index ef83040304eee4aad390e582b92d71f672b5d3c6..b26765e4c71b37b8e9382bb254886a632fee745c 100644 (file)
@@ -40,8 +40,8 @@ import javax.annotation.Nullable;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.builder.ToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
-import org.sonar.api.code.CodeCharacteristic;
 import org.sonar.api.issue.Issue;
+import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.Severity;
 import org.sonar.api.rules.RuleType;
@@ -148,10 +148,9 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure.
     return type;
   }
 
-  @CheckForNull
   @Override
-  public CodeCharacteristic characteristic() {
-    return null;
+  public Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> impacts() {
+    return Collections.emptyMap();
   }
 
   public DefaultIssue setType(RuleType type) {
index a99857b87f40a4513f78fb188261c8501d533c06..5029b572e3a0e33920eea2b82e90a2be89dbd46d 100644 (file)
@@ -2942,7 +2942,7 @@ metric.skipped_tests.short_name=Skipped
 metric.sqale_debt_ratio.description=Ratio of the actual technical debt compared to the estimated cost to develop the whole source code from scratch
 metric.sqale_debt_ratio.name=Technical Debt Ratio
 metric.sqale_debt_ratio.short_name=Debt Ratio
-metric.sqale_index.description=Total effort (in hours) to fix all the issues on the component and therefore to comply to all the requirements.
+metric.sqale_index.description=Total effort (in minutes) to fix all the issues on the component and therefore to comply to all the requirements.
 metric.sqale_index.name=Technical Debt
 metric.sqale_index.short_name=Debt
 metric.sqale_rating.description=A-to-E rating based on the technical debt ratio
index 39ba46621574e22d3381cb9fb83c176cb594b8fd..9d1309c78503e7df2fb8fd3a9a8e0bbfb2a3f6ca 100644 (file)
@@ -226,12 +226,6 @@ public class DefaultIssueTest {
     assertThat(defaultIssue.isQuickFixAvailable()).isFalse();
   }
 
-  @Test
-  public void characteristic_shouldReturnNull() {
-    DefaultIssue defaultIssue = new DefaultIssue();
-    assertThat(defaultIssue.characteristic()).isNull();
-  }
-
   @Test
   public void setLine_whenLineIsNegative_shouldThrowException() {
     int anyNegativeValue = Integer.MIN_VALUE;
index c12df1015e43d15def92e220746a7e2d97295102..b8cd113e0b7437a99de44a93a22100711a6ae215 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.api.batch.sensor.issue.internal;
 
+import java.util.Collections;
+import java.util.Map;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.sonar.api.batch.fs.internal.DefaultInputProject;
@@ -26,8 +28,9 @@ import org.sonar.api.batch.rule.Severity;
 import org.sonar.api.batch.sensor.internal.SensorStorage;
 import org.sonar.api.batch.sensor.issue.ExternalIssue;
 import org.sonar.api.batch.sensor.issue.NewExternalIssue;
-import org.sonar.api.code.CodeCharacteristic;
+import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rule.RuleKey;
+import org.sonar.api.rules.CleanCodeAttribute;
 import org.sonar.api.rules.RuleType;
 
 import static java.lang.String.format;
@@ -63,6 +66,11 @@ public class DefaultExternalIssue extends AbstractDefaultIssue<DefaultExternalIs
     return this;
   }
 
+  @Override
+  public NewExternalIssue addImpact(SoftwareQuality softwareQuality, org.sonar.api.issue.impact.Severity severity) {
+    return this;
+  }
+
   @Override
   public String engineId() {
     return engineId;
@@ -99,9 +107,14 @@ public class DefaultExternalIssue extends AbstractDefaultIssue<DefaultExternalIs
     return type;
   }
 
+  @Override
+  public Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> impacts() {
+    return Collections.emptyMap();
+  }
+
   @CheckForNull
   @Override
-  public CodeCharacteristic characteristic() {
+  public CleanCodeAttribute cleanCodeAttribute() {
     return null;
   }
 
@@ -139,8 +152,7 @@ public class DefaultExternalIssue extends AbstractDefaultIssue<DefaultExternalIs
   }
 
   @Override
-  public NewExternalIssue characteristic(CodeCharacteristic characteristic) {
-    // no op
+  public NewExternalIssue cleanCodeAttribute(CleanCodeAttribute attribute) {
     return this;
   }
 
index 6a585ae377914d8ca705a3a7b7d85f1c88617e8a..4790c3f80a64d3dd67690ad9b9b58446841def23 100644 (file)
@@ -20,7 +20,9 @@
 package org.sonar.api.batch.sensor.issue.internal;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 import javax.annotation.Nullable;
 import org.sonar.api.batch.fs.internal.DefaultInputProject;
@@ -31,6 +33,7 @@ import org.sonar.api.batch.sensor.issue.IssueLocation;
 import org.sonar.api.batch.sensor.issue.NewIssue;
 import org.sonar.api.batch.sensor.issue.fix.NewQuickFix;
 import org.sonar.api.batch.sensor.issue.fix.QuickFix;
+import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rule.RuleKey;
 
 import static java.lang.String.format;
@@ -76,6 +79,11 @@ public class DefaultIssue extends AbstractDefaultIssue<DefaultIssue> implements
     return this;
   }
 
+  @Override
+  public DefaultIssue overrideImpact(SoftwareQuality softwareQuality, org.sonar.api.issue.impact.Severity severity) {
+    return null;
+  }
+
   @Override
   public DefaultIssue setQuickFixAvailable(boolean quickFixAvailable) {
     this.quickFixAvailable = quickFixAvailable;
@@ -134,6 +142,11 @@ public class DefaultIssue extends AbstractDefaultIssue<DefaultIssue> implements
     return this.overriddenSeverity;
   }
 
+  @Override
+  public Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> overridenImpacts() {
+    return Collections.emptyMap();
+  }
+
   @Override
   public Double gap() {
     return this.gap;
index 6ececae895f50f7fcd3676fdd88545973fc35fc3..2edc54cf8a3d443f3fbcb0ce7cacf2517f1e2aef 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.api.batch.sensor.rule.internal;
 
+import java.util.Collections;
+import java.util.Map;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.sonar.api.batch.rule.Severity;
@@ -26,7 +28,8 @@ import org.sonar.api.batch.sensor.internal.DefaultStorable;
 import org.sonar.api.batch.sensor.internal.SensorStorage;
 import org.sonar.api.batch.sensor.rule.AdHocRule;
 import org.sonar.api.batch.sensor.rule.NewAdHocRule;
-import org.sonar.api.code.CodeCharacteristic;
+import org.sonar.api.issue.impact.SoftwareQuality;
+import org.sonar.api.rules.CleanCodeAttribute;
 import org.sonar.api.rules.RuleType;
 
 import static org.apache.commons.lang.StringUtils.isNotBlank;
@@ -54,6 +57,11 @@ public class DefaultAdHocRule extends DefaultStorable implements AdHocRule, NewA
     return this;
   }
 
+  @Override
+  public DefaultAdHocRule addDefaultImpact(SoftwareQuality softwareQuality, org.sonar.api.issue.impact.Severity severity) {
+    return this;
+  }
+
   @Override
   public String engineId() {
     return engineId;
@@ -95,9 +103,14 @@ public class DefaultAdHocRule extends DefaultStorable implements AdHocRule, NewA
     return type;
   }
 
+  @Override
+  public Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> defaultImpacts() {
+    return Collections.emptyMap();
+  }
+
   @CheckForNull
   @Override
-  public CodeCharacteristic characteristic() {
+  public CleanCodeAttribute cleanCodeAttribute() {
     return null;
   }
 
@@ -132,8 +145,7 @@ public class DefaultAdHocRule extends DefaultStorable implements AdHocRule, NewA
   }
 
   @Override
-  public NewAdHocRule characteristic(CodeCharacteristic characteristic) {
-    // no op
+  public DefaultAdHocRule cleanCodeAttribute(CleanCodeAttribute attribute) {
     return this;
   }
 
index 4b48ec359029b2d98a454cf066d6cc1062774b94..3047ab7415bd20be4fe42ea378f982d1069cfab2 100644 (file)
@@ -30,7 +30,6 @@ import org.sonar.api.batch.fs.internal.DefaultInputProject;
 import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
 import org.sonar.api.batch.rule.Severity;
 import org.sonar.api.batch.sensor.internal.SensorStorage;
-import org.sonar.api.code.CodeCharacteristic;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rules.RuleType;
 
@@ -163,12 +162,4 @@ public class DefaultExternalIssueTest {
       .isInstanceOf(IllegalStateException.class)
       .hasMessageContaining("Severity is mandatory");
   }
-
-  @Test
-  public void characteristic_shouldBeNoOp() {
-    SensorStorage storage = mock(SensorStorage.class);
-    DefaultExternalIssue issue = new DefaultExternalIssue(project, storage);
-    issue.characteristic(CodeCharacteristic.ROBUST);
-    assertThat(issue.characteristic()).isNull();
-  }
 }
index e46406b27e41bc22f6b145c848a1070dbff28430..354a729c0bb0de81ef9d342aa60c018ef0fbce20 100644 (file)
@@ -23,7 +23,6 @@ import org.junit.Test;
 import org.sonar.api.batch.rule.Severity;
 import org.sonar.api.batch.sensor.internal.SensorStorage;
 import org.sonar.api.batch.sensor.rule.NewAdHocRule;
-import org.sonar.api.code.CodeCharacteristic;
 import org.sonar.api.rules.RuleType;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -147,12 +146,4 @@ public class DefaultAdHocRuleTest {
       .isInstanceOf(IllegalStateException.class)
       .hasMessageContaining("Type is mandatory");
   }
-
-  @Test
-  public void characteristic_shouldBeNoOp() {
-    SensorStorage storage = mock(SensorStorage.class);
-    DefaultAdHocRule rule = new DefaultAdHocRule(storage);
-    rule.characteristic(CodeCharacteristic.CLEAR);
-    assertThat(rule.characteristic()).isNull();
-  }
 }