This Branch of this project is empty for Cs file in Sonarqube Dashboard

Hi ,
I was trying to analyze cs file
I did all 3 steps Begin , Build and End for Cs files
Also I have added false in CSharpMethods.csproj file
I got Code smells in overall Code but unable to view details in dashboard
Sonarqube version : sonarqube-8.4.2.36762
Sonar Scanner Ms Build version : sonar-scanner-msbuild-5.2.1.31210-net46


kindly help to resolve .

Hi @Keerthana ,

Welcome to SonarSource Community! :sonarsource:

Please upgrade to SonarQube 8.9 LTS or SonarQube 9.0 and upgrade your scanner for .NET to 5.3.1.

Then add /d:“sonar.verbose=true” to your BEGIN step and then share all of your logs here.

Regards,
Joe

Hi Joe ,
Thanks for your Reply ,
As you said I Upgraded Sonarqube as below
SonarQube version : sonarqube-8.9.2.46101
MSBuild scanner : sonar-scanner-msbuild-5.3.1.36242-net5.0
Still I face the same empty dashboard with message saying “The Main Branch of this project is empty”
Find below log file of 3 Steps(Begin , Build , End)
log file.txt (512.3 KB)

Regards,
Keerthana

Hi @Joe
I shared a log file above .
Do I need to check any other prerequisite ?

Regards,
Keerthana.

Hi @Keerthana ,

Sorry for the delay. I see 2 modules in your project, TestCS and CSharpMethods, in the Base dir as shown below:

13:05:11.955 INFO: Base dir: C:\Users\z027747\OneDrive - Alliance\Desktop\Sonar Latest\FOTA\Unit Test\Unit Tests\CSharpMethods
...
13:05:11.955 DEBUG: Creating module hierarchy
13:05:11.955 DEBUG:   Init module 'TestCS'
13:05:11.955 DEBUG:     Base dir: C:\Users\z027747\OneDrive - Alliance\Desktop\Sonar Latest\FOTA\Unit Test\Unit Tests\CSharpMethods
13:05:11.955 DEBUG:     Working dir: C:\Users\z027747\OneDrive - Alliance\Desktop\Sonar Latest\FOTA\Unit Test\Unit Tests\CSharpMethods\.sonarqube\out\.sonar
13:05:11.955 DEBUG:     Module global encoding: windows-1252, default locale: en_IN
13:05:11.955 DEBUG:   Init module 'CSharpMethods'
13:05:11.955 DEBUG:     Base dir: C:\Users\z027747\OneDrive - Alliance\Desktop\Sonar Latest\FOTA\Unit Test\Unit Tests\CSharpMethods
13:05:11.955 DEBUG:     Working dir: C:\Users\z027747\OneDrive - Alliance\Desktop\Sonar Latest\FOTA\Unit Test\Unit Tests\CSharpMethods\.sonarqube\out\.sonar\mod0
13:05:11.955 DEBUG:     Module global encoding: UTF-8, default locale: en_IN

Later, I see 165 total files in this Git repo:

13:05:15.833 DEBUG: 165 non excluded files in this Git repository

Then I see 5 files in your source path for the CSharpMethods module, 3 of which are “cs” files and the 2 others ignored:

13:05:15.833 INFO: Indexing files of module 'CSharpMethods'
13:05:15.833 INFO:   Base dir: C:\Users\z027747\OneDrive - Alliance\Desktop\Sonar Latest\FOTA\Unit Test\Unit Tests\CSharpMethods
13:05:15.843 DEBUG:   Source paths: CompiledMethods/AML-packages/pckFOTA/Import/Method/OGE001_M_GlobalTolcal.cs, CompiledMethods/AML-packages/pckFOTA/Import/Method/OGE001_M_LoadExcelObjects.cs, Properties/AssemblyInfo.cs, app.config, packages.config
13:05:15.863 DEBUG: 'CompiledMethods\AML-packages\pckFOTA\Import\Method\OGE001_M_GlobalTolcal.cs' indexed with language 'cs'
13:05:15.873 DEBUG: 'CompiledMethods\AML-packages\pckFOTA\Import\Method\OGE001_M_LoadExcelObjects.cs' indexed with language 'cs'
13:05:15.873 DEBUG: 'Properties\AssemblyInfo.cs' indexed with language 'cs'
13:05:15.881 DEBUG: 'app.config' indexed with no language
13:05:15.883 DEBUG: 'packages.config' indexed with no language

Later we see a pertinent warning and that 0/3 source files were analyzed. Which files have actual code in it?

13:05:17.734 WARN: No protobuf reports found. The C# files will not have highlighting and metrics. You can get help on the community forum: https://community.sonarsource.com
...
13:05:18.028 INFO: SCM Publisher 3 source files to be analyzed
13:05:18.038 DEBUG: Blame file Unit Test/Unit Tests/CSharpMethods/CompiledMethods/AML-packages/pckFOTA/Import/Method/OGE001_M_LoadExcelObjects.cs
13:05:18.038 DEBUG: Blame file Unit Test/Unit Tests/CSharpMethods/Properties/AssemblyInfo.cs
13:05:18.038 DEBUG: Blame file Unit Test/Unit Tests/CSharpMethods/CompiledMethods/AML-packages/pckFOTA/Import/Method/OGE001_M_GlobalTolcal.cs
13:05:18.159 DEBUG: Unable to blame file Properties/AssemblyInfo.cs. It is probably a symlink.
13:05:18.161 DEBUG: Unable to blame file CompiledMethods/AML-packages/pckFOTA/Import/Method/OGE001_M_GlobalTolcal.cs. It is probably a symlink.
13:05:18.161 DEBUG: Unable to blame file CompiledMethods/AML-packages/pckFOTA/Import/Method/OGE001_M_LoadExcelObjects.cs. It is probably a symlink.
13:05:18.161 INFO: SCM Publisher 0/3 source files have been analyzed (done) | time=133ms

There are many possible problems that can cause this issue: outdated scanner, outdated SonarQube instance, improper prerequisite.

Can you please try using the latest version of the SonarScanner for .NET 5.3.1 with the latest version of SonarQube 9.1?

Also, can you share this project with me so that I can attempt to reproduce your problem?