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
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;
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) {
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
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;
*/
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;
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;
return this;
}
+ @Override
+ public NewExternalIssue addImpact(SoftwareQuality softwareQuality, org.sonar.api.issue.impact.Severity severity) {
+ return this;
+ }
+
@Override
public String engineId() {
return engineId;
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;
}
}
@Override
- public NewExternalIssue characteristic(CodeCharacteristic characteristic) {
- // no op
+ public NewExternalIssue cleanCodeAttribute(CleanCodeAttribute attribute) {
return this;
}
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;
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;
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;
return this.overriddenSeverity;
}
+ @Override
+ public Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> overridenImpacts() {
+ return Collections.emptyMap();
+ }
+
@Override
public Double gap() {
return this.gap;
*/
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;
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;
return this;
}
+ @Override
+ public DefaultAdHocRule addDefaultImpact(SoftwareQuality softwareQuality, org.sonar.api.issue.impact.Severity severity) {
+ return this;
+ }
+
@Override
public String engineId() {
return engineId;
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;
}
}
@Override
- public NewAdHocRule characteristic(CodeCharacteristic characteristic) {
- // no op
+ public DefaultAdHocRule cleanCodeAttribute(CleanCodeAttribute attribute) {
return this;
}
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;
.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();
- }
}
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;
.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();
- }
}