Difference between Branch Analysis and PR Analysis

What is the main difference between Branch Analysis and PR Analysis. The only difference I could see is the quality gate.

We are using

  • GitLab EE 11.10.1-ee
  • Gitlab Plugin for Sonarqube
  • Sonarqube Developer Edition Version 7.7 (build 23042)

Both analysis are done during Pull Request, on what basis should I choose one of these?


The main difference between Short-lived Branch analysis and PR analysis is the ability to annotate the PR with the results. But since you’re using GitLab, for which integration is not available, they probably are functionally the same for you. That being the case, I’d go for SLB analysis, which asks for slightly less configuration.


In branch analysis, stats for that branch against a target is stored with branch name in sonar. With PR analysis, it’s stored with the PR number. There can be multiple PRs each with same source branch and different target in which case PR analysis captures accurate information and branch analysis would get overwritten with each scan for each PR