Analysis metrics are mostly missing

I am running an analysis on my development workstation and the metrics are not working. I am using SonarScanner for .Net v5.3.1.36242-net5.0 which includes SonarScanner v4.6.2.2472. I am working with a remote SonarQube Community server v8.7.1.42226. My solution has C# and C++ projects. Only 10 of the 70 projects have any metrics. This is the contents of my sonar-project.properties file:

sonar.projectKey=URT2-Vs-Main-SchoolHouse
sonar.organization=ABC Company
sonar.projectName=URT2 Vs Main SchoolHouse
sonar.login=ourkey
sonar.scm.provider=git
sonar.projectVersion=1.0
sonar.exclusions=**/*.java,**/*.js,**/*.properties,**/*.css,**/*.xml,**/*.vsxml,**/*.json, VsCmf2CodeGenerator/Templates/*
sonar.cxx.defines=WIN32
sonar.cxx.includeDirectories=C:/Repositories/Vs.Main.Schoolhouse/Source/Vs.Cmf2.Cpp/Vs.Cmf2.Cpp.Private/include/Cmf2/Private,C:/Repositories/Vs.Main.Schoolhouse/Source/Vs.Cmf2.Cpp/Vs.Cmf2.Cpp.Private/include,C:/Repositories/Vs.Main.Schoolhouse/Distros/DoD/Source/CodeGen/CMF/Cpp/Vs.Cmf2.Cpp.Dod/include,C:/Repositories/Vs.Main.Schoolhouse/Distros/DoD/Source/CodeGen/CMF/Cpp/Vs.Cmf2.Cpp.Dod/include/Cmf2/Dod,C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.FreeType.2.9.1-vs5/build/native/include,C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/include,C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um,C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/ucrt,C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared,C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.GDAL.2.4.1-vs18/build/native/include, C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.IntelPerformancePrimitives.7.0.4.196-vs6/build/native/include,C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.Tungsten.4.0.0-vs4/build/native/include/common,C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.Tungsten.4.0.0-vs4/build/native/include/windows,C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.Tungsten.4.0.0-vs4/build/native/include/windowsapi,C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.Tungsten.4.0.0-vs4/build/native/include/mainconcept,C:/Repositories/Vs.Main.Schoolhouse/Source/packages/Vs.ThirdParty.FFmpeg.4.3.1-vs13/build/native/include,C:/Repositories/Vs.Main.Schoolhouse/Source/Vs.Cmf2.Cpp/Vs.Cmf2.Cpp.Public/include

The only thing in sonar-scanner.properties is the URL of our server. I ran the analysis with command sonar-scanner -X -D sonar.verbose=true >SonarQubeLogVs.Main.txt.

Getting the metrics fixed is the first priority. The second is resolving the issue stated on line 28688 of the log file since I am using the latest build.

Thanks for your help.
SonarQubeLogVs.Main.zip (610.7 KB)

Hi,

Welcome to the community!

The Cxx plugin isn’t supported in this community. You’ll need to file an issue on their GitHub project.

 
:woman_shrugging:
Ann

I’d settle for getting metrics on the C# projects. There are a lot more of those. Any idea why those aren’t working either?

Hi,

If you’d like to uninstall Cxx, so we know it’s not interfering in anything, and give details of your SonarScanner for .NET analysis (including analysis logs) then that can be explored.

 
Ann

I’m not an admin on the server I was using, so I installed v9.0 on my computer last week. It only has the default plugins. I’m not sure what details you want for the analysis. The properties file is the same as above with a new URL line. I’ve attached a copy of the messages that scroll during the analysis.

Thanks,
Charles

SonarQubeLogVs.Main 2021-10-12.zip (508.0 KB)

Hi Charles,

Did you read these logs? I see hundreds of instances of

[filename] is excluded by the scm ignore settings.

 
Ann

I did. Did you notice that values in the sonar.exclusions property? Those are from projects I don’t care to analyze e.g. generated code, third party code, Java class files.

I have 64 projects I’m trying to analyze. The only files that appear to be processed at all are Python and XSDs. I’ve attached a couple of screenshots showing the problem in a simple CS project. That file has 1147 lines in it and is listed in the log file as “indexed with language ‘cs’” on line 6515.

It looks like you are invoking the Java SonarScanner directly. To analyse C#, you need to invoke the SonarScanner for .NET (see the link @ganncamp provided above for more information).