aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-es
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2023-04-21 15:49:12 -0500
committersonartech <sonartech@sonarsource.com>2023-04-24 20:04:24 +0000
commit36f7a5dfc1cb7e14d8632102aec3321fc6232259 (patch)
treed37f3b2b72fa873b79e0104954499decd7c0b716 /server/sonar-webserver-es
parentccf7c5c1cd340592c3c1af5577caf0a9db92fb7b (diff)
downloadsonarqube-36f7a5dfc1cb7e14d8632102aec3321fc6232259.tar.gz
sonarqube-36f7a5dfc1cb7e14d8632102aec3321fc6232259.zip
SONAR-19050 Upgrade sonar-plugin-api to v9.16.0.549
Diffstat (limited to 'server/sonar-webserver-es')
-rw-r--r--server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueIndex.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index b9c055fa309..59e714acd23 100644
--- a/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -64,9 +64,9 @@ import org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.FieldSortBuilder;
import org.joda.time.Duration;
+import org.sonar.api.code.CodeCharacteristic;
import org.sonar.api.issue.Issue;
import org.sonar.api.rule.Severity;
-import org.sonar.api.rules.RuleCharacteristic;
import org.sonar.api.rules.RuleType;
import org.sonar.api.server.rule.RulesDefinition;
import org.sonar.api.server.rule.RulesDefinition.OwaspTop10Version;
@@ -118,6 +118,7 @@ import static org.sonar.server.es.searchrequest.TopAggregationHelper.NO_OTHER_SU
import static org.sonar.server.issue.index.IssueIndex.Facet.ASSIGNED_TO_ME;
import static org.sonar.server.issue.index.IssueIndex.Facet.ASSIGNEES;
import static org.sonar.server.issue.index.IssueIndex.Facet.AUTHOR;
+import static org.sonar.server.issue.index.IssueIndex.Facet.CHARACTERISTICS;
import static org.sonar.server.issue.index.IssueIndex.Facet.CREATED_AT;
import static org.sonar.server.issue.index.IssueIndex.Facet.CWE;
import static org.sonar.server.issue.index.IssueIndex.Facet.DIRECTORIES;
@@ -138,7 +139,6 @@ import static org.sonar.server.issue.index.IssueIndex.Facet.SONARSOURCE_SECURITY
import static org.sonar.server.issue.index.IssueIndex.Facet.STATUSES;
import static org.sonar.server.issue.index.IssueIndex.Facet.TAGS;
import static org.sonar.server.issue.index.IssueIndex.Facet.TYPES;
-import static org.sonar.server.issue.index.IssueIndex.Facet.CHARACTERISTICS;
import static org.sonar.server.issue.index.IssueIndexDefinition.FIELD_ISSUE_ASSIGNEE_UUID;
import static org.sonar.server.issue.index.IssueIndexDefinition.FIELD_ISSUE_AUTHOR_LOGIN;
import static org.sonar.server.issue.index.IssueIndexDefinition.FIELD_ISSUE_BRANCH_UUID;
@@ -245,7 +245,7 @@ public class IssueIndex {
// Resolutions facet returns one more element than the number of resolutions to take into account unresolved issues
RESOLUTIONS(PARAM_RESOLUTIONS, FIELD_ISSUE_RESOLUTION, STICKY, Issue.RESOLUTIONS.size() + 1),
TYPES(PARAM_TYPES, FIELD_ISSUE_TYPE, STICKY, RuleType.values().length),
- CHARACTERISTICS(PARAM_CHARACTERISTICS, FIELD_ISSUE_CHARACTERISTIC, STICKY, RuleCharacteristic.values().length),
+ CHARACTERISTICS(PARAM_CHARACTERISTICS, FIELD_ISSUE_CHARACTERISTIC, STICKY, CodeCharacteristic.values().length),
SCOPES(PARAM_SCOPES, FIELD_ISSUE_SCOPE, STICKY, MAX_FACET_SIZE),
LANGUAGES(PARAM_LANGUAGES, FIELD_ISSUE_LANGUAGE, STICKY, MAX_FACET_SIZE),
RULES(PARAM_RULES, FIELD_ISSUE_RULE_UUID, STICKY, MAX_FACET_SIZE),
@@ -492,7 +492,6 @@ public class IssueIndex {
}
}
-
private static Set<String> calculateRequirementsForOwaspAsvs40Params(IssueQuery query) {
int level = query.getOwaspAsvsLevel().orElse(3);
List<String> levelRequirements = OWASP_ASVS_40_REQUIREMENTS_BY_LEVEL.get(level);
@@ -521,10 +520,8 @@ public class IssueIndex {
/**
* <p>Builds the Elasticsearch boolean query to filter the PCI DSS categories.</p>
- *
* <p>The PCI DSS security report handles all the subcategories as one level. This means that subcategory 1.1 doesn't include the issues from 1.1.1.
* Taking this into account, the search filter follows the same logic and uses prefix matching for top-level categories and exact matching for subcategories</p>
- *
* <p>Example</p>
* <p>List of PCI DSS categories in issues: {1.5.8, 1.5.9, 1.6.7}
* <ul>
@@ -985,7 +982,7 @@ public class IssueIndex {
t ->
// add sub-aggregation to return issue count for current user
aggregationHelper.getSubAggregationHelper()
- .buildSelectedItemsAggregation(ASSIGNED_TO_ME.getName(), ASSIGNED_TO_ME.getTopAggregationDef(), new String[]{uuid})
+ .buildSelectedItemsAggregation(ASSIGNED_TO_ME.getName(), ASSIGNED_TO_ME.getTopAggregationDef(), new String[] {uuid})
.ifPresent(t::subAggregation));
esRequest.aggregation(aggregation);
}