
In the following example, analysis would be limited to branches named main or release/*. For example, you wouldn't want to run analysis on feature branches that won't need analysis until they have pull requests. You need to add a condition to your pipeline script to ensure only relevant branches are analyzed. Manually setting branch parameters overrides automatic detection. Jenkins (with the Branch Source plugin configured).Scanners can automatically detect branch parameters when running on the following CI services:
#Sonar multidock code#
#Sonar multidock how to#
See the Defining New Code documentation for more information, and look at the Clean as you code strategy to learn how to implement this best practice. This is especially helpful if you are likely to develop and release multiple versions from the branch. You can set a New Code definition for each branch. The New Code Period is the only exception to this as it can be set on a branch-by-branch basis. Settings and Quality Profiles on Branchesīranch settings and Quality Profiles are the same as those set for the main branch, and by design, it's not possible to configure other values. Starting in Developer Edition, your main branch can be renamed from the project settings at Project Settings > Branches and Pull Requests. If you add your project manually, your main branch defaults to the name "master". See DevOps Platform Integrations in the documentation navigation for more information on adding your project from an DevOps Platform. SonarQube labels this branch as Main Branch, and, with Community Edition, this is the only branch you can analyze.Īdding projects by DevOps Platform copies the main branch name in SonarQube from the main branch name in your repository.


This branch is usually known within a development team as "master" or "head" and is analyzed when no specific branch parameters are provided. This is the default branch and typically corresponds to what's being developed for your next release. With Branch Analysis, you can ensure that you're maintaining consistent code quality all the way down to the branch level of your projects. Branch analysis is available starting in Developer Edition.
