use of org.sonar.server.issue.index.IssueIndexDefinition.FIELD_ISSUE_OWASP_TOP_10 in project sonarqube by SonarSource.
the class IssueIndex method getOwaspTop10Report.
public List<SecurityStandardCategoryStatistics> getOwaspTop10Report(String projectUuid, boolean isViewOrApp, boolean includeCwe) {
SearchSourceBuilder request = prepareNonClosedVulnerabilitiesAndHotspotSearch(projectUuid, isViewOrApp);
IntStream.rangeClosed(1, 10).mapToObj(i -> "a" + i).forEach(owaspCategory -> request.aggregation(newSecurityReportSubAggregations(AggregationBuilders.filter(owaspCategory, boolQuery().filter(termQuery(FIELD_ISSUE_OWASP_TOP_10, owaspCategory))), includeCwe, null)));
return processSecurityReportSearchResults(request, includeCwe);
}
Aggregations