Some folders are getting skipped in a project during sonar analysis. This is API project

We have 21 folders under one repo which is imported as project on sonar but all the folders inside that project are not getting analyzed as some are getting skipped by itself. We have tried with and without inclusion & exclusion also but nothing helped. Also we are creating a mono repo for particular folder and scanning it is getting analyzed.
We wanted to know is there any folder limitation in sonar for a project?

:- Sonar screenshot of folders analyzed which is around 14 only
:- Repo screenshot of the folders which is around 21
We need to analyze all 21 folders in that project in sonar dashboard


This is the error in the logs
9946 non excluded files in this Git repository
2024-09-27T09:28:03.9229061Z 09:28:03.899 DEBUG: File ‘D:\a\1\s\SolutionLiveFrontDoorAPI_3.1\SolutionLiveFrontDoorAPI\Auth\IOAuth.cs’ is excluded by the scm ignore settings

Can you please share some solution for this?

Hi,

Which scanner are you using? And can you copy/paste the full text of your analysis log?

 
Thx,
Ann

Hi,

We are using SonarScanner for MSBuild 6.2. Also have attached the full logs of the Analysis here which can be seen from the attachments.

Analysis is getting successful but the problem is few projects getting skipped from the repo and cannot be seen in the sonarqube.

Kindly check and help us to get the resolution.

Run Code Analysis logs for API Project.txt (25.3 MB)

Thanks,
Muhammadh.

Hi Muhammadh,

With the SonarScanner for .NET, only those projects in the solution that are built are analyzed. In fact, the analysis happens during the build, which is why you have to bookend the build with start and end.

This is not the case for most other languages, but with .NET, you’re the lucky recipient of us being able to hook into the build for a deeper understanding of the code and more accurate issue detection.

So it’s likely that’s why you’re missing some directories.

 
HTH,
Ann