I have used SonarQube Community Edition, and I work on projects with multiple future branches. After the scan, it shows issues that are related to other branches, and in the history, it displays the history of all branches.
the stage with gitlab.
sonarqube-check:
image: maven:3.8.3-openjdk-17
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
stage: sonarqube-check
except:
refs:
- develop
- master
tags:
- dna
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- mvn verify sonar:sonar -Dsonar.qualitygate.wait=true -Dsonar.projectKey=conversational-talent-intelligence-platform_digital-platform_data-ms_AY3kz9DJ2Fa-uo6M99Vc