Hi,
In SonarCloud Pull Request analysis, the report generates issues for lines that are not part of the new code and are unrelated to the actual changes.
The analysis correctly scopes itself to only the files modified in the pull request. However, for those files, SonarCloud produces issues for all lines in the file, not just the lines changed in the PR.
What I want to achieve is:
-
Generating a report that includes only new/changed code, or
-
Getting separate results for New Code and Overall Code, similar to how branch analysis works in SonarCloud.
Is it possible to configure SonarCloud PR analysis to behave this way, or to restrict issue creation strictly to new code only?
Thanks in advance for your help.
Details:
-
pipeline runs via pull request from azure devops to run sonar analyse
-
Provider is set to “Azure Devops Services” and from sonarcloud console. General Settings → Pull Requests → Provider
-
Personal Access Token set from sonar cloud console. General Settings → Pull Requests → Provider
-
pipeline includes the tasks below
- SonarCloudPrepare@3
- Gradle@4
inputs:
gradleWrapperFile: ‘gradlew’
tasks: ‘clean assembleProdDebug’
publishJUnitResults: true
javaHomeOption: ‘JDKVersion’
sonarQubeRunAnalysis: true
sqGradlePluginVersionChoice: ‘specify’
sonarQubeGradlePluginVersion: ‘5.1.0.4882’
spotBugsAnalysis: false - SonarCloudPublish@3