diff options
author | Léo Geoffroy <leo.geoffroy@sonarsource.com> | 2023-08-18 14:03:55 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-08-21 20:02:47 +0000 |
commit | 072791ac2b31eb8f01b686b754c930a1ff4a600e (patch) | |
tree | c3d3e3fa4758c553c9498605a502ca1c9ea0e3cc /plugins | |
parent | 522573b028568e85648ca08e84feacb32726ec5c (diff) | |
download | sonarqube-072791ac2b31eb8f01b686b754c930a1ff4a600e.tar.gz sonarqube-072791ac2b31eb8f01b686b754c930a1ff4a600e.zip |
SONAR-20021 Fix Quality gate failure and issue with adhoc rule definition
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneExternalIssuePerLineSensor.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneExternalIssuePerLineSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneExternalIssuePerLineSensor.java index 03a18f350b2..84a11798a15 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneExternalIssuePerLineSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneExternalIssuePerLineSensor.java @@ -27,6 +27,8 @@ import org.sonar.api.batch.sensor.Sensor; import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.batch.sensor.SensorDescriptor; import org.sonar.api.batch.sensor.issue.NewExternalIssue; +import org.sonar.api.issue.impact.SoftwareQuality; +import org.sonar.api.rules.CleanCodeAttribute; import org.sonar.api.rules.RuleType; import org.sonar.xoo.Xoo; @@ -63,6 +65,9 @@ public class OneExternalIssuePerLineSensor implements Sensor { .description("blah blah") .severity(Severity.BLOCKER) .type(RuleType.BUG) + .cleanCodeAttribute(CleanCodeAttribute.CLEAR) + .addDefaultImpact(SoftwareQuality.MAINTAINABILITY, org.sonar.api.issue.impact.Severity.MEDIUM) + .addDefaultImpact(SoftwareQuality.RELIABILITY, org.sonar.api.issue.impact.Severity.LOW) .save(); } } @@ -78,6 +83,8 @@ public class OneExternalIssuePerLineSensor implements Sensor { .at(file.selectLine(line)) .message("This issue is generated on each line")) .severity(Severity.valueOf(SEVERITY)) + //Overrides default impact from the adhoc rule + .addImpact(SoftwareQuality.MAINTAINABILITY, org.sonar.api.issue.impact.Severity.HIGH) .remediationEffortMinutes(EFFORT) .type(TYPE) .save(); |