]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7453 Rename rules remediation function fields in WS
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 8 Mar 2016 20:06:35 +0000 (21:06 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 10 Mar 2016 14:20:40 +0000 (15:20 +0100)
13 files changed:
server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapper.java
server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/rule/ws/UpdateAction.java
server/sonar-server/src/main/resources/org/sonar/server/rule/ws/example-show.json
server/sonar-server/src/test/java/org/sonar/server/rule/ws/ShowActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/UpdateActionMediumTest.java
server/sonar-server/src/test/resources/org/sonar/server/rule/ws/ShowActionMediumTest/show_deprecated_rule_rem_function_fields.json [new file with mode: 0644]
server/sonar-server/src/test/resources/org/sonar/server/rule/ws/ShowActionMediumTest/show_rule_with_default_and_overridden_debt_infos.json
server/sonar-server/src/test/resources/org/sonar/server/rule/ws/ShowActionMediumTest/show_rule_with_default_debt_infos.json
server/sonar-server/src/test/resources/org/sonar/server/rule/ws/ShowActionMediumTest/show_rule_with_overridden_debt_infos.json
server/sonar-server/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/deprecated_remediation_function.json [new file with mode: 0644]
server/sonar-server/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/update_rule_remediation_function.json [new file with mode: 0644]
sonar-ws/src/main/protobuf/ws-rules.proto

index 46cec77119a7bf273a5460a8f72f740a1da31748..a62a20af8d4e8a3dc1b8caa8fc218078e05eedcc 100644 (file)
@@ -116,6 +116,7 @@ public class RuleMapper {
   private static void setEffortToFixDescription(Rules.Rule.Builder ruleResponse, RuleDto ruleDto, Set<String> fieldsToReturn) {
     if (shouldReturnField(fieldsToReturn, FIELD_EFFORT_TO_FIX_DESCRIPTION) && ruleDto.getGapDescription() != null) {
       ruleResponse.setEffortToFixDescription(ruleDto.getGapDescription());
+      ruleResponse.setGapDescription(ruleDto.getGapDescription());
     }
   }
 
@@ -129,13 +130,21 @@ public class RuleMapper {
     if (shouldReturnField(fieldsToReturn, FIELD_DEFAULT_DEBT_REM_FUNCTION)) {
       DebtRemediationFunction defaultDebtRemediationFunction = defaultDebtRemediationFunction(ruleDto);
       if (defaultDebtRemediationFunction != null) {
-        if (defaultDebtRemediationFunction.coefficient() != null) {
-          ruleResponse.setDefaultDebtRemFnCoeff(defaultDebtRemediationFunction.coefficient());
+        String gapMultiplier = defaultDebtRemediationFunction.coefficient();
+        if (gapMultiplier != null) {
+          ruleResponse.setDefaultRemFnGapMultiplier(gapMultiplier);
+          // Set deprecated field
+          ruleResponse.setDefaultDebtRemFnCoeff(gapMultiplier);
         }
-        if (defaultDebtRemediationFunction.offset() != null) {
-          ruleResponse.setDefaultDebtRemFnOffset(defaultDebtRemediationFunction.offset());
+        String baseEffort = defaultDebtRemediationFunction.offset();
+        if (baseEffort != null) {
+          ruleResponse.setDefaultRemFnBaseEffort(baseEffort);
+          // Set deprecated field
+          ruleResponse.setDefaultDebtRemFnOffset(baseEffort);
         }
         if (defaultDebtRemediationFunction.type() != null) {
+          ruleResponse.setDefaultRemFnType(defaultDebtRemediationFunction.type().name());
+          // Set deprecated field
           ruleResponse.setDefaultDebtRemFnType(defaultDebtRemediationFunction.type().name());
         }
       }
@@ -147,13 +156,21 @@ public class RuleMapper {
       DebtRemediationFunction debtRemediationFunction = debtRemediationFunction(ruleDto);
       if (debtRemediationFunction != null) {
         if (debtRemediationFunction.type() != null) {
+          ruleResponse.setRemFnType(debtRemediationFunction.type().name());
+          // Set deprecated field
           ruleResponse.setDebtRemFnType(debtRemediationFunction.type().name());
         }
-        if (debtRemediationFunction.coefficient() != null) {
-          ruleResponse.setDebtRemFnCoeff(debtRemediationFunction.coefficient());
+        String gapMultiplier = debtRemediationFunction.coefficient();
+        if (gapMultiplier != null) {
+          ruleResponse.setRemFnGapMultiplier(gapMultiplier);
+          // Set deprecated field
+          ruleResponse.setDebtRemFnCoeff(gapMultiplier);
         }
-        if (debtRemediationFunction.offset() != null) {
-          ruleResponse.setDebtRemFnOffset(debtRemediationFunction.offset());
+        String baseEffort = debtRemediationFunction.offset();
+        if (baseEffort != null) {
+          ruleResponse.setRemFnBaseEffort(baseEffort);
+          // Set deprecated field
+          ruleResponse.setDebtRemFnOffset(baseEffort);
         }
       }
     }
index 5abe06e24903270ada489ca9b03d0463c3b1bd09..6d64787c07b72508a1c3d7f6f41702af965d0c07 100644 (file)
@@ -164,7 +164,13 @@ public class SearchAction implements RulesWsAction {
   }
 
   protected void doDefinition(WebService.NewAction action) {
-    action.setDescription("Search for a collection of relevant rules matching a specified query")
+    action.setDescription("Search for a collection of relevant rules matching a specified query.<br/>" +
+      "Since 5.5, following fields in the response have been deprecated :" +
+      "<ul><li>\"effortToFixDescription\" becomes \"gapDescription\"</li>" +
+      "<li>\"debtRemFnCoeff\" becomes \"debtRemFnGapMultiplier\"</li>" +
+      "<li>\"defaultDebtRemFnCoeff\" becomes \"defaultDebtRemFnGapMultiplier\"</li>" +
+      "<li>\"debtRemFnOffset\" becomes \"debtRemFnBaseEffort\"</li>" +
+      "<li>\"defaultDebtRemFnOffset\" becomes \"defaultDebtRemFnBaseEffort\"</li></ul>")
       .setResponseExample(Resources.getResource(getClass(), "example-search.json"))
       .setSince("4.4")
       .setHandler(this);
index 61b11d32750745af8a50a41a561e78dcfee3a6b7..1ac8117fff409b99a44050f293bd7ad91cbcc231 100644 (file)
@@ -46,6 +46,7 @@ import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.Rules.UpdateResponse;
 
 import static java.util.Collections.singletonList;
+import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
 import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 
@@ -54,10 +55,12 @@ public class UpdateAction implements RulesWsAction {
   public static final String PARAM_KEY = "key";
   public static final String PARAM_TAGS = "tags";
   public static final String PARAM_MARKDOWN_NOTE = "markdown_note";
-  public static final String PARAM_DEBT_SUB_CHARACTERISTIC = "debt_sub_characteristic";
-  public static final String PARAM_DEBT_REMEDIATION_FN_TYPE = "debt_remediation_fn_type";
-  public static final String PARAM_DEBT_REMEDIATION_FN_OFFSET = "debt_remediation_fn_offset";
-  public static final String PARAM_DEBT_REMEDIATION_FY_COEFF = "debt_remediation_fy_coeff";
+  public static final String PARAM_REMEDIATION_FN_TYPE = "remediation_fn_type";
+  public static final String DEPRECATED_PARAM_REMEDIATION_FN_TYPE = "debt_remediation_fn_type";
+  public static final String PARAM_REMEDIATION_FN_BASE_EFFORT = "remediation_fn_base_effort";
+  public static final String DEPRECATED_PARAM_REMEDIATION_FN_OFFSET = "debt_remediation_fn_offset";
+  public static final String PARAM_REMEDIATION_FN_GAP_MULTIPLIER = "remediation_fy_gap_multiplier";
+  public static final String DEPRECATED_PARAM_REMEDIATION_FN_COEFF = "debt_remediation_fy_coeff";
   public static final String PARAM_NAME = "name";
   public static final String PARAM_DESCRIPTION = "markdown_description";
   public static final String PARAM_SEVERITY = "severity";
@@ -100,18 +103,34 @@ public class UpdateAction implements RulesWsAction {
         "if the parameter is not set.")
       .setExampleValue("my *note*");
 
-    action.createParam(PARAM_DEBT_SUB_CHARACTERISTIC)
+    action.createParam("debt_sub_characteristic")
       .setDescription("Debt characteristics are no more supported. This parameter is ignored.")
       .setDeprecatedSince("5.5");
 
-    action.createParam(PARAM_DEBT_REMEDIATION_FN_TYPE)
+    action.createParam(PARAM_REMEDIATION_FN_TYPE)
+      .setDescription("Type of the remediation function of the rule")
+      .setPossibleValues(DebtRemediationFunction.Type.values())
+      .setSince("5.5");
+
+    action.createParam(DEPRECATED_PARAM_REMEDIATION_FN_TYPE)
+      .setDeprecatedSince("5.5")
       .setPossibleValues(DebtRemediationFunction.Type.values());
 
-    action.createParam(PARAM_DEBT_REMEDIATION_FN_OFFSET)
-      .setExampleValue("1d");
+    action.createParam(PARAM_REMEDIATION_FN_BASE_EFFORT)
+      .setDescription("Base effort of the remediation function of the rule")
+      .setExampleValue("1d")
+      .setSince("5.5");
+
+    action.createParam(DEPRECATED_PARAM_REMEDIATION_FN_OFFSET)
+      .setDeprecatedSince("5.5");
 
-    action.createParam(PARAM_DEBT_REMEDIATION_FY_COEFF)
-      .setExampleValue("3min");
+    action.createParam(PARAM_REMEDIATION_FN_GAP_MULTIPLIER)
+      .setDeprecatedSince("Gap multiplier of the remediation function of the rule")
+      .setExampleValue("3min")
+      .setSince("5.5");
+
+    action.createParam(DEPRECATED_PARAM_REMEDIATION_FN_COEFF)
+      .setDeprecatedSince("5.5");
 
     action
       .createParam(PARAM_NAME)
@@ -216,14 +235,15 @@ public class UpdateAction implements RulesWsAction {
   }
 
   private void readDebt(Request request, RuleUpdate update) {
-    String value = request.param(PARAM_DEBT_REMEDIATION_FN_TYPE);
+    String value = defaultIfEmpty(request.param(PARAM_REMEDIATION_FN_TYPE), request.param(DEPRECATED_PARAM_REMEDIATION_FN_TYPE));
     if (value != null) {
       if (StringUtils.isBlank(value)) {
         update.setDebtRemediationFunction(null);
       } else {
         DebtRemediationFunction fn = new DefaultDebtRemediationFunction(
-          DebtRemediationFunction.Type.valueOf(value), request.param(PARAM_DEBT_REMEDIATION_FY_COEFF),
-          request.param(PARAM_DEBT_REMEDIATION_FN_OFFSET));
+          DebtRemediationFunction.Type.valueOf(value),
+          defaultIfEmpty(request.param(PARAM_REMEDIATION_FN_GAP_MULTIPLIER), request.param(DEPRECATED_PARAM_REMEDIATION_FN_COEFF)),
+          defaultIfEmpty(request.param(PARAM_REMEDIATION_FN_BASE_EFFORT), request.param(DEPRECATED_PARAM_REMEDIATION_FN_OFFSET)));
         update.setDebtRemediationFunction(fn);
       }
     }
index 3a4041a2fcfcdb576fa09c8c4e295aa9238c3d9b..48439fc3f055d84d56e5ab46707fe98baa677efb 100644 (file)
@@ -11,7 +11,7 @@
     "sysTags": ["brain-overload"],
     "debtSubChar": "39",
     "debtRemFnType": "CONSTANT_ISSUE",
-    "debtRemFnOffset": "10min",
+    "debtRemFnBaseEffort": "10min",
     "lang": "java",
     "langName": "Java",
     "type": "CODE_SMELL",
index 538fb438be8ed3b59411221f5b516a200d326f40..28d8552ad9483a9083c6e6e34d130ce07de0f6e8 100644 (file)
@@ -233,4 +233,27 @@ public class ShowActionMediumTest {
     request.execute().assertJson(getClass(), "encode_html_description_of_manual_rule.json");
   }
 
+  @Test
+  public void show_deprecated_rule_rem_function_fields() throws Exception {
+    RuleDto ruleDto = RuleTesting.newDto(RuleKey.of("java", "S001"))
+      .setName("Rule S001")
+      .setDescription("Rule S001 <b>description</b>")
+      .setSeverity(Severity.MINOR)
+      .setStatus(RuleStatus.BETA)
+      .setConfigKey("InternalKeyS001")
+      .setLanguage("xoo")
+      .setDefaultRemediationFunction("LINEAR_OFFSET")
+      .setDefaultRemediationGapMultiplier("6d")
+      .setDefaultRemediationBaseEffort("11h")
+      .setRemediationFunction("LINEAR_OFFSET")
+      .setRemediationGapMultiplier("5d")
+      .setRemediationBaseEffort("10h");
+    ruleDao.insert(session, ruleDto);
+    session.commit();
+
+    WsTester.TestRequest request = wsTester.newGetRequest("api/rules", "show")
+      .setParam("key", ruleDto.getKey().toString());
+    request.execute().assertJson(getClass(), "show_deprecated_rule_rem_function_fields.json");
+  }
+
 }
index d5a7c481057d49cf3a9fb120983fe3816da27cc5..d9cd19b4512f2efd8fb180ff31be27de1c2ed177 100644 (file)
@@ -43,6 +43,11 @@ import org.sonar.server.ws.WsTester;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.fail;
+import static org.sonar.api.server.debt.DebtRemediationFunction.Type.LINEAR;
+import static org.sonar.api.server.debt.DebtRemediationFunction.Type.LINEAR_OFFSET;
+import static org.sonar.server.rule.ws.UpdateAction.PARAM_REMEDIATION_FN_BASE_EFFORT;
+import static org.sonar.server.rule.ws.UpdateAction.PARAM_REMEDIATION_FN_GAP_MULTIPLIER;
+import static org.sonar.server.rule.ws.UpdateAction.PARAM_REMEDIATION_FN_TYPE;
 
 public class UpdateActionMediumTest {
 
@@ -73,6 +78,47 @@ public class UpdateActionMediumTest {
     session.close();
   }
 
+  @Test
+  public void update_rule_remediation_function() throws Exception {
+    RuleDto rule = RuleTesting.newXooX1()
+      .setDefaultRemediationFunction(LINEAR.toString())
+      .setDefaultRemediationGapMultiplier("10d")
+      .setDefaultRemediationBaseEffort(null)
+      .setRemediationFunction(null)
+      .setRemediationGapMultiplier(null)
+      .setRemediationBaseEffort(null);
+    ruleDao.insert(session, rule);
+    session.commit();
+
+    WsTester.TestRequest request = wsTester.newPostRequest("api/rules", "update")
+      .setParam("key", rule.getKey().toString())
+      .setParam(PARAM_REMEDIATION_FN_TYPE, LINEAR_OFFSET.toString())
+      .setParam(PARAM_REMEDIATION_FN_GAP_MULTIPLIER, "15d")
+      .setParam(PARAM_REMEDIATION_FN_BASE_EFFORT, "5min")
+      ;
+    request.execute().assertJson(getClass(), "update_rule_remediation_function.json");
+  }
+
+  @Test
+  public void update_custom_rule_with_deprecated_remediation_function_parameters() throws Exception {
+    RuleDto rule = RuleTesting.newXooX1()
+      .setDefaultRemediationFunction(LINEAR_OFFSET.toString())
+      .setDefaultRemediationGapMultiplier("10d")
+      .setDefaultRemediationBaseEffort("5min")
+      .setRemediationFunction(LINEAR_OFFSET.toString())
+      .setRemediationGapMultiplier("15min")
+      .setRemediationBaseEffort("3h");
+    ruleDao.insert(session, rule);
+    session.commit();
+
+    WsTester.TestRequest request = wsTester.newPostRequest("api/rules", "update")
+      .setParam("key", rule.getKey().toString())
+      .setParam("debt_remediation_fn_type", LINEAR_OFFSET.toString())
+      .setParam("debt_remediation_fy_coeff", "11d")
+      .setParam("debt_remediation_fn_offset", "6min");
+    request.execute().assertJson(getClass(), "deprecated_remediation_function.json");
+  }
+
   @Test
   public void update_custom_rule() throws Exception {
     // Template rule
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/rule/ws/ShowActionMediumTest/show_deprecated_rule_rem_function_fields.json b/server/sonar-server/src/test/resources/org/sonar/server/rule/ws/ShowActionMediumTest/show_deprecated_rule_rem_function_fields.json
new file mode 100644 (file)
index 0000000..b017ed6
--- /dev/null
@@ -0,0 +1,27 @@
+{
+  "rule": {
+    "internalKey": "InternalKeyS001",
+    "isTemplate": false,
+    "key": "java:S001",
+    "lang": "xoo",
+    "name": "Rule S001",
+    "repo": "java",
+    "severity": "MINOR",
+    "status": "BETA",
+    "remFnType": "LINEAR_OFFSET",
+    "debtRemFnType": "LINEAR_OFFSET",
+    "debtRemFnCoeff": "5d",
+    "remFnGapMultiplier": "5d",
+    "debtRemFnOffset": "10h",
+    "remFnBaseEffort": "10h",
+    "defaultDebtRemFnType": "LINEAR_OFFSET",
+    "defaultRemFnType": "LINEAR_OFFSET",
+    "defaultDebtRemFnCoeff": "6d",
+    "defaultRemFnGapMultiplier": "6d",
+    "defaultDebtRemFnOffset": "11h",
+    "defaultRemFnBaseEffort": "11h",
+    "debtOverloaded": true,
+    "effortToFixDescription": "java.S001.effortToFix",
+    "gapDescription": "java.S001.effortToFix"
+  }
+}
index 97252f4eb97ac09e5737c4a54cfb67b0ae5f57c3..899a1d8ace4c3ce2743cbac5437a5501d566aa7d 100644 (file)
@@ -7,11 +7,11 @@
     "severity": "MINOR",
     "status": "BETA",
     "isTemplate": false,
-    "debtRemFnType": "LINEAR_OFFSET",
-    "debtRemFnCoeff": "5d",
-    "debtRemFnOffset": "10h",
-    "defaultDebtRemFnType": "LINEAR",
-    "defaultDebtRemFnCoeff": "5min",
+    "remFnType": "LINEAR_OFFSET",
+    "remFnGapMultiplier": "5d",
+    "remFnBaseEffort": "10h",
+    "defaultRemFnType": "LINEAR",
+    "defaultRemFnGapMultiplier": "5min",
     "debtOverloaded": true,
     "lang": "xoo"
   }
index 8b205e839e1993310049fdb3f3502620a20892bc..2c57873b3372bf310dd29aa1ea2c2730d456271d 100644 (file)
@@ -1,13 +1,13 @@
 {
   "rule": {
-    "debtRemFnType": "LINEAR_OFFSET",
-    "debtRemFnCoeff": "5d",
-    "debtRemFnOffset": "10h",
-    "defaultDebtRemFnType": "LINEAR_OFFSET",
-    "defaultDebtRemFnCoeff": "5d",
-    "defaultDebtRemFnOffset": "10h",
+    "remFnType": "LINEAR_OFFSET",
+    "remFnGapMultiplier": "5d",
+    "remFnBaseEffort": "10h",
+    "defaultRemFnType": "LINEAR_OFFSET",
+    "defaultRemFnGapMultiplier": "5d",
+    "defaultRemFnBaseEffort": "10h",
     "debtOverloaded": false,
-    "effortToFixDescription": "java.S001.effortToFix",
+    "gapDescription": "java.S001.effortToFix",
     "htmlDesc": "Rule S001 <b>description</b>",
     "internalKey": "InternalKeyS001",
     "isTemplate": false,
index 10f059fe9ac8526ce083141134015a8fe5fc8081..42ef8d0ecd2a5e4e21823d7dd99f7e7b00d775cf 100644 (file)
@@ -7,9 +7,9 @@
     "severity": "MINOR",
     "status": "BETA",
     "isTemplate": false,
-    "debtRemFnType": "LINEAR_OFFSET",
-    "debtRemFnCoeff": "5d",
-    "debtRemFnOffset": "10h",
+    "remFnType": "LINEAR_OFFSET",
+    "remFnGapMultiplier": "5d",
+    "remFnBaseEffort": "10h",
     "debtOverloaded": true,
     "lang": "xoo"
   }
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/deprecated_remediation_function.json b/server/sonar-server/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/deprecated_remediation_function.json
new file mode 100644 (file)
index 0000000..e5dcab5
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "rule": {
+    "key": "xoo:x1",
+    "defaultDebtRemFnType": "LINEAR_OFFSET",
+    "defaultDebtRemFnCoeff": "10d",
+    "defaultDebtRemFnOffset": "5min",
+    "effortToFixDescription": "xoo.x1.effortToFix",
+    "debtRemFnType": "LINEAR_OFFSET",
+    "debtRemFnCoeff": "11d",
+    "debtRemFnOffset": "6min",
+    "defaultRemFnType": "LINEAR_OFFSET",
+    "defaultRemFnGapMultiplier": "10d",
+    "defaultRemFnBaseEffort": "5min",
+    "remFnType": "LINEAR_OFFSET",
+    "remFnGapMultiplier": "11d",
+    "remFnBaseEffort": "6min",
+    "gapDescription": "xoo.x1.effortToFix",
+  }
+}
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/update_rule_remediation_function.json b/server/sonar-server/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/update_rule_remediation_function.json
new file mode 100644 (file)
index 0000000..4fbd264
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "rule": {
+    "key": "xoo:x1",
+    "defaultRemFnType": "LINEAR",
+    "defaultRemFnGapMultiplier": "10d",
+    "remFnType": "LINEAR_OFFSET",
+    "remFnGapMultiplier": "15d",
+    "remFnBaseEffort": "5min",
+    "gapDescription": "xoo.x1.effortToFix"
+  }
+}
index ce049c220bcd04a30f4570779a77b0723d530840..46fc628ab16e1fc05152cafc1db888fb648ef407 100644 (file)
@@ -86,7 +86,7 @@ message Rule {
   optional string lang = 19;
   optional string langName = 20;
   optional Params params = 21;
-  // debt fields, unsupported since 5.5
+  // characteristic fields, unsupported since 5.5
   optional string unusedDefaultDebtChar = 23;
   optional string unusedDefaultDebtSubChar = 24;
   optional string unusedDebtChar = 25;
@@ -94,14 +94,30 @@ message Rule {
   optional string unusedDebtCharName = 27;
   optional string unusedDebtSubCharName = 28;
 
+  // Deprecated since 5.5, replaced by defaultRemFnType
   optional string defaultDebtRemFnType = 29;
+  // Deprecated since 5.5, replaced by defaultRemFnGapMultiplier
   optional string defaultDebtRemFnCoeff = 30;
+  // Deprecated since 5.5, replaced by defaultRemFnBaseEffort
   optional string defaultDebtRemFnOffset = 31;
+  // Deprecated since 5.5, replaced by gapDescription
   optional string effortToFixDescription = 32;
   optional bool debtOverloaded = 33;
+  // Deprecated since 5.5, replaced by remFnType
   optional string debtRemFnType = 34;
+  // Deprecated since 5.5, replaced by remFnGapMultiplier
   optional string debtRemFnCoeff = 35;
+  // Deprecated since 5.5, replaced by remFnBaseEffort
   optional string debtRemFnOffset = 36;
+
+  optional string defaultRemFnType = 38;
+  optional string defaultRemFnGapMultiplier = 39;
+  optional string defaultRemFnBaseEffort = 40;
+  optional string remFnType = 41;
+  optional string remFnGapMultiplier = 42;
+  optional string remFnBaseEffort = 43;
+  optional string gapDescription = 44;
+
   optional sonarqube.ws.commons.RuleType type = 37;
 
   message Params {