Why feature branch scanning shows 0 metrics for all condition?

Hello Team,

Background:
When I first time setup SonarCloud + Bitbucket + Aws codepipeline, my master branch was successfully scanned by SonarCloud and i was seeing almost 400 bugs in the master branch.
Upon further analysis, i came to know that we can also analyze feature branches and therefore we created a branch from master and are scanning the branch for the first time.
Master isn’t scanned yet. The sonarcloud result shows 0 bugs, vulnerabilities and code smells for feature branch
Is there any misconfiguration done by me at SonarCloud ?

Regards,
-Vishal

Here is snapshot for more information that when i analyzed feature branch firs time then noticed 0 code smells.

Regards,
-Vishal

Hi @vtotare ,

When analyzing feature branches, SonarCloud only reports issues on New Code, ie. code that is not on the main branch.
Even if the main branch has not been analyzed, it detects the code is the same, and does not report the issues. It’s also why the Code page is completely empty.
It is the application of SonarCloud Clean as you code principle.

As far as I can tell, you didn’t missed any configuration, and if you add a commit on that branch that contains an issue, it will show up on the branch analysis results, and on the Code page.

HTH,
Claire

Got it @Claire_Villard
Thanks for your response !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.