PR Vs Branch Analysis

Must-share information (formatted with Markdown):

  • SonarQube Version 9.9.1 LTS
  • Saas - https://mrv-sonarqube.mahindra.com/
  • Issue difference found in PR Analysis and New Code of Branch analysis
  • For a same file , which has only line deletion, the issue count (Code smell) differs in PR and branch analysis. PR analysis didnt report any issue whereas branch analysis identifies issues in New Code segment.

New Code baseline set as 1day and the PR is raised within that timelimit

PR :

Branch :

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi @Megala_Natarajan ,

the PR analysis will only analyze changed lines, whereas the branch analysis analyses the whole file.

In this case the issues do not occur on any changed line, they are just a consequence of changes on other lines in that file. Because of this the PR analysis won’t find them.

For the branch analysis, analyzing the whole file, these issues are new, as they occured in the defined new code period.

I hope this helps, I was confused by this behaviour as well when it occured to me the first time.

Regards,
Carsten

1 Like

Thanks for the response. It makes things very clear.