Code coverage for Angular is not working

I tried to use SonarCloud plugin in Azure DevOps but I couldn’t make the code coverage work.
When I use sonar-scanner - npm (, it works like a charm. Could you help to look into it?

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)

Azure DevOps

  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI

Azure DevOps

  • Scanner command used when applicable (private details masked)

    - task: SonarCloudPrepare@1

        displayName: "Prepare analysis on SonarCloud"


          SonarCloud: *****

          organization: orsted

          projectKey: *****

          scannerMode: CLI

          cliProjectKey: *****

          cliSources: src

          configMode: manual

          extraProperties: |










    - task: SonarCloudAnalyze@1

        displayName: "Run SonarCloud analysis"

    - task: SonarCloudPublish@1

        displayName: "Publish results on build summary"

  • Languages of the repository


  • Only if the SonarCloud project is public, the URL

    • And if you need help with pull request decoration, then the URL to the PR too

Nope, not public

  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

Log for lcov being picked up:

INFO: SonarScanner

INFO: Java 11.0.11 AdoptOpenJDK (64-bit)

INFO: Linux 5.11.0-1021-azure amd64

DEBUG: SonarCloud


17:19:40.157 DEBUG: Adding rules for repository 'jssecurity', language: JAVASCRIPT, [class, class, class, class, class, class, class, class, class, class, class, class, class, class, class] from

17:19:40.170 DEBUG: Adding rules for repository 'tssecurity', language: TYPESCRIPT, [class, class, class, class, class, class, class, class, class, class, class, class, class, class, class] from


INFO: 268/268 source files have been analyzed

INFO: Sensor TypeScript analysis [javascript] (done) | time=22045ms

INFO: Sensor JavaScript/TypeScript Coverage [javascript]

DEBUG: Using '/home/vsts/work/1/s/test-results/coverage/' to resolve LCOV files

INFO: Analysing [/home/vsts/work/1/s/test-results/coverage/]

INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=48ms

INFO: Sensor CSS Metrics [javascript]

INFO: Sensor CSS Metrics is restricted to changed files only


DEBUG: SCM reported changed lines for 6 files in the branch

INFO: SCM writing changed lines (done) | time=176ms

INFO: Analysis report generated in 788ms, dir size=358 KB

INFO: Analysis report compressed in 258ms, zip size=247 KB

INFO: Analysis report generated in /home/vsts/work/1/s/.scannerwork/scanner-report

DEBUG: Upload report

DEBUG: POST 200**** | time=193ms

INFO: Analysis report uploaded in 196ms

DEBUG: Report metadata written to /home/vsts/work/_temp/sonar/****/report-task.txt

INFO: ANALYSIS SUCCESSFUL, you can find the results 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****

DEBUG: Post-jobs :

DEBUG: eslint-bridge server will shutdown

Hey there.

What do you see in the UI after the analysis is complete that makes you think it hasn’t worked?

This is what I see. The code coverage doesn’t show up in sonarcloud. If the same settings with using sonarscanner from npm registries works.
The different between SonarCloudAnalyze@1 and sonarscanner is the versioning.
SonarCloudAnalyze@1 is using SonarScanner while sonarscanner in npm registries is using SonarQube Scanner

Hey @hongtat

Since you showed the issue in the context of a Pull Request, I wonder if you’re actually facing this issue (for which a fix was just deployed)

Can you check your project again?

Hi Colin,

It works now. I was struggling with this code coverage doesn’t show up in sonarcloud. Thank you for helping me out.

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