aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gradle.properties2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java7
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java6
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssue.java20
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java13
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRule.java20
-rw-r--r--sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssueTest.java9
-rw-r--r--sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRuleTest.java9
9 files changed, 50 insertions, 38 deletions
diff --git a/gradle.properties b/gradle.properties
index b2bb763418f..860b6f703cf 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -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
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
index ef83040304e..b26765e4c71 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
@@ -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) {
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index a99857b87f4..5029b572e3a 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -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
diff --git a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
index 39ba4662157..9d1309c7850 100644
--- a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
@@ -227,12 +227,6 @@ public class DefaultIssueTest {
}
@Test
- public void characteristic_shouldReturnNull() {
- DefaultIssue defaultIssue = new DefaultIssue();
- assertThat(defaultIssue.characteristic()).isNull();
- }
-
- @Test
public void setLine_whenLineIsNegative_shouldThrowException() {
int anyNegativeValue = Integer.MIN_VALUE;
assertThatThrownBy(() -> issue.setLine(anyNegativeValue))
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssue.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssue.java
index c12df1015e4..b8cd113e0b7 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssue.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssue.java
@@ -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;
@@ -64,6 +67,11 @@ public class DefaultExternalIssue extends AbstractDefaultIssue<DefaultExternalIs
}
@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;
}
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
index 6a585ae3779..4790c3f80a6 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
@@ -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;
@@ -77,6 +80,11 @@ public class DefaultIssue extends AbstractDefaultIssue<DefaultIssue> implements
}
@Override
+ public DefaultIssue overrideImpact(SoftwareQuality softwareQuality, org.sonar.api.issue.impact.Severity severity) {
+ return null;
+ }
+
+ @Override
public DefaultIssue setQuickFixAvailable(boolean quickFixAvailable) {
this.quickFixAvailable = quickFixAvailable;
return this;
@@ -135,6 +143,11 @@ public class DefaultIssue extends AbstractDefaultIssue<DefaultIssue> implements
}
@Override
+ public Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> overridenImpacts() {
+ return Collections.emptyMap();
+ }
+
+ @Override
public Double gap() {
return this.gap;
}
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRule.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRule.java
index 6ececae895f..2edc54cf8a3 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRule.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRule.java
@@ -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;
@@ -55,6 +58,11 @@ public class DefaultAdHocRule extends DefaultStorable implements AdHocRule, NewA
}
@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;
}
diff --git a/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssueTest.java b/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssueTest.java
index 4b48ec35902..3047ab7415b 100644
--- a/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssueTest.java
+++ b/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultExternalIssueTest.java
@@ -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();
- }
}
diff --git a/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRuleTest.java b/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRuleTest.java
index e46406b27e4..354a729c0bb 100644
--- a/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRuleTest.java
+++ b/sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRuleTest.java
@@ -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();
- }
}