PR Analysis empty for dotnet

I`m trying to run PR analysis, but getting empty result in Sonarcloud:

  • ALM used: Bitbucket Cloud
  • CI system used: Bitbucket Cloud
  • Scanner command used:
dotnet sonarscanner begin \
         -k:"base-unica-v2" \
         -o:"my_organization" \
         -v:"2.0.23" \
         -d:sonar.login="my_token" \
         -d:sonar.host.url="https://sonarcloud.io" \
         -d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml" \
         -d:sonar.pullrequest.key="48" \
         -d:sonar.pullrequest.branch="feature/be-1014-sonarcloud" \
         -d:sonar.pullrequest.base="main"
dotnet build -c debug
dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
dotnet sonarscanner end -d:sonar.login="my_token"
  • Logs:
~/source/base-unica-v2> dotnet sonarscanner begin \
>         -k:"base-unica-v2" \
>         -o:"my_organization" \
>         -v:"2.0.23" \
>         -d:sonar.login="my_token" \
>         -d:sonar.host.url="https://sonarcloud.io" \
>         -d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml" \
>         -d:sonar.pullrequest.key="48" \
>         -d:sonar.pullrequest.branch="feature/be-1014-sonarcloud" \
>         -d:sonar.pullrequest.base="main"
SonarScanner for MSBuild 5.13
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
16:57:43.932  Updating build integration targets...
16:57:45.385  Fetching analysis configuration settings...
16:57:47.017  Provisioning analyzer assemblies for cs...
16:57:47.017  Installing required Roslyn analyzers...
16:57:47.018  Processing plugin: csharp version 8.56.0.67649
16:57:47.113  Processing plugin: vbnet version 8.56.0.67649
16:57:47.114  Processing plugin: securitycsharpfrontend version 10.0.0.20234
16:57:47.663  Provisioning analyzer assemblies for vbnet...
16:57:47.664  Installing required Roslyn analyzers...
16:57:47.664  Processing plugin: csharp version 8.56.0.67649
16:57:47.664  Processing plugin: vbnet version 8.56.0.67649
16:57:48.122  Downloading cache. Project key: base-unica-v2, branch: main.
16:57:50  Incremental PR analysis: 42 files out of 42 are unchanged.
16:57:50.045  Pre-processing succeeded.

~/source/base-unica-v2> dotnet build -c debug
MSBuild version 17.5.0+6f08c67f3 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  BaseUnica -> /home/acerto/source/base-unica-v2/src/BaseUnica/bin/Debug/net5.0/BaseUnica.dll
  Sonar: (BaseUnica.csproj) Project processed successfully
  BaseUnica.Web -> /home/acerto/source/base-unica-v2/src/BaseUnica.Web/bin/Debug/net5.0/BaseUnica.Web.dll
  Sonar: (BaseUnica.Web.csproj) Project processed successfully
Build succeeded.
  0 Waring(s)  
  0 Error(s)
Time Elapsed 00:00:06.42

~/source/base-unica-v2> dotnet sonarscanner end -d:sonar.login="my_token"
SonarScanner for MSBuild 5.13
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Calling the SonarScanner CLI...
INFO: Scanner configuration file: /home/acerto/.dotnet/tools/.store/dotnet-sonarscanner/5.13.0/dotnet-sonarscanner/5.13.0/tools/net5.0/any/sonar-scanner-4.8.0.2856/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/acerto/source/base-unica-v2/.sonarqube/out/sonar-project.properties
INFO: SonarScanner 4.8.0.2856
INFO: Java 11.0.18 Oracle Corporation (64-bit)
INFO: Linux 6.2.8-1-default amd64
INFO: User cache: /home/acerto/.sonar/cache
INFO: Analyzing on SonarCloud
INFO: Default locale: "pt_BR", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=1153ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /home/acerto/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=1182ms
INFO: Load/download plugins (done) | time=1373ms
INFO: Loaded core extensions: developer-scanner
INFO: Load project settings for component key: 'base-unica-v2'
INFO: Load project settings for component key: 'base-unica-v2' (done) | time=1102ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=50ms
INFO: Project key: base-unica-v2
INFO: Base dir: /home/acerto/source/base-unica-v2/src
INFO: Working dir: /home/acerto/source/base-unica-v2/.sonarqube/out/.sonar
INFO: Load project branches
INFO: Load project branches (done) | time=1115ms
INFO: Check ALM binding of project 'base-unica-v2'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'base-unica-v2' (done) | time=1132ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=1087ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=1268ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=1154ms
INFO: Load active rules
INFO: Load active rules (done) | time=10683ms
INFO: Organization key: //my_organization
INFO: Pull request 48 for merge into main from feature/be-1014-sonarcloud
INFO: Load project repositories
INFO: Load project repositories (done) | time=1127ms
INFO: SCM collecting changed files in the branch
INFO: SCM collecting changed files in the branch (done) | time=140ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'BaseUnica'
INFO:   Base dir: /home/acerto/source/base-unica-v2/src/BaseUnica
INFO:   Source paths: Configuration/AzureClientConfiguration.cs, Configuration/DbCo...
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'BaseUnica.Web'
INFO:   Base dir: /home/acerto/source/base-unica-v2/src/BaseUnica.Web
INFO:   Source paths: Program.cs, RunnerJob.cs, Startup.cs, obj/Debug/net5.0/.NETCo...
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'base-unica-v2'
INFO:   Base dir: /home/acerto/source/base-unica-v2/src
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: 126 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 2 files ignored because of scm ignore settings
INFO: Quality profile for cs: Sonar way
INFO: Quality profile for json: Sonar way
INFO: Quality profile for plsql: Sonar way
INFO: ------------- Run sensors on module BaseUnica
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=1132ms
INFO: Sensor cache enabled
INFO: Load sensor cache
INFO: Load sensor cache (2 KB) | time=2103ms
INFO: Sensor PL/SQL Sensor [plsql]
INFO: Sensor PL/SQL Sensor is restricted to changed files only
WARN: The Data Dictionary is not configured for the PLSQL analyzer, which prevents rule(s) S3641, S3921, S3618, S3651 from raising issues. See https://docs.sonarcloud.io/advanced-setup/languages/pl-sql/
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor PL/SQL Sensor [plsql] (done) | time=79ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Roslyn version: 4.5.0.0
INFO: Language version: CSharp9
INFO: Concurrent execution: enabled
INFO: Sensor C# Analysis Log [csharp] (done) | time=7ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML is restricted to changed files only
INFO: Sensor HTML [web] (done) | time=4ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: Sensor TextAndSecretsSensor is restricted to changed files only
INFO: Sensor TextAndSecretsSensor [text] (done) | time=18ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=12ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (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=1ms
INFO: Sensor CSS Rules [javascript]
INFO: Sensor CSS Rules is restricted to changed files only
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=0ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: Sensor IaC Docker Sensor is restricted to changed files only
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=67ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=3ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=1ms
INFO: Sensor AWS SAM Inline template file sensor [security]
INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=1ms
INFO: ------------- Run sensors on module BaseUnica.Web
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=12ms
INFO: Sensor IaC Kubernetes Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=6ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=0ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Roslyn version: 4.5.0.0
INFO: Language version: CSharp9
INFO: Concurrent execution: enabled
INFO: Sensor C# Analysis Log [csharp] (done) | time=0ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML is restricted to changed files only
INFO: Sensor HTML [web] (done) | time=0ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: Sensor TextAndSecretsSensor is restricted to changed files only
INFO: Sensor TextAndSecretsSensor [text] (done) | time=3ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (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=0ms
INFO: Sensor CSS Rules [javascript]
INFO: Sensor CSS Rules is restricted to changed files only
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=0ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=0ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: Sensor IaC Docker Sensor is restricted to changed files only
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=9ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=0ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=0ms
INFO: Sensor AWS SAM Inline template file sensor [security]
INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=0ms
INFO: ------------- Run sensors on module base-unica-v2
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=0ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=0ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: Sensor TextAndSecretsSensor is restricted to changed files only
INFO: Sensor TextAndSecretsSensor [text] (done) | time=1ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (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=0ms
INFO: Sensor CSS Rules [javascript]
INFO: Sensor CSS Rules is restricted to changed files only
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=0ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=0ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: Sensor IaC Docker Sensor is restricted to changed files only
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=6ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=0ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=1ms
INFO: Sensor AWS SAM Inline template file sensor [security]
INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=0ms
INFO: Sensor javabugs [dbd]
INFO: Reading IR files from: /home/acerto/source/base-unica-v2/.sonarqube/out/.sonar/ir/java
INFO: No IR files have been included for analysis.
INFO: Sensor javabugs [dbd] (done) | time=3ms
INFO: Sensor pythonbugs [dbd]
INFO: Reading IR files from: /home/acerto/source/base-unica-v2/.sonarqube/out/.sonar/ir/python
INFO: No IR files have been included for analysis.
INFO: Sensor pythonbugs [dbd] (done) | time=0ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /home/acerto/source/base-unica-v2/.sonarqube/out/.sonar/ucfg2/java
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=4ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /home/acerto/source/base-unica-v2/.sonarqube/out/ucfg_cs2
INFO: Read 41 type definitions
INFO: Reading UCFGs from: /home/acerto/source/base-unica-v2/.sonarqube/out/ucfg_cs2
INFO: 16:58:52.885295 Building Runtime Type propagation graph
INFO: 16:58:52.903643 Running Tarjan on 1003 nodes
INFO: 16:58:52.911056 Tarjan found 1003 components
INFO: 16:58:52.91788 Variable type analysis: done
INFO: 16:58:52.919387 Building Runtime Type propagation graph
INFO: 16:58:52.926219 Running Tarjan on 1003 nodes
INFO: 16:58:52.927698 Tarjan found 1003 components
INFO: 16:58:52.930402 Variable type analysis: done
INFO: Analyzing 155 ucfgs to detect vulnerabilities.
INFO: All rules entrypoints : 0
INFO: Retained UCFGs : 0
INFO: Taint analysis starting. Entrypoints: 0
INFO: Taint analysis: done.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=569ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /home/acerto/source/base-unica-v2/.sonarqube/out/.sonar/ucfg2/php
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: /home/acerto/source/base-unica-v2/.sonarqube/out/.sonar/ucfg2/python
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=0ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: /home/acerto/source/base-unica-v2/.sonarqube/out/.sonar/ucfg2/js
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor JsSecuritySensor [security] (done) | time=1ms
INFO: ------------- Run sensors on project
INFO: Sensor C# [csharp]
INFO: Importing results from 6 proto files in '/home/acerto/source/base-unica-v2/.sonarqube/out/0/output-cs'
INFO: Importing results from 6 proto files in '/home/acerto/source/base-unica-v2/.sonarqube/out/1/output-cs'
INFO: Importing 2 Roslyn reports
INFO: Found 2 MSBuild C# projects: 2 MAIN projects.
INFO: Sensor C# [csharp] (done) | time=136ms
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=5ms
INFO: Sensor C# File Caching Sensor [csharp]
INFO: Sensor C# File Caching Sensor [csharp] (done) | time=0ms
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the Visual Studio coverage XML report /home/acerto/source/base-unica-v2/./coverage.xml
INFO: Adding this code coverage report to the cache for later reuse: /home/acerto/source/base-unica-v2/./coverage.xml
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=53ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=3ms
INFO: CPD Executor 7 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 35 files
INFO: CPD Executor CPD calculation finished (done) | time=24ms
INFO: SCM writing changed lines
INFO: SCM writing changed lines (done) | time=5ms
INFO: Analysis report generated in 406ms, dir size=229 KB
INFO: Analysis report compressed in 70ms, zip size=72 KB
INFO: Analysis report uploaded in 1558ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=base-unica-v2&pullRequest=48
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://sonarcloud.io/api/ce/task?id=AYfJcoC3e8xkCmipLPPv
INFO: Analysis total time: 28.499 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 34.244s
INFO: Final Memory: 37M/174M
INFO: ------------------------------------------------------------------------
The SonarScanner CLI has finished
16:58:55.993  Post-processing succeeded.
  • Languages of the repository: dotnet 5.0 C#
  • Error observed: PR analysis is listed, however empty results
  • Steps to reproduce
    Run sonar scanner analysis on dotnet 5 repo.

No idea why the results are empty.
Any tip is welcome!

Hey there.

What do you expect to see changed in the pull request (how many / what kind of files did you change in this pull request)?