# Sonarcloud coverage hell (need help)

**URL:** <https://forum.opencyphal.org/t/sonarcloud-coverage-hell-need-help/2410>\
**Category:** Development & Maintenance\
**Created:** [August 16, 2025, 5:47pm UTC](https://forum.opencyphal.org/t/sonarcloud-coverage-hell-need-help/2410 "2025-08-16T17:47:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottdixon](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/scottdixon/32/39_2.png) [@scottdixon](https://forum.opencyphal.org/u/scottdixon)\
**Post date:** [August 16, 2025, 5:47pm UTC](https://forum.opencyphal.org/t/sonarcloud-coverage-hell-need-help/2410/1 "2025-08-16T17:47:13Z")

</div>

I’m in code coverage hell right now and am hoping someone in the community might be able to help. The [CETL](https://github.com/openCyphal/cetl) project’s sonarcloud build hasn’t been reporting code coverage data even though we are generating it – both as HTML reports and cobertura xml – and it is not empty. I’ve been trying shit for the last few hours to no avail. At this point I have to assume that sonarscanner just can’t handle header-only C++. This would mean we need a different solution other than sonarcloud. I tried jetbrain’s new solution but it didn’t work at all so…fuck that noise. Anyone have other ideas?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [August 16, 2025, 6:14pm UTC](https://forum.opencyphal.org/t/sonarcloud-coverage-hell-need-help/2410/2 "2025-08-16T18:14:39Z")

</div>

I haven’t looked at the code but I struggled with header-only too, and there was a ~~solution~~ workaround that helped:

> **[Analyzing a header-only C++ library](https://community.sonarsource.com/t/analyzing-a-header-only-c-library/51468)**
>
> Hi there. First things first: ALM used: GitHub CI system used: GitHub Actions Languages of the repository: C++ I am developing a header-only C++ library and I want to analyze it using a free tier account at SonarCloud. I should say that I am...

One working example here:

> <https://github.com/Zubax/kocherga/blob/d806ba1dd6acb550aeeea7e21172fa08535a0213/.github/workflows/main.yml#L179-L198>

Another example from a large header-only library:

```bash
sonar-scanner \
--define sonar.host.url="https://sonarcloud.io" \
--define sonar.cfamily.compile-commands="$BUILD_DIR/compile_commands.json" \
--define sonar.projectName=dyshlo \
--define sonar.organization=zubax \
--define sonar.projectKey=Zubax_dyshlo \
--define sonar.sources=include,sitl,verification \
--define sonar.issue.ignore.allfile=a1,a2 \
--define sonar.issue.ignore.allfile.a1.fileRegexp='^TEST_CASE\([a-zA-Z0-9_]+\)$' \
--define sonar.issue.ignore.allfile.a2.fileRegexp='^namespace dyshlo::verification(::.+)?$' \
--define sonar.issue.ignore.block=1 \
--define sonar.issue.ignore.block.1.beginBlockRegexp='//.*NOSONARBEGIN' \
--define sonar.issue.ignore.block.1.endBlockRegexp='//.*NOSONAREND' \
--define sonar.coverage.exclusions="verification/**/*" \
--define sonar.cpd.exclusions="verification/**/*" \
--define sonar.cfamily.llvm-cov.reportPath="$BUILD_DIR/coverage.txt" \
--define sonar.cfamily.threads="$(nproc)" \
--define sonar.python.version=3.12,3.13

```

---

<div class="post-metadata">

**Author:** ![scottdixon](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/scottdixon/32/39_2.png) [@scottdixon](https://forum.opencyphal.org/u/scottdixon)\
**Post date:** [August 16, 2025, 6:33pm UTC](https://forum.opencyphal.org/t/sonarcloud-coverage-hell-need-help/2410/3 "2025-08-16T18:33:04Z")

</div>

Tried this. No luck. Something may have changed and they might not support this at all anymore?

---

<div class="post-metadata">

**Author:** ![scottdixon](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/scottdixon/32/39_2.png) [@scottdixon](https://forum.opencyphal.org/u/scottdixon)\
**Post date:** [August 16, 2025, 6:34pm UTC](https://forum.opencyphal.org/t/sonarcloud-coverage-hell-need-help/2410/4 "2025-08-16T18:34:07Z")

</div>

> [@pavel.kirienko](#):
>
> [kocherga/.github/workflows/main.yml at d806ba1dd6acb550aeeea7e21172fa08535a0213 · Zubax/kocherga · GitHub](https://github.com/Zubax/kocherga/blob/d806ba1dd6acb550aeeea7e21172fa08535a0213/.github/workflows/main.yml#L179-L198)

Perhaps [coveralls.io](http://coveralls.io)?
