# Multiple LCOV files are not providing coverage as expected

**URL:** <https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278>\
**Category:** SonarQube Server / Community Build\
**Tags:** coverage\
**Created:** [June 23, 2025, 12:56pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278 "2025-06-23T12:56:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikunjpatel](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nikunjpatel](https://community.sonarsource.com/u/nikunjpatel)\
**Post date:** [June 23, 2025, 12:56pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/1 "2025-06-23T12:56:11Z")

</div>

We have multi module project and having multiple LCOV. After scanning we are not getting correct coverage. I analysed LCOV report on [https://lcov-viewer.netlify.app/](https://lcov-viewer.netlify.app/) but sonar is not producing coverage inline to lcov-viewer display.

On our jenkins agent mudule structure is as below

Workclient/target  
 → coverage-report → lcof.info  
 → coverage-data  
-----\> server → lcof.info  
-----\> backup-agent → lcof.info  
-----\> cloud9 → lcof.info  
-----\> dmp-manager → lcof.info  
-----\> model-runner → lcof.info  
-----\> om-client → lcof.info

Workclient/target is a parent directorory and coverage-report and coverage-date are child directories of target directory. -----\> are child directories of coverage-date which contains lcov.info respectively.

Given this structure. we are not getting coverage data on sonar inline to what Lcov.info file produced the result

However, jenkins build logs implies that all above given locv.info files analylsed successfully.

`12:06:59** [e[1;34mINFOe[m] Analysing [/home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-report/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/cloud9/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/server/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/om-client/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/dmp-manager/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/model-runner/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/backup-agent/lcov.info]`

` **14:44:24** [e[1;33mWARNINGe[m]Could not resolve 220 file paths in [/home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/model-runner/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/client-coverage-report/Chrome Headless 134.0.0.0 (Linux x86_64)/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/backup-agent/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/om-client/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/dmp-manager/lcov.info, /home/ec2-user/workspace/ture_TOD-2291-migration-to-sonar/workclient/target/coverage-data/cloud9/lcov.info]`

Could you please suggest how to handle these multiple lcov.info to get correct coverage on sonar scanning?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 24, 2025, 12:21pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/2 "2025-06-24T12:21:56Z")

</div>

Hi,

> [@nikunjpatel](#):
>
> Could not resolve 220 file paths

The paths in the coverage reports don’t match the paths analysis is seeing. You’ll need to resolve that.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![nikunjpatel](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nikunjpatel](https://community.sonarsource.com/u/nikunjpatel)\
**Post date:** [June 25, 2025, 4:31pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/3 "2025-06-25T16:31:14Z")

</div>

Hi Ann,

Not sure how to fix those paths as lcove.info files are being found correctly from the given path. I also tried with avoiding wildcard and provided absolute patch of each lcov file comma separated.

like this

```auto
<sonar.javascript.lcov.reportPaths>
           ${project.basedir}/workclient/target/client-coverage-report/Chrome Headless 134.0.0.0 (Linux x86_64)/lcov.info,
            ${project.basedir}/workclient/target/coverage-data/backup-agent/lcov.info,
            ${project.basedir}/workclient/target/coverage-data/cloud9/lcov.info,
            ${project.basedir}/workclient/target/coverage-data/dmp-manager/lcov.info,
            ${project.basedir}/workclient/target/coverage-data/model-runner/lcov.info,
            ${project.basedir}/workclient/target/coverage-data/om-client/lcov.info,
            ${project.basedir}/workclient/target/coverage-data/server/lcov.info
</sonar.javascript.lcov.reportPaths>`

```

Any suggestions?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 25, 2025, 5:03pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/4 "2025-06-25T17:03:51Z")

</div>

Hi,

Are you moving the lcov files around after creation? If so, it may be that that’s what’s throwing it off. Otherwise, you may need to add a step to adjust the paths in the reports.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![nikunjpatel](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nikunjpatel](https://community.sonarsource.com/u/nikunjpatel)\
**Post date:** [June 25, 2025, 5:09pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/5 "2025-06-25T17:09:55Z")

</div>

We are doining sonar scan in post action in CI(Jenkins) pipeline and all reports generate under `workclien/target` directory at run time in jenkins agents and we provide the path of each lcov in pom (as mentioned in earlier post)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 25, 2025, 6:43pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/6 "2025-06-25T18:43:01Z")

</div>

Hi,

What do the paths in those reports look like?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![nikunjpatel](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nikunjpatel](https://community.sonarsource.com/u/nikunjpatel)\
**Post date:** [June 25, 2025, 7:02pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/7 "2025-06-25T19:02:49Z")

</div>

I am putting some of paths from lcov reports

```auto
backup-agent/lib
dmp-manager/lib
mosel-runner/lib
local/js/browser

```

I missed to pasted log line from my original post

```auto
 [e[1;33mWARNINGe[m] First unresolved path: ../local/js/browser/browser-context.js (Run in DEBUG mode to get full list of unresolved paths)

```

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 26, 2025, 2:10pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/8 "2025-06-26T14:10:21Z")

</div>

Hi,

From the analysis base directory, where does `../local/js/browser...` get you?

Again, you need to look at the paths in the reports and compare them to the paths analysis is seeing. Probably the paths in the reports should be relative from the project / analysis base directory.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![nikunjpatel](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nikunjpatel](https://community.sonarsource.com/u/nikunjpatel)\
**Post date:** [June 27, 2025, 3:22pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/9 "2025-06-27T15:22:31Z")

</div>

Hi Ann

It looks like this [blog](https://www.sonarsource.com/blog/executable_lines/?_gl=1%2Anrkg2y%2A_gcl_au%2AMTEzNDgzNjU0Ny4xNzQ3NzYwMTM0Ljc5Nzc2ODcxMC4xNzUwNDMyMzg2LjE3NTA0MzIzODU.%2A_ga%2AMjExMTI2Mjg1MS4xNzQ3NzYwMTM0%2A_ga_9JZ0GZ5TC6%2AczE3NTEwMjk0ODQkbzM2JGcxJHQxNzUxMDI5NTg2JGozOCRsMCRoMA..) explaing our issue but just wanted to know is this blog still relevant being it was published in 2018?

What we have noticed it that in one of the modules `model-runner` we are doing coverage on only one directory `model-runner/libs` and sonar producing correct coverage 74% uder `code` section which is inline to lcov.info but overall coverage (on overview page) to this module is dropping to just 24.1%. Does that mean sonar is generating overall coverage to all the directories/files that reside under model-runner and not only on model-runner/libs directory?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 27, 2025, 5:56pm UTC](https://community.sonarsource.com/t/multiple-lcov-files-are-not-providing-coverage-as-expected/143278/10 "2025-06-27T17:56:03Z")

</div>

Hi,

> [@nikunjpatel](#):
>
> Could not resolve 220 file paths

Your issue is not that the coverage is imported but the totals don’t match. It’s that it’s not imported.

You still need to sort out those path differences, I’m afraid.

&nbsp;  
Ann
