SonarCloud/Bitbucket/Azure DevOps Pipelines posting 0 LOC gets reported in web portal

ALM: Bitbucket Cloud
CI: Azure DevOps Pipelines, Self Hosted Agent, Built in Container
Scanner: Azure DevOps Extension
Language: C#

I am having an issue with the SonarCloud scan happening in Azure, originally it had the same issue as others posted where the SCM exclusions were causing issues, but now I no longer see that but it still not posting anything to the cloud after the scan. The code tab does not have anything in it, and lines of code says 0, and new lines says 0. In the log I do see files getting scanned.

I am attaching the analysis step in case someone can catch something I didn’t. Using the manual dotnet scanner works fine and I don’t have any issues but I would like to utilize this to get the PR decoration.

I am also attaching the docker image that this gets executed in. (33.1 KB)
Dockerfile.txt (2.8 KB)

Hey there.

Based on the logs you’re analyzing a short-lived branch (meaning that only the changes in the branch are expected to appear in the dashboard in SonarCloud).

What have you changed in this branch (feature/ARC-77-add-cicd-to-driver-services-final), and are those changed files indexed by SonarCloud?

While I was not aware that short lived branches didn’t show the full code, I have a sample class I added that is not showing up.

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+namespace Wheels3.Ent.CustomerService.DriverServices.Services.DTC
+    public class testclass
+    {
+        public testclass() { }
+    }

I don’t see this file getting picked up at all. It does not get listed anywhere in that the tool generates. Also if I fix a issue, it does not get detected in the branch scan. Not sure if this matters but this repo is also setup as a monorepo in SonarCloud

So I figured out my issue. Interesting enough when running the scan locally if there are changes in the working folder they are ignored. The moment I committed the changes they got picked up.