Introduction

Branch analysis allows you to trigger an analysis on a push to any long-living branch or to short-lived branches without involving pull requests.

This capability can be useful in the following situations:

  • When your project has branches other than the main branch that you want to analyze. One use case is having branches for older versions of your software that you still periodically update with critical fixes. Another is having separate branches for development and production in your project.

  • When you use branches (for example, "feature" branches) to introduce changes to your main branch but do not use them with a pull request mechanism in a supported CI.

You can limit the branch analysis to relevant branches only.

Clean as You Code

The quality gate of your project applies to your branch (you cannot define a quality gate at the branch level). It lets you know if your branch is ready to be merged.

New code can be defined at the branch level.

Incremental branch analysis

Some analyzers use the analysis cache mechanism to shorten the branch analysis. This way, they analyze only the code sections that are affected by the changes in the branch compared to the previous analysis.

Issue synchronization

SonarQube Server synchronizes issue attributes (status, assignee, change log, comments) between branches when a branch is created or (under particular conditions) merged. For more information, see the corresponding section on the Issue management solution page.

Last updated

Was this helpful?