Coverage data missing from some typescript files

Must-share information (formatted with Markdown):

  • Versions: SonarQube Server: v2026.1 Enterprise Edition, SonarScanner CLI 8.0.1.6346
  • How is SonarQube deployed: EC2
  • What are you trying to achieve: Calculate code coverage for typescript monorepo
  • What have you tried so far to achieve this, scour the internet looking for possible solutions; enabled verbose logging of sonar-scanner which produced the following errors for coverage:

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7464 of coverage report file (java.lang.IllegalArgumentException: Line with number 13 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7492 of coverage report file (java.lang.IllegalArgumentException: Line with number 12 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7493 of coverage report file (java.lang.IllegalArgumentException: Line with number 13 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7494 of coverage report file (java.lang.IllegalArgumentException: Line with number 15 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7495 of coverage report file (java.lang.IllegalArgumentException: Line with number 20 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7496 of coverage report file (java.lang.IllegalArgumentException: Line with number 31 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7497 of coverage report file (java.lang.IllegalArgumentException: Line with number 43 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7498 of coverage report file (java.lang.IllegalArgumentException: Line with number 50 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7499 of coverage report file (java.lang.IllegalArgumentException: Line with number 61 doesn’t belong to file index.ts).

19:58:14.072 DEBUG Problem during processing LCOV report: can’t save DA data for line 7500 of coverage report file (java.lang.IllegalArgumentException: Line with number 72 doesn’t belong to file index.ts).

I’ve gone through the lcov.info files and spot checked a few of these and the line numbers match up with the source code.

Hi,

Is it possible there are two files with that name in different directories?

 
Ann

Yes there are but the ones not showing coverage are not duplicated.

Hi,

Do any of the index.ts files end before line 12?

I think probably the analyzer is getting confused about which reports attach to which files.

 
Ann

If the full path in the report is accurate why would it get confused?

I also switched from lcov to generic coverage report and have the same outcome.

2026-05-20T15:44:41.797913Z 01O 15:44:40.038 INFO  Sensor Generic Coverage Report
2026-05-20T15:44:41.798528Z 01O 15:44:40.039 INFO  Parsing <path>/generic-coverage.xml
2026-05-20T15:44:41.874150Z 01O 15:44:40.114 INFO  Imported coverage data for 279 files
2026-05-20T15:44:41.874153Z 01O 15:44:40.114 INFO  Coverage data ignored for 1 unknown files, including:
2026-05-20T15:44:41.874153Z 01O  <path>/IframeBreakoutView.vue
2026-05-20T15:44:41.874154Z 01O 15:44:40.114 INFO  Parsing  <path>/generic-coverage.xml
2026-05-20T15:44:41.926412Z 01O 15:44:40.167 INFO  Imported coverage data for 308 files
2026-05-20T15:44:41.926413Z 01O 15:44:40.167 INFO  Parsing  <path>/generic-coverage.xml
2026-05-20T15:44:41.939749Z 01O 15:44:40.180 INFO  Imported coverage data for 144 files
2026-05-20T15:44:41.939750Z 01O 15:44:40.180 INFO  Parsing  <path>/generic-coverage.xml
2026-05-20T15:44:41.947179Z 01O 15:44:40.187 INFO  Imported coverage data for 92 files
2026-05-20T15:44:41.947181Z 01O 15:44:40.187 INFO  Parsing  <path>/generic-coverage.xml
2026-05-20T15:44:41.950003Z 01O 15:44:40.190 INFO  Imported coverage data for 18 files
2026-05-20T15:44:41.950004Z 01O 15:44:40.190 INFO  Parsing  <path>/generic-coverage.xml
2026-05-20T15:44:41.965786Z 01O 15:44:40.206 INFO  Imported coverage data for 196 files

For example, I see it imported coverage data for 196 files but then when going to the sonar report, none of the files from that coverage report show coverage.

Hi,

I’m confused. With the Generic Coverage Report, you have errors about coverage lines that don’t match up to your files?

 
Ann

Sorry @ganncamp,

I have line errors using lcov which started this thread. I then switch over to use the generic coverage report to see if that would help but I get the same coverage result using both report types.

Donald

Hi Donald,

Can you provide that debug log? And is it the same files that lack coverage regardless of the report format? (I’m assuming here that coverage does show up for some files…?)

 
Ann

@ganncamp, exactly! Can I send you the file privately?

Hi,

Feel free to redact the log as necessary.

Since it’s the same files that don’t get their coverage imported regardless of import format, then we know it’s the data, not the format.

Did you say the report provides full file paths, or relative?

 
Ann

@ganncamp

It provides relative file path from the root of the project. I’m trying to redact the file but I’d have to almost redact every filepath.

Donald

Hi,

Are you able to make it output absolute file paths instead?

And it was the debug log I was looking for, rather than the coverage report.

 
Ann

@ganncamp

I can update it for the absolute filepath and try again. The debug output is what I’m trying to redact. There is sensitive information in the file paths.

Donald

@ganncamp

I’m still working on the log file but I just noticed these… could this be the reason?

2026-05-20T17:25:00.745036Z 01O 17:25:00.410 DEBUG Purging component not scanned: packages/sdk/src/event/publishers/event-publisher.ts @ Location[file=packages/sdk/src/event/publishers/event-publisher.ts, kind=file, startLine=1, startColumn=1, endLine=1, endColumn=2]
2026-05-20T17:25:00.745099Z 01O 17:25:00.410 DEBUG Purging component not scanned: node_modules/.pnpm/vue@3.5.31_typescript@5.9.3/node_modules/vue/dist/vue.d.mts @ Location[file=node_modules/.pnpm/vue@3.5.31_typescript@5.9.3/node_modules/vue/dist/vue.d.mts, kind=file, startLine=1, startColumn=1, endLine=1, endColumn=2]
2026-05-20T17:25:00.745100Z 01O 17:25:00.410 DEBUG Purging component not scanned: packages/sdk/src/app/index.ts @ Location[file=packages/sdk/src/app/index.ts, kind=file, startLine=1, startColumn=1, endLine=1, endColumn=2]
2026-05-20T17:25:00.745101Z 01O 17:25:00.410 DEBUG Purging component not scanned: packages/sdk/src/event/publishers/backend-publisher.ts @ Location[file=packages/sdk/src/event/publishers/backend-publisher.ts, kind=file, startLine=1, startColumn=1, endLine=1, endColumn=2]
2026-05-20T17:25:00.745134Z 01O 17:25:00.410 DEBUG Purging component not scanned: packages/sdk/src/utils/index.ts @ Location[file=packages/sdk/src/utils/index.ts, kind=file, startLine=1, startColumn=1, endLine=1, endColumn=2]
2026-05-20T17:25:00.745146Z 01O 17:25:00.410 DEBUG Purging component not scanned: apps/retail/src/composition/use-retail-provider-offers.ts @ Location[file=apps/retail/src/composition/use-retail-provider-offers.ts, kind=file, startLine=1, startColumn=1, endLine=1, endColumn=2]

@ganncamp ,

Here is the log file.

Hi,

Thanks for the log.

I think this is probably a red herring. Do the file names correspond to any of the files you’re missing coverage for?

Looking at the errors in the log, there are a lot (a lot) of errors about index.ts which leads me to wonder how many files you have named index.ts. I still think this is probably about file confusion.

But also, there are a few sets of lines about other file names. So, are there multiple ExitView.vue files in your project?

 
Ann

Yes, there are ExitView.vue and possibly others in this project with the same name. There are also a lot of index.ts files. This is a pnpm project with a lot of packages in it.

Taking ExitView.vue for example, that shows code coverage just fine in Sonarqube.

Hi,

Do all copies of ExitView.vue have coverage in SonarQube?

 
Ann

Looks like one has coverage in SonarQube and the other does not. This seems like a bug.

Hi,

That’s what I suspected; thanks for confirming. I think you’re going to need to have the report generated with absolute paths. Is that doable?

 
Ann