For java, if turn on “sonar.java.skipUnchanged=true” when scanning, the scanner will only scan the changed file this time to speed up the analyze, however, this will cause SonarQube to auto close all the issues for the unchanged files.
Below code in IntegrateIssuesVisitor will do is:
private static List<DefaultIssue> closeIssues(Stream<DefaultIssue> issues) {
return issues.map(issue ->
// TODO should replace flag "beingClosed" by express call to transition "automaticClose"
issue.setBeingClosed(true)
// TODO manual issues -> was updater.setResolution(newIssue, Issue.RESOLUTION_REMOVED, changeContext);. Is it a problem ?
).collect(Collectors.toList());
}
Please do not do this, as we want to speed up the analyze. I change the code to " issue.setBeingClosed(false)" temperately. Sonar scanner should detect the deleted source files, and only auto close issues for them.