diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2023-04-26 10:59:09 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-04-28 20:02:57 +0000 |
commit | db1a20f20ebcee549d47d0eb59b3b8882f58efef (patch) | |
tree | 6cdd75eaa9760dd5747f459cd44e5ebf7c5c8230 /plugins/sonar-xoo-plugin | |
parent | a8b0bf6f8eafc033ce0a1f97609a25f23a95b0bc (diff) | |
download | sonarqube-db1a20f20ebcee549d47d0eb59b3b8882f58efef.tar.gz sonarqube-db1a20f20ebcee549d47d0eb59b3b8882f58efef.zip |
Revert "SONAR-19050 Upgrade sonar-plugin-api to v9.16.0.549"
This reverts commit 27f1179c0cb7e4add8cb8c9f49d5864da4681c66.
Diffstat (limited to 'plugins/sonar-xoo-plugin')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java | 12 | ||||
-rw-r--r-- | plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java index 427cc2c31ca..058a8154414 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java @@ -21,8 +21,8 @@ package org.sonar.xoo.rule; import javax.annotation.Nullable; import org.sonar.api.SonarRuntime; -import org.sonar.api.code.CodeCharacteristic; import org.sonar.api.rule.RuleScope; +import org.sonar.api.rules.RuleCharacteristic; import org.sonar.api.rules.RuleType; import org.sonar.api.server.rule.RuleDescriptionSection; import org.sonar.api.server.rule.RuleParamType; @@ -146,7 +146,7 @@ public class XooRulesDefinition implements RulesDefinition { NewRule oneBugIssuePerTestLine = repo.createRule(OneBugIssuePerTestLineSensor.RULE_KEY).setName("One Bug Issue Per Test Line") .setScope(RuleScope.TEST) - .setType(RuleType.BUG).setCharacteristic(CodeCharacteristic.COMPLIANT); + .setType(RuleType.BUG).setCharacteristic(RuleCharacteristic.COMPLIANT); addAllDescriptionSections(oneBugIssuePerTestLine, "Generate a bug issue on each line of a test file. It requires the metric \"lines\"."); oneBugIssuePerTestLine @@ -190,7 +190,7 @@ public class XooRulesDefinition implements RulesDefinition { NewRule hotspotWithRangeAndMultipleLocations = repo.createRule(MultilineHotspotSensor.RULE_KEY) .setName("Creates hotspots with ranges/multiple locations") .setType(RuleType.SECURITY_HOTSPOT) - .setCharacteristic(CodeCharacteristic.PORTABLE); + .setCharacteristic(RuleCharacteristic.PORTABLE); addAllDescriptionSections(hotspotWithRangeAndMultipleLocations, "Hotspot with range and multiple locations"); NewRule issueOnEachFileWithExtUnknown = repo.createRule(OneIssuePerUnknownFileSensor.RULE_KEY).setName("Creates issues on each file with extension 'unknown'"); @@ -204,13 +204,13 @@ public class XooRulesDefinition implements RulesDefinition { NewRule oneCodeSmellIssuePerLine = repo.createRule(OneCodeSmellIssuePerLineSensor.RULE_KEY).setName("One Code Smell Issue Per Line") .setType(RuleType.CODE_SMELL) - .setCharacteristic(CodeCharacteristic.STRUCTURED); + .setCharacteristic(RuleCharacteristic.STRUCTURED); oneCodeSmellIssuePerLine .setDebtRemediationFunction(oneCodeSmellIssuePerLine.debtRemediationFunctions().linear("9min")); addAllDescriptionSections(oneCodeSmellIssuePerLine, "Generate a code smell issue on each line of a file. It requires the metric \"lines\"."); NewRule oneVulnerabilityIssuePerModule = repo.createRule(OneVulnerabilityIssuePerModuleSensor.RULE_KEY).setName("One Vulnerability Issue Per Module") - .setType(RuleType.VULNERABILITY).setCharacteristic(CodeCharacteristic.ROBUST); + .setType(RuleType.VULNERABILITY).setCharacteristic(RuleCharacteristic.ROBUST); addAllDescriptionSections(oneVulnerabilityIssuePerModule, "Generate an issue on each module"); oneVulnerabilityIssuePerModule @@ -276,7 +276,7 @@ public class XooRulesDefinition implements RulesDefinition { NewRule hotspotWithSingleContext = repo.createRule(HotspotWithSingleContextSensor.RULE_KEY) .setName("Find security hotspots, how_to_fix with single context") .setType(RuleType.SECURITY_HOTSPOT) - .setCharacteristic(CodeCharacteristic.SECURE) + .setCharacteristic(RuleCharacteristic.SECURE) .setActivatedByDefault(false) .addDescriptionSection(howToFixSectionWithContext("single_context")); addDescriptionSectionsWithoutContexts(hotspotWithSingleContext, "Search for Security Hotspots with single context in Xoo files"); diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java index ac96be2d050..d851fb4f26f 100644 --- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java +++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java @@ -23,9 +23,9 @@ import org.junit.Before; import org.junit.Test; import org.sonar.api.SonarEdition; import org.sonar.api.SonarQubeSide; -import org.sonar.api.code.CodeCharacteristic; import org.sonar.api.impl.server.RulesDefinitionContext; import org.sonar.api.internal.SonarRuntimeImpl; +import org.sonar.api.rules.RuleCharacteristic; import org.sonar.api.server.debt.DebtRemediationFunction; import org.sonar.api.server.rule.RulesDefinition; import org.sonar.api.utils.Version; @@ -120,7 +120,7 @@ public class XooRulesDefinitionTest { public void define_xoo_rule_with_characteristic() { RulesDefinition.Repository repo = context.repository("xoo"); RulesDefinition.Rule oneCodeSmellIssuePerLine = repo.rule("OneCodeSmellIssuePerLine"); - assertThat(oneCodeSmellIssuePerLine.characteristic()).isEqualTo(CodeCharacteristic.STRUCTURED); + assertThat(oneCodeSmellIssuePerLine.characteristic()).isEqualTo(RuleCharacteristic.STRUCTURED); } private RulesDefinition.Repository getRepository() { |