# Condition coverage metric is inaccurate (SQ LTS 9.9)

**URL:** <https://community.sonarsource.com/t/condition-coverage-metric-is-inaccurate-sq-lts-9-9/84192>\
**Category:** SonarQube Server / Community Build\
**Tags:** metrics, coverage\
**Created:** [February 16, 2023, 9:08pm UTC](https://community.sonarsource.com/t/condition-coverage-metric-is-inaccurate-sq-lts-9-9/84192 "2023-02-16T21:08:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Y](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alex_y/32/38863_2.png) [@Alex\_Y](https://community.sonarsource.com/u/Alex_Y)\
**Post date:** [February 16, 2023, 9:08pm UTC](https://community.sonarsource.com/t/condition-coverage-metric-is-inaccurate-sq-lts-9-9/84192/1 "2023-02-16T21:08:18Z")

</div>

- which versions are you using: SonarQube Developer Edition 9.9.0.65466
- how is SonarQube deployed: Docker
- what are you trying to achieve: get accurate metrics
- what have you tried so far to achieve this: simple scanning

**Description of a problem**  
Even though the line within the condition body is not covered, which means one of the possible true/false flags was not covered, both `Conditions to cover` and `Uncovered conditions` = 0

 ![Innacurate condition coverage](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/f/a/fa15180e9f78feab1a277beca6803680607716b0.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [February 20, 2023, 8:52am UTC](https://community.sonarsource.com/t/condition-coverage-metric-is-inaccurate-sq-lts-9-9/84192/2 "2023-02-20T08:52:22Z")

</div>

Hey there.

Something already seems funny with the reports being passed to SonarQube.

> [@Condition coverage metric is inaccurate (SQ LTS 9.9)](https://community.sonarsource.com/t/condition-coverage-metric-is-inaccurate-sq-lts-9-9/84192):
>
> which versions are you using: SonarQube Developer Edition 9.9.0.65466 how is SonarQube deployed: Docker what are you trying to achieve: get accurate metrics what have you tried so far to achieve this: simple scanning Description of a problem Even though the line within the condition body is not covered, which means one of the possible true/false flags was not covered, both Conditions to cover and Uncovered conditions = 0

I would suggest looking into this first, and then see if the problem persists around condition coverage.

---

<div class="post-metadata">

**Author:** ![Alex\_Y](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alex_y/32/38863_2.png) [@Alex\_Y](https://community.sonarsource.com/u/Alex_Y)\
**Post date:** [February 21, 2023, 11:18am UTC](https://community.sonarsource.com/t/condition-coverage-metric-is-inaccurate-sq-lts-9-9/84192/3 "2023-02-21T11:18:40Z")

</div>

Hey, Collin,

Thanks.

I believe you wanted to refer [this issue](https://community.sonarsource.com/t/comments-nested-in-the-function-body-affect-coverage-metrics/84194), did not you? (I see the link to this same question).

We are using GO. Do I understand correctly that SonarQube generates conditions coverage metrics based on the unit-tests reports passed to the Sonar instance? Do you think there is a chance SQ does not process those correctly? I’d like to ensure the problem is on our/Go side.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [February 21, 2023, 3:40pm UTC](https://community.sonarsource.com/t/condition-coverage-metric-is-inaccurate-sq-lts-9-9/84192/4 "2023-02-21T15:40:02Z")

</div>

Hey there.

Yes, I meant to link to your other post! Sorry about that.

Thanks for the clarification that you’re using Go. It reminds me of an issue with Go Coverage specifically because of the information in the report. You can find details of the work (already deployed) at [SONARSLANG-537](https://sonarsource.atlassian.net/browse/SONARSLANG-537)

Would it be possible for you to create a small project that reproduces this issue on just one file? It would speed up the investigation a lot, and it looks like you might already have a source file / tests written
