]> source.dussan.org Git - sonarqube.git/commitdiff
Remove deprecated calls to RulesDefinition#setDebtSubCharacteristic()
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 1 Mar 2016 20:13:10 +0000 (21:13 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 2 Mar 2016 09:36:37 +0000 (10:36 +0100)
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java
server/sonar-server/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java
server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java

index 51cc027087b58e3114257771dd2f4367c4d7a849..f93a5eaba5b763aeb93c368f3ee76db495e53b95 100644 (file)
@@ -48,7 +48,7 @@ public class XooRulesDefinition implements RulesDefinition {
 
     NewRule oneIssuePerLine = repo.createRule(OneIssuePerLineSensor.RULE_KEY).setName("One Issue Per Line")
       .setHtmlDescription("Generate an issue on each line of a file. It requires the metric \"lines\".");
-    oneIssuePerLine.setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.MEMORY_EFFICIENCY)
+    oneIssuePerLine
       .setDebtRemediationFunction(hasTag.debtRemediationFunctions().linear("1min"))
       .setEffortToFixDescription("It takes about 1 minute to an experienced software craftsman to remove a line of code");
 
@@ -62,7 +62,7 @@ public class XooRulesDefinition implements RulesDefinition {
 
     NewRule hasTag = repo.createRule(HasTagSensor.RULE_KEY).setName("Has Tag")
       .setHtmlDescription("Search for a given tag in Xoo files");
-    hasTag.setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.READABILITY)
+    hasTag
       .setDebtRemediationFunction(hasTag.debtRemediationFunctions().constantPerIssue("2min"));
     hasTag.createParam("tag")
       .setDefaultValue("xoo")
@@ -78,7 +78,7 @@ public class XooRulesDefinition implements RulesDefinition {
 
     NewRule oneIssuePerLine = repo.createRule(OneIssuePerLineSensor.RULE_KEY).setName("One Issue Per Line")
       .setHtmlDescription("Generate an issue on each line of a file. It requires the metric \"lines\".");
-    oneIssuePerLine.setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.MEMORY_EFFICIENCY)
+    oneIssuePerLine
       .setDebtRemediationFunction(hasTag.debtRemediationFunctions().linear("1min"))
       .setEffortToFixDescription("It takes about 1 minute to an experienced software craftsman to remove a line of code");
 
@@ -87,17 +87,15 @@ public class XooRulesDefinition implements RulesDefinition {
 
     NewRule oneIssuePerFile = repo.createRule(OneIssuePerFileSensor.RULE_KEY).setName("One Issue Per File")
       .setHtmlDescription("Generate an issue on each file");
-    oneIssuePerFile.setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_CHANGEABILITY)
-      .setDebtRemediationFunction(hasTag.debtRemediationFunctions().linear("10min"));
+    oneIssuePerFile.setDebtRemediationFunction(hasTag.debtRemediationFunctions().linear("10min"));
 
     NewRule oneDayDebtPerFile = repo.createRule(OneDayDebtPerFileSensor.RULE_KEY).setName("One Day Debt Per File")
       .setHtmlDescription("Generate an issue on each file with a debt of one day");
-    oneDayDebtPerFile.setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
-      .setDebtRemediationFunction(hasTag.debtRemediationFunctions().linear("1d"));
+    oneDayDebtPerFile.setDebtRemediationFunction(hasTag.debtRemediationFunctions().linear("1d"));
 
     NewRule oneIssuePerModule = repo.createRule(OneIssuePerModuleSensor.RULE_KEY).setName("One Issue Per Module")
       .setHtmlDescription("Generate an issue on each module");
-    oneIssuePerModule.setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.API_ABUSE)
+    oneIssuePerModule
       .setDebtRemediationFunction(hasTag.debtRemediationFunctions().linearWithOffset("25min", "1h"))
       .setEffortToFixDescription("A certified architect will need roughly half an hour to start working on removal of modules, " +
         "then it's about one hour per module.");
index 1f065c95b5bea760df773c424148b8f3b559ebb8..5c957918db122ba8294406f8b9bc6389116019c9 100644 (file)
@@ -62,7 +62,6 @@ public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions {
       .addTags("bad-practice")
       .setHtmlDescription("An issue is created on a file as soon as the branch coverage on this file is less than the required threshold."
         + "It gives the number of branches to be covered in order to reach the required threshold.")
-      .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.UNIT_TESTABILITY)
       .setDebtRemediationFunction(rule.debtRemediationFunctions().linear("5min"))
       .setEffortToFixDescription("number of uncovered conditions")
       .setSeverity(Severity.MAJOR);
@@ -78,7 +77,6 @@ public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions {
       .addTags("bad-practice")
       .setHtmlDescription("An issue is created on a file as soon as the line coverage on this file is less than the required threshold. " +
         "It gives the number of lines to be covered in order to reach the required threshold.")
-      .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.UNIT_TESTABILITY)
       .setDebtRemediationFunction(rule.debtRemediationFunctions().linear("2min"))
       .setEffortToFixDescription("number of lines under the coverage threshold")
       .setSeverity(Severity.MAJOR);
@@ -94,7 +92,6 @@ public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions {
       .addTags("convention")
       .setHtmlDescription("An issue is created on a file as soon as the density of comment lines on this file is less than the required threshold. " +
         "The number of comment lines to be written in order to reach the required threshold is provided by each issue message.")
-      .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.UNDERSTANDABILITY)
       .setDebtRemediationFunction(rule.debtRemediationFunctions().linear("2min"))
       .setEffortToFixDescription("number of lines required to meet minimum density")
       .setSeverity(Severity.MAJOR);
@@ -109,7 +106,6 @@ public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions {
     rule.setName("Source files should not have any duplicated blocks")
       .addTags("pitfall")
       .setHtmlDescription("An issue is created on a file as soon as there is at least one block of duplicated code on this file")
-      .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.LOGIC_CHANGEABILITY)
       .setDebtRemediationFunction(rule.debtRemediationFunctions().linearWithOffset("10min", "10min"))
       .setEffortToFixDescription("number of duplicate blocks")
       .setSeverity(Severity.MAJOR);
@@ -122,7 +118,6 @@ public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions {
       .addTags("bug")
       .setHtmlDescription(
         "Test failures or errors generally indicate that regressions have been introduced. Those tests should be handled as soon as possible to reduce the cost to fix the corresponding regressions.")
-      .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.UNIT_TESTABILITY)
       .setDebtRemediationFunction(rule.debtRemediationFunctions().linear("10min"))
       .setEffortToFixDescription("number of failed tests")
       .setSeverity(Severity.MAJOR);
@@ -133,7 +128,6 @@ public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions {
     rule.setName("Skipped unit tests should be either removed or fixed")
       .addTags("pitfall")
       .setHtmlDescription("Skipped unit tests are considered as dead code. Either they should be activated again (and updated) or they should be removed.")
-      .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.UNIT_TESTABILITY)
       .setDebtRemediationFunction(rule.debtRemediationFunctions().linear("10min"))
       .setEffortToFixDescription("number of skipped tests")
       .setSeverity(Severity.MAJOR);
index ade56882e969cb4e26bd46df2028e264ca0683de..7be05abe909b9ad98383f5811272dab7121900ae 100644 (file)
@@ -281,7 +281,6 @@ public class RegisterRulesMediumTest {
           .setTemplate(true)
           .setInternalKey("new_internal");
         rule
-          .setDebtSubCharacteristic(RulesDefinition.SubCharacteristics.INTEGRATION_TESTABILITY)
           .setDebtRemediationFunction(rule.debtRemediationFunctions().linearWithOffset("1h", "30min"))
           .setEffortToFixDescription("Effort");
       }
index d0c2b3332ba219d797262c1d87eb88efbd319a26..b1b9b183356c1d4fd7b1f885ab5742ab9a634681 100644 (file)
@@ -358,7 +358,6 @@ public class RegisterRulesTest {
         .setInternalKey("config1")
         .setTags("tag1", "tag2", "tag3")
         .setStatus(RuleStatus.BETA)
-        .setDebtSubCharacteristic("MEMORY_EFFICIENCY")
         .setEffortToFixDescription("squid.S115.effortToFix");
       rule1.setDebtRemediationFunction(rule1.debtRemediationFunctions().linearWithOffset("5d", "10h"));
 
@@ -389,7 +388,6 @@ public class RegisterRulesTest {
         // tag2 and tag3 removed, tag4 added
         .setTags("tag1", "tag4")
         .setStatus(RuleStatus.READY)
-        .setDebtSubCharacteristic("MEMORY_EFFICIENCY")
         .setEffortToFixDescription("squid.S115.effortToFix.v2");
       rule1.setDebtRemediationFunction(rule1.debtRemediationFunctions().linearWithOffset("6d", "2h"));
       rule1.createParam("param1").setDescription("parameter one v2").setDefaultValue("default1 v2");