Azure Devops DotNet Core Analsysis completes without error but results are all empty

I have just setup SonarCloud to analyze a dotnet core blazor solution via Azure Pipelines. The prepare analyze and publish tasks all execute without but the published results show no code, issues, etc. See screenshot. When I go to the code tab there is no code listed.

I should note that this repo is a little unique where the actual .NET code is generated from some other items in the repository via the build and not actually committed. Does sonarqube have some limitation that it will not analyze generated code or is something else going on here?

Hey there.

Indeed, SonarCloud avoids analyzing generated code under some circumstances (specifically our .NET analyzer has certain heuristics it uses to detect generated code.

While only recommended if these heuristics are misbehaving, you can toggle this behavior under project-level Administration > Languages > C# > Analyze generated code).

Thanks for the info. It looks like this was actually caused by these generated files being present in the .gitignore. Is there a way to allow these files be analyzed even though they are in the .gitignore?

@groogiam It begs the question of why you want the files analyzed if they aren’t checked into your repository, but in any case, you can set sonar.scm.exclusions.disabled=true as an analysis parameter. This is documented here.

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