Sonarqube baseline for issues

Hi All,

we are using Sonarqube Community Edition 7.9.1 and SonarQube Scanner

We do baseline of issues occurring in feature branches and in next analysis, issues doesn’t occur. Do we need to baseline the develop branch again for the same issues not to occur while analyzing the develop branch. Will the baselined issues in develop branch doesn’t occur in feature branches if the feature branch is created from develop branch.

can you please suggest which all branches needs to be baselined so that sonar issues doesn’t occur in next analysis.

Hi @suzp,

Welcome to SonarSource community! :wave:

SonarQube works by scanning your code for issues, but the next scan analysis of your code does not stop the issues from appearing. The issues will always be present until they are resolved (by fixing the code or modifying the SonarQube issue status).

I believe you are mixing git flow workflow concerns with how SonarQube works. SonarQube does not cache/hide previous issues with subsequent scans.

If you want to use the baseline concept, you need to stick the main branch (develop branch, in your case), fix the issues there first, then you can use feature branches to compare to your target branch (develop).

In summary, SonarQube issues will always appear until they addressed via the Issues UI or manually fixing the code itself.

EDIT: I forgot to mention about the New Code Period. See Defining New Code in our documentation. You can use this method of designating the new code period to separate issues from previous analysis from new analysis. The default is “previous_version”. Can you provide some screenshots of what you expect? Are you running into any problems right now?