diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-02-02 17:10:49 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-02-08 13:41:00 +0100 |
commit | 3345726bf92555b89198b45fe09de0c9a656a442 (patch) | |
tree | 0c462f8cd1cb508e8482c3948e4a8dbc1ff39606 /server | |
parent | 1496d3fa86bb64f34ba6d53c669a28b7b0280aba (diff) | |
download | sonarqube-3345726bf92555b89198b45fe09de0c9a656a442.tar.gz sonarqube-3345726bf92555b89198b45fe09de0c9a656a442.zip |
SONAR-10307 fix some new rule causing an insert AND an update
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java b/server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java index 877b1bebc26..fffb9360be4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java +++ b/server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java @@ -267,6 +267,13 @@ public class RegisterRules implements Startable { ruleDto.setDescription(ruleDef.markdownDescription()); ruleDto.setDescriptionFormat(Format.MARKDOWN); } + DebtRemediationFunction debtRemediationFunction = ruleDef.debtRemediationFunction(); + if (debtRemediationFunction != null) { + ruleDto.setDefRemediationFunction(debtRemediationFunction.type().name()); + ruleDto.setDefRemediationGapMultiplier(debtRemediationFunction.gapMultiplier()); + ruleDto.setDefRemediationBaseEffort(debtRemediationFunction.baseEffort()); + ruleDto.setGapDescription(ruleDef.gapDescription()); + } dbClient.ruleDao().insert(session, ruleDto); return ruleDto; |