aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-02-02 17:10:49 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-02-08 13:41:00 +0100
commit3345726bf92555b89198b45fe09de0c9a656a442 (patch)
tree0c462f8cd1cb508e8482c3948e4a8dbc1ff39606 /server
parent1496d3fa86bb64f34ba6d53c669a28b7b0280aba (diff)
downloadsonarqube-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.java7
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;