aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/src/main/java/org/sonar/db
diff options
context:
space:
mode:
authorDejan Milisavljevic <dejan.milisavljevic@sonarsource.com>2024-12-06 16:27:58 +0100
committersonartech <sonartech@sonarsource.com>2024-12-06 20:03:27 +0000
commitd39f81fbe2eef34cf078a1f7459bff6f14360af8 (patch)
treef5a41065aa3ed50f7b3768104dacc9916e1b3358 /server/sonar-db-dao/src/main/java/org/sonar/db
parentd81c86acf04859937a0da345c35b2536ad586271 (diff)
downloadsonarqube-d39f81fbe2eef34cf078a1f7459bff6f14360af8.tar.gz
sonarqube-d39f81fbe2eef34cf078a1f7459bff6f14360af8.zip
SONAR-23688 Index active rules impacts
Diffstat (limited to 'server/sonar-db-dao/src/main/java/org/sonar/db')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/IndexedActiveRuleDto.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/IndexedActiveRuleDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/IndexedActiveRuleDto.java
index 585cc332186..58a07f70a44 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/IndexedActiveRuleDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/IndexedActiveRuleDto.java
@@ -19,15 +19,25 @@
*/
package org.sonar.db.qualityprofile;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import java.lang.reflect.Type;
+import java.util.Map;
import javax.annotation.CheckForNull;
+import org.sonar.api.issue.impact.Severity;
+import org.sonar.api.issue.impact.SoftwareQuality;
public class IndexedActiveRuleDto {
+ private static final Gson GSON = new Gson();
+ private static final TypeToken<Map<SoftwareQuality, Severity>> TYPE = new TypeToken<>(){};
+
private String uuid;
private String ruleUuid;
private int severity;
private String inheritance;
private String repository;
private String key;
+ private String impactsString;
private String ruleProfileUuid;
private Boolean prioritizedRule;
@@ -60,6 +70,10 @@ public class IndexedActiveRuleDto {
return key;
}
+ public Map<SoftwareQuality, Severity> getImpacts() {
+ return impactsString != null ? GSON.fromJson(impactsString, TYPE) : Map.of();
+ }
+
public String getRuleProfileUuid() {
return ruleProfileUuid;
}