Skip to content

Commit

Permalink
Remove resolved SECURITY_HOTSPOTS from BitBucket annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
vmob-martin-theiss authored and mc1arke committed Jan 23, 2021
1 parent 68aff70 commit 2abee09
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.github.mc1arke.sonarqube.plugin.ce.pullrequest.bitbucket.client.model.DataValue;
import com.github.mc1arke.sonarqube.plugin.ce.pullrequest.bitbucket.client.model.ReportData;
import com.google.common.annotations.VisibleForTesting;

import org.sonar.api.ce.posttask.QualityGate;
import org.sonar.api.issue.Issue;
import org.sonar.api.measures.CoreMetrics;
Expand Down Expand Up @@ -137,6 +138,8 @@ private void updateAnnotations(BitbucketClient client, String project, String re
.filter(i -> i.getComponent().getReportAttributes().getScmPath().isPresent())
.filter(i -> i.getComponent().getType() == Component.Type.FILE)
.filter(i -> OPEN_ISSUE_STATUSES.contains(i.getIssue().status()))
.filter(i -> !(i.getIssue().type() == RuleType.SECURITY_HOTSPOT && Issue.SECURITY_HOTSPOT_RESOLUTIONS
.contains(i.getIssue().resolution())))
.sorted(Comparator.comparing(a -> Severity.ALL.indexOf(a.getIssue().severity())))
.map(componentIssue -> {
String path = componentIssue.getComponent().getReportAttributes().getScmPath().get();
Expand Down

0 comments on commit 2abee09

Please sign in to comment.