How can I Scan the entire Branch on SonarCloud?

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps) - Azure DevOps
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI) - Azure DevOps Pipeline
  • Languages of the repository - C#

Hi there!

I am using SonarCloud extension with My Azure DevOps Organization. I am integrating Prepare Analysis on SonarCloud, and Run Code Analysis in our .NET Build pipeline.

Problem that I am having is, when we run the Build Pipeline, SonarScanner on the Agent only scans for project files specified on the Build step of the Pipeline. Eg. only A.csproj, B.csproj etc. But It is missing many folders while running the scan from the build Branch.

Build Step is in-between - Prepare analysis on SonarCloud AND Run Code Analysis. I have specified “sonar.inclusions=*” on the Prepare step, but it is still running scans only on the project files specified on the Build step. Can you please help me get entire Build Branch with all folder included in the Analysis for SonarCloud? Is it possible to include entire Build Branch into this scan instead of just projects specified in the Build command for this? Also, I am not using Pull Request Analysis.
Please let me know!

Thanks,
Sagar

  • Steps to reproduce

Hi Sagar,

Welcome to the community!

I guess we’re talking about .NET here, right?

In that case, it’s expected behavior that only what’s built is what’s analyzed. To analyze the entire branch, you’ll need to build the entire branch.

 
Ann