SonarQube C# analysis is not displaying Issues

Hi,

I’m using SonarQube * Community Edition * Version 8.9.10 (build 61524)
.Net Scanner: sonar-scanner-msbuild-5.9.2.58699-net46
.Net Framework 4.8

After Scanning am not getting complete analysis Issues/results. All .cs files are being scanned but SonarQube is considering it with no lines of code and no Issues are reflected in the SonarQube UI.

I check the logs as well nothing there I have attached the logs for reference. any idea what could be the reason behind this behavior?

log.txt (352.8 KB)

Regards,
Sheetal

Hi Sheetal,

What language are the files in this project? I’m seeing several mentions of Delphi in your project, but not .cs…?

 
Ann

Hi Ann,

C# they are there in the end.

X:\mla_src\MLA_src.sln" (ReBuild target) (1) ->
"X:\mla_src\MLA\MLAMain.csproj" (Rebuild target) (2) ->
"X:\mla_src\FetchRawLogs\FetchRawLogs.csproj" (default target) (3:3) ->
"X:\mla_src\MLAInputRouter\Input Router.csproj" (default target) (6:7) ->
(CoreCompile target) ->
  X:\mla_src\MLAInputRouter\AssemblyInfo.cs(12,1): warning S103: Split this 106 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\Event.cs(12,1): warning S103: Split this 106 characters long line (which is greater than 10
0 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(16,1): warning S103: Split this 106 characters long line (which is greater t
han 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(76,1): warning S103: Split this 101 characters long line (which is greater t
han 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(88,1): warning S103: Split this 128 characters long line (which is greater t
han 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(121,1): warning S103: Split this 102 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(202,1): warning S103: Split this 104 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(223,1): warning S103: Split this 113 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(230,1): warning S103: Split this 120 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(236,1): warning S103: Split this 124 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(243,1): warning S103: Split this 117 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(254,1): warning S103: Split this 118 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(263,1): warning S103: Split this 113 characters long line (which is greater
than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\Local.cs(12,1): warning S103: Split this 106 characters long line (which is greater than 10
0 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\MessageCreator.cs(12,1): warning S103: Split this 106 characters long line (which is greate
r than 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\Messages.cs(12,1): warning S103: Split this 106 characters long line (which is greater than
 100 authorized). [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\MessageCreator.cs(62,29): warning S131: Add a 'default' clause to this 'switch' statement.
[X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(178,30): warning S138: This method 'HandleInputMessage' has 51 lines, which
is greater than the 50 lines authorized. Split it into smaller methods. [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\MessageCreator.cs(59,30): warning S3900: Refactor this method to add validation of paramete
r 'rawMsg' before using it. [X:\mla_src\MLAInputRouter\Input Router.csproj]
  X:\mla_src\MLAInputRouter\InputRouter.cs(76,17): warning S3900: Refactor this method to add validation of parameter '
ael' before using it. [X:\mla_src\MLAInputRouter\Input Router.csproj]


"X:\mla_src\MLA_src.sln" (ReBuild target) (1) ->
"X:\mla_src\MLA\MLAMain.csproj" (Rebuild target) (2) ->
"X:\mla_src\FetchRawLogs\FetchRawLogs.csproj" (default target) (3:3) ->
  X:\mla_src\FetchRawLogs\Event.cs(51,110): warning CS1573: Parameter 'LogDate' has no matching param tag in the XML co
mment for 'Event.DelegateFileTransferred' (but other parameters do) [X:\mla_src\FetchRawLogs\FetchRawLogs.csproj]


"X:\mla_src\MLA_src.sln" (ReBuild target) (1) ->
"X:\mla_src\MLA\MLAMain.csproj" (Rebuild target) (2) ->
"X:\mla_src\ProcessRawLog\ProcessRawLog.csproj" (default target) (7:3) ->
  X:\mla_src\ProcessRawLog\Event.cs(45,91): warning CS1573: Parameter 'Date' has no matching param tag in the XML comme
nt for 'Event.DelegateStartConvLogs' (but other parameters do) [X:\mla_src\ProcessRawLog\ProcessRawLog.csproj]
  X:\mla_src\ProcessRawLog\Event.cs(92,87): warning CS1573: Parameter 'Date' has no matching param tag in the XML comme
nt for 'Event.RaiseConvertRawlogs(Utility.CSPttside, DateTime)' (but other parameters do) [X:\mla_src\ProcessRawLog\Pro
cessRawLog.csproj]


"X:\mla_src\MLA_src.sln" (ReBuild target) (1) ->
"X:\mla_src\FetchRawLogEventsTestProject\FetchRawLogEventsTestProject.csproj" (Rebuild target) (11) ->
  X:\mla_src\FetchRawLogEventsTestProject\FetchRawLogEventsTest.cs(245,20): warning CS0168: The variable 'status' is de
clared but never used [X:\mla_src\FetchRawLogEventsTestProject\FetchRawLogEventsTestProject.csproj]

    24 Warning(s)
    0 Error(s)

Time Elapsed 00:00:43.70

Anything specific area your looking for do let me know.

Regards

Hi Sheetal,

Thanks for pointing that out. I had gotten distracted by all the .csproj at the ends of those lines. I suppose the issues are actually being reported on the .cs files at the beginnings of the lines.

Taking another look at your logs, I see this during analysis:

INFO: Indexing files of module 'Link Monitoring'
INFO:   Base dir: X:\mla_src\Link Monitoring
INFO:   Test paths: AssemblyInfo.cs, Event.cs, LinkMonitoring.cs, LinkNodeStates.cs...
INFO: Load project repositories
INFO: Load project repositories (done) | time=122ms
INFO: Indexing files of module 'ProcessRawLogEventsTestProject'
INFO:   Base dir: X:\mla_src\ProcessRawLogEventsTestProject
INFO:   Test paths: ProcessRawLogEventsTest.cs, Properties/AssemblyInfo.cs, package...
INFO: Indexing files of module 'ProcessRawLogTestProject'
INFO:   Base dir: X:\MLA\ProcessRawLogTestProject
INFO:   Test paths: Properties/AssemblyInfo.cs, ProcessRawLogTest.cs, packages.config
INFO: Indexing files of module 'FetchRawLogsTest'
INFO:   Base dir: X:\mla_src\FetchRawLogsTest
INFO:   Test paths: Properties/AssemblyInfo.cs, FetchRawLogsTest.cs, packages.config
INFO: Indexing files of module 'MLAMain'
INFO:   Base dir: X:\mla_src\MLA
INFO:   Test paths: FetchRawLogEvents.cs, LinkMonitoringEvents.cs, MLAMain.cs, MLAA...
INFO: Indexing files of module 'CommonUtilityTest'
INFO:   Base dir: X:\mla_src\CommonUtilityTest
INFO:   Test paths: Properties/AssemblyInfo.cs, CommonUtilityTests.cs, packages.config
INFO: Indexing files of module 'FetchRawLogEventsTestProject'
INFO:   Base dir: X:\mla_src\FetchRawLogEventsTestProject
INFO:   Test paths: Properties/AssemblyInfo.cs, FetchRawLogEventsTest.cs, packages....
INFO: Indexing files of module 'FetchRawLogs'
INFO:   Base dir: X:\mla_src\FetchRawLogs
INFO:   Test paths: Event.cs, FetchRawLogs.cs, InEvents.cs, Local.cs, Properties/As...
INFO: Indexing files of module 'Common'
INFO:   Base dir: X:\mla_src\MLACommon
INFO:   Test paths: AssemblyInfo.cs, IMlaLibrary.cs, InputEventMessages.cs, InvokeE...
INFO: Indexing files of module 'Input Router'
INFO:   Base dir: X:\mla_src\MLAInputRouter
INFO:   Source paths: AssemblyInfo.cs, Event.cs, InputRouter.cs, Local.cs, MessageC...
INFO: Indexing files of module 'ProcessRawLog'
INFO:   Base dir: X:\mla_src\ProcessRawLog
INFO:   Test paths: Event.cs, InEvents.cs, Local.cs, ProcessRawLog.cs, ProcessRawLo...
INFO: Indexing files of module 'CLLE/MLA_Src'
INFO:   Base dir: X:\
INFO: 63 files indexed

I see that most of your code has been categorized as tests. Backing up to the build, we see why, for each project:

SonarCategoriseProject:
  Sonar: (Common.csproj) Categorizing project as test or product code...
  Sonar: (Common.csproj) project is evaluated as a test project based on the 'Microsoft.VisualStudio.TestPlatform.TestFramework' reference.
  Sonar: (Common.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (Link Monitoring.csproj) Categorizing project as test or product code...
  Sonar: (Link Monitoring.csproj) project is evaluated as a test project based on the 'Microsoft.VisualStudio.TestPlatform.TestFramework' reference.
  Sonar: (Link Monitoring.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (Input Router.csproj) Categorizing project as test or product code...
  Sonar: (Input Router.csproj) categorized as MAIN project (production code).
...
SonarCategoriseProject:
  Sonar: (FetchRawLogs.csproj) Categorizing project as test or product code...
  Sonar: (FetchRawLogs.csproj) project is evaluated as a test project based on the 'Microsoft.VisualStudio.TestPlatform.TestFramework' reference.
  Sonar: (FetchRawLogs.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (ProcessRawLog.csproj) Categorizing project as test or product code...
  Sonar: (ProcessRawLog.csproj) project is evaluated as a test project based on the 'Microsoft.VisualStudio.TestPlatform.TestFramework' reference.
  Sonar: (ProcessRawLog.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (MLAMain.csproj) Categorizing project as test or product code...
  Sonar: (MLAMain.csproj) project is evaluated as a test project based on the 'Microsoft.VisualStudio.TestPlatform.Test Framework' reference.
  Sonar: (MLAMain.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (FetchRawLogsTest.csproj) Categorizing project as test or product code...
  Sonar: (FetchRawLogsTest.csproj) SonarQubeTestProject has been set explicitly to True.
  Sonar: (FetchRawLogsTest.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (ProcessRawLogTestProject.csproj) Categorizing project as test or product code...
  Sonar: (ProcessRawLogTestProject.csproj) SonarQubeTestProject has been set explicitly to True.
  Sonar: (ProcessRawLogTestProject.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (ProcessRawLogEventsTestProject.csproj) Categorizing project as test or product code...
  Sonar: (ProcessRawLogEventsTestProject.csproj) SonarQubeTestProject has been set explicitly to True.
  Sonar: (ProcessRawLogEventsTestProject.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (FetchRawLogEventsTestProject.csproj) Categorizing project as test or product code...
  Sonar: (FetchRawLogEventsTestProject.csproj) SonarQubeTestProject has been set explicitly to True.
  Sonar: (FetchRawLogEventsTestProject.csproj) categorized as TEST project (test code).
...
SonarCategoriseProject:
  Sonar: (CommonUtilityTest.csproj) Categorizing project as test or product code...
  Sonar: (CommonUtilityTest.csproj) project has the MSTest project type guid -> test project.
  Sonar: (CommonUtilityTest.csproj) categorized as TEST project (test code).

“Test” code isn’t going to contribute to “lines of code” since it’s not code it’s tests.

So the question is how much actual source code is there in your one MAIN project, MLAInputRouter?

 
Ann

Details regarding project sources:

Project: MLA\MLAMain

Configuration: Debug

Scope: Assembly

Assembly: X:\MLA_src\MLA\bin\Debug\MLA.exe

Maintainability Index: 78

Cyclomatic Complexity: 268

Depth of Inheritance: 3

Class Coupling: 86

Lines of Source code: 63

Lines of Executable code: 847

Hi,

Thanks for the details, but I’m not sure they answer my question. How many files / lines of code are in your solution’s MLAInputRouter project?

 
Ann

Hi,
The MLAInputRouter project consists of 6 files, these being AssemblyInfo.cs, Event.cs, InputRouter.cs, Local.cs, MessageCreator.cs, Messages.cs, and has 387 lines of source code.

Hi,

Thanks for the details. In the interim, SonarQube 9.9 LTS has been released. Can you upgrade and see if this is still replicable?

 
Ann