My coverage shows 0%

I have two projects in my sonarQube, the first one with java (no problem). the second one with angular, and Jasmine test framework.
My problem is that I the column coverage in sonarQube show 0% for the second project. and it’s works fine for the first project.

any solution please ?

Hello @IFK_TT,

Welcome to our community, and thank you for your message.

The analyser probably didn’t find any LCOV files from your TypeScript project. I suggest you to run the analysis in verbose mode with -X to see if there is any log of the form:

No coverage information will be saved because all LCOV files cannot be found.

If this is the case, then you probably need to set the property sonar.javascript.lcov.reportPaths adequately.


Hello @Yassin_Kammoun,

Thanks for your replay, and sorry for my delay.

I’m beginner with typescript and sonar, I have set the property sonar.javascript.lcov.reportPaths, but i still have the same problem !!

This is my application root directories

and this is my pom.xml:


Hello again,

Thank you for sharing both your project directory and your pom.xml. From what I can see, you didn’t set sonar.javascript.lcov.reportPaths; your pom.xml still defines sonar.ts.coverage.lcovReportPath instead.

In any case, could you please share the analysis logs when you run the scanner? Those will help understanding why your coverage file is not taken into account.



Thanks for your replay.

this is the log fil for sonar analysis

    [Pipeline] { (SonarQube analysis)
[Pipeline] withSonarQubeEnv (hide)
Injecting SonarQube environment variables using the configuration: SonarQube
[Pipeline] {
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] using JDK installation provided by the build agent
[withMaven] using Maven installation '3.5.0'
[Pipeline] {
[Pipeline] sh
+ mvn sonar:sonar -Dsonar.projectKey=appli-blanche-quality-appli-blanche-frontend-develop
----- withMaven Wrapper script -----
Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/var/jenkins_home/workspace/appli-blanche-frontend_develop@tmp/withMaven1c3050b8/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/var/jenkins_home/workspace/appli-blanche-frontend_develop@tmp/withMaven1c3050b8" 
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /opt/transverse/all_maven/apache-maven-3.5.0
Java version: 1.8.0_222, vendor: Oracle Corporation
Java home: /usr/local/openjdk-8/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1127.13.1.el7.x86_64", arch: "amd64", family: "unix"
[INFO] [jenkins-event-spy] Generate /var/jenkins_home/workspace/appli-blanche-frontend_develop@tmp/withMaven1c3050b8/maven-spy-20201103-121158-6955937129738832034510.log.tmp ...
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building appli-blanche-frontend 22.400.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- sonar-maven-plugin: (default-cli) @ appli-blanche-front ---
[INFO] Downloading:
[INFO] Downloaded: (1.7 kB at 335 B/s)
[INFO] User cache: /var/jenkins_home/.sonar/cache
[INFO] SonarQube version: 6.7.7
[INFO] Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
[INFO] Publish mode
[INFO] Load global settings
[INFO] Load global settings (done) | time=116ms
[INFO] Server id: 2141343F-AW68GcPv7aRs6Hf6G54p
[INFO] User cache: /var/jenkins_home/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=59ms
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=107ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=0ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=40ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=309ms
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=25ms
[INFO] Project key: appli-blanche-quality-appli-blanche-frontend-develop
[INFO] -------------  Scan appli-blanche-frontend
[INFO] Base dir: /var/jenkins_home/workspace/appli-blanche-frontend_develop
[INFO] Working dir: /var/jenkins_home/workspace/appli-blanche-frontend_develop/target/sonar
[INFO] Source paths: src/app, pom.xml
[INFO] Source encoding: UTF-8, default locale: en
[INFO] Load server rules
[INFO] Load server rules (done) | time=86ms
[INFO] Index files
[INFO] Included sources: 
[INFO]   **/*.spec.ts
[INFO] Excluded sources: 
[INFO]   node_modules/**
[INFO] 8 files indexed
[INFO] 56 files ignored because of inclusion/exclusion patterns
[INFO] Quality profile for ts: Sonar way recommended
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=14ms
[INFO] Sensor SonarTS [typescript]
[INFO] Analyzing 8 typescript file(s) with the following configuration file /var/jenkins_home/workspace/appli-blanche-frontend_develop/tsconfig.json
[INFO] 8 files analyzed out of 8
[INFO] Sensor SonarTS [typescript] (done) | time=5948ms
[INFO] Sensor SonarTS Coverage [typescript]
[INFO] Analysing [/var/jenkins_home/workspace/appli-blanche-frontend_develop/coverage/]
[WARNING] Could not resolve 31 file paths in [/var/jenkins_home/workspace/appli-blanche-frontend_develop/coverage/], first unresolved path: src/polyfills.ts
[INFO] Sensor SonarTS Coverage [typescript] (done) | time=5ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=31ms
[INFO] Sensor CPD Block Indexer
[INFO] Sensor CPD Block Indexer (done) | time=1ms
[INFO] SCM Publisher is disabled
[INFO] Calculating CPD for 8 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 128ms, dir size=85 KB
[INFO] Analysis reports compressed in 32ms, zip size=33 KB
[INFO] Analysis report uploaded in 47ms
[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
[INFO] Task total time: 9.093 s
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.929 s
[INFO] Finished at: 2020-11-03T12:12:14+01:00
[INFO] Final Memory: 24M/654M
[INFO] ------------------------------------------------------------------------
[INFO] [jenkins-event-spy] Generated /var/jenkins_home/workspace/appli-blanche-frontend_develop@tmp/withMaven1c3050b8/maven-spy-20201103-121158-6955937129738832034510.log
[Pipeline] }

Thank you for the logs.

Unfortunately, you’re using a version of SonarQube that is past EOL, and you’re going to have a hard time finding help with it.

You need to upgrade SonarQube at your earliest convenience to either the latest version (8.5.1) or the current LTS (7.9.4).

Coming back to your problem, there is something fishy when analysing the coverage file as depicted by the following log:

[WARNING] Could not resolve 31 file paths in [/var/jenkins_home/workspace/appli-blanche-frontend_develop/coverage/], first unresolved path: src/polyfills.ts

Before digging that up further, I let you first upgrading your SonarQube setup, see if that changes anything, and come back to us if the issue persists.