The main branch of this project is empty. No results on dashboard

Hi
I use sonar-scanner-4.4.0.2170 for MSBuild (.Net Framework 4.6+) and use MSBuild.exe 15.0.

But in logs ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer"
There are no results on SonarQube dashboard


What the reason of empty results?

Hello Olga,

I assume that means you’re working on a .NET project.

You can ignore this. It’s not related to your problem (it’s not even a problem). It’s about coverage and it’s about Java, so you don’t care

I guess that you see empty values because you’re looking at the new code tab. There’s no new code, so there no issues.
Can you check if you have anything reported on the overall code tab ?

Olivier

Could you check logs?

'C:\Projects\smb-uitests-new>SonarScanner.MSBuild.exe end /d:sonar.login=“xxxx”
SonarScanner for MSBuild 5.0.4
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
15:45:42.049 15:45:42.049 WARNING: File ‘C:\Users\barinovaov.nuget\packages\specflow.allure\2.4.2.4\contentFiles\any\net45\App.config.transform’ is not located under the root directory ‘C:\Projects\smb-uitests-new’ and will not be analyzed.
15:45:42.051 15:45:42.051 WARNING: File ‘C:\Users\barinovaov.nuget\packages\specflow.allure\2.4.2.4\contentFiles\any\net45\allureConfig.Template.json’ is not located under the root directory ‘C:\Projects\smb-uitests-new’ and will not be analyzed.
15:45:42.052 15:45:42.052 WARNING: File ‘C:\Users\barinovaov.nuget\packages\nunit3testadapter\3.11.2\build\net35\NUnit3.TestAdapter.dll’ is not located under the root directory ‘C:\Projects\smb-uitests-new’ and will not be analyzed.
15:45:42.054 15:45:42.054 WARNING: File ‘C:\Users\barinovaov.nuget\packages\nunit3testadapter\3.11.2\build\net35\NUnit3.TestAdapter.pdb’ is not located under the root directory ‘C:\Projects\smb-uitests-new’ and will not be analyzed.
15:45:42.055 15:45:42.055 WARNING: File ‘C:\Users\barinovaov.nuget\packages\nunit3testadapter\3.11.2\build\net35\nunit.engine.dll’ is not located under the root directory ‘C:\Projects\smb-uitests-new’ and will not be analyzed.
15:45:42.055 15:45:42.055 WARNING: File ‘C:\Users\barinovaov.nuget\packages\nunit3testadapter\3.11.2\build\net35\nunit.engine.api.dll’ is not located under the root directory ‘C:\Projects\smb-uitests-new’ and will not be analyzed.
Calling the TFS Processor executable…
The TFS Processor has finished
Calling the SonarScanner CLI…
INFO: Scanner configuration file: C:\Projects\sonarqube\sonar-scanner-4.4.0.2170\bin…\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Projects\smb-uitests-new.sonarqube\out\sonar-project.properties
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.9 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\barinovaov.sonar\cache
INFO: Scanner configuration file: C:\Projects\sonarqube\sonar-scanner-4.4.0.2170\bin…\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Projects\smb-uitests-new.sonarqube\out\sonar-project.properties
INFO: Analyzing on SonarQube server 8.3.1
INFO: Default locale: “ru_RU”, source code encoding: “UTF-8”
INFO: Load global settings
INFO: Load global settings (done) | time=198ms
INFO: Server id: 99421149-AWWp6ZWw4qzobtjG3eDM
INFO: User cache: C:\Users\barinovaov.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=53ms
INFO: Load/download plugins (done) | time=122ms
INFO: Process project properties
INFO: Process project properties (done) | time=35ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=54ms
INFO: Project key: smb-ui-at
INFO: Base dir: C:\Projects\smb-uitests-new
INFO: Working dir: C:\Projects\smb-uitests-new.sonarqube\out.sonar
INFO: Load project settings for component key: ‘smb-ui-at’
INFO: Load project settings for component key: ‘smb-ui-at’ (done) | time=26ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=89ms
INFO: Load active rules
INFO: Load active rules (done) | time=985ms
INFO: Indexing files…
INFO: Project configuration:
INFO: Indexing files of module ‘Smb.UITests.Common’
INFO: Base dir: C:\Projects\smb-uitests-new\Rbp.UITests.Common
INFO: Test paths: AllureReport.cs, BaseSteps.cs, BrowserHelper.cs, Drivers/ILogin…
INFO: Load project repositories
INFO: Load project repositories (done) | time=26ms
INFO: Indexing files of module ‘Smb.UITests.SpecFlow’
INFO: Base dir: C:\Projects\smb-uitests-new\Rbp.UITests.SpecFlow
INFO: Test paths: Helpers/AcquiringHelper.cs, Helpers/Bill.cs, Helpers/Bookkeepin…
INFO: Indexing files of module ‘smb-ui-at’
INFO: Base dir: C:\Projects\smb-uitests-new
INFO: 248 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for cs: Sonar way
INFO: ------------- Run sensors on module Smb.UITests.Common
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=36ms
WARNING: WARNING: An illegal reflective access operation has occurred
WARNING: WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/barinovaov/.sonar/cache/54f6535c111cefad0fb6a09ba3e61922/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
WARNING: WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: WARNING: All illegal access operations will be denied in a future release
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=3ms
INFO: ------------- Run sensors on module Smb.UITests.SpecFlow
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: ------------- Run sensors on module smb-ui-at
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor C# [csharp]
INFO: Sensor C# [csharp] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=1ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 268ms, dir size=1 MB
INFO: Analysis report compressed in 239ms, zip size=287 KB
INFO: Analysis report uploaded in 86ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonyainqubevm.psbnk.msk.ru:3333/dashboard?id=smb-ui-at
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonyainqubevm.psbnk.msk.ru:3333/api/ce/task?id=AXYeVnFua9ZJPQb0TTnD
INFO: Analysis total time: 5.911 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.354s
INFO: Final Memory: 14M/60M
INFO: ------------------------------------------------------------------------
The SonarScanner CLI has finished
15:45:50.563 Post-processing succeeded.

Blockquote

Please Olga, answer my question first. Did you check what I asked ?

Files were indexed, but there are no lines code detected

It looks like scanner didn’t recognize .cs files
5

Thanks Olga,

I can see from the logs and from your file list screenshot that there’s quite some occurence of files / directories / projects with the Test string. Be aware that there’s a default behaviour of the scanner on these files/projects. See detection of test projects
That should probably explain why nothing is detected on Smb.UITests.SpecFlow project.
I am not certain for smb-ui-at project.
To be sure I would need the full logs of the 3 steps begin, build and end of your build, ran in debug (to run in debug please add /d:"sonar.verbose=true"to the begin step. Can you provide this, please.

Olivier

Hey @Olga ,
You can attach zipped files to the thread (with the full logs), instead of attaching by pieces inline, this is quite inconvenient

Good day! I attached logs.
By the way, I tried to add

<!-- in .csproj -->
<PropertyGroup>
<!-- Mark the project as being a test project -->
<SonarQubeTestProject>true</SonarQubeTestProject>
</PropertyGroup>

in my both projects (one of them Smb.UITests.SpecFlow.csproj contains .feature, .feature.cs, .cs files, other Smb.UITests.Common.csproj contains only .cs files). And still no result
@OlivierK please help to solve issue.

Hello Olga,

SonarQube does not report any issues because all files (all projects) part of the solution that you analyzed are identified as test code files, not source. SonarQube does not run most of the rules on test code (except for a few rules that are specific to test code). See logs below (empty sonar.sources list and long sonar.tests list (and in that this the files that you took in your screenshot of your previous post like AllureReport.cs

sonar.projectKey=smb-ui-at
sonar.working.directory=C:\\Projects\\smb-uitests-new\\.sonarqube\\out\\.sonar
sonar.projectBaseDir=C:\\Projects\\smb-uitests-new
...
1419237F-C871-4AD2-9302-4DDCD2939932.sonar.sources=
1419237F-C871-4AD2-9302-4DDCD2939932.sonar.tests=\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\AllureReport.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\BaseSteps.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\BrowserHelper.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\ILoginDriver.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\IMenuDriver.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\PageObjects\\LeftMenu.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\PageObjects\\LoginPage.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\PageObjects\\NotificationSettingsPage.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\PageObjects\\SettingsPage.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\PageObjects\\TechPage.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\SeleniumBrowserDriver.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\SeleniumDriverFactory.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.Common\\Drivers\\Selenium\\SeleniumLoginDriver.cs",\
...

8EDF4429-251A-416D-BB68-93F227191BCF.sonar.projectKey=smb-ui-at:8EDF4429-251A-416D-BB68-93F227191BCF
8EDF4429-251A-416D-BB68-93F227191BCF.sonar.projectName=Smb.UITests.SpecFlow
8EDF4429-251A-416D-BB68-93F227191BCF.sonar.projectBaseDir=C:\\Projects\\smb-uitests-new\\Rbp.UITests.SpecFlow
8EDF4429-251A-416D-BB68-93F227191BCF.sonar.sourceEncoding=utf-8
8EDF4429-251A-416D-BB68-93F227191BCF.sonar.sources=
8EDF4429-251A-416D-BB68-93F227191BCF.sonar.tests=\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.SpecFlow\\Helpers\\AcquiringHelper.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.SpecFlow\\Helpers\\Bill.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.SpecFlow\\Helpers\\BookkeepingHelper.cs",\
"C:\\Projects\\smb-uitests-new\\Rbp.UITests.SpecFlow\\Helpers\\ChangeEmail.cs",\
"
...

So somehow, the 2 projects that are analysed as part of the solution are considered test projects.
You can change this in different ways. Please read the detection of test projects section of the documentation, that I already gave you in my previous post.

If you mean to add
<SonarQubeTestProject>true</SonarQubeTestProject>
in both projects, I did it right now. But behaviour the same
2

Hey Olga,

I meant the opposite. If those projects are NOT test projects or even if they are but you want SonarQube to not consider them as such and analyze the like source code, you must do the reverse !
<SonarQubeTestProject>false</SonarQubeTestProject>

Does it make sense ?

Thank you Olivier, results appiered. The decision is not obvious, but it works)
So can i consider the results of analizing correct?

Great !

I guess so :slight_smile:

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