# Is huge difference comes in code coverage after SonarQbe upgradation

**URL:** <https://community.sonarsource.com/t/is-huge-difference-comes-in-code-coverage-after-sonarqbe-upgradation/134257>\
**Category:** Plugin Development\
**Tags:** coverage\
**Created:** [January 30, 2025, 7:56am UTC](https://community.sonarsource.com/t/is-huge-difference-comes-in-code-coverage-after-sonarqbe-upgradation/134257 "2025-01-30T07:56:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj007](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@Raj007](https://community.sonarsource.com/u/Raj007)\
**Post date:** [January 30, 2025, 7:56am UTC](https://community.sonarsource.com/t/is-huge-difference-comes-in-code-coverage-after-sonarqbe-upgradation/134257/1 "2025-01-30T07:56:49Z")

</div>

Hi Team,  
We upgrade SonarQube 7.9 community to SonarQube 9.9 community .  
Previously code coverage was 80%. on SonarQube 7.9.  
When we upgrade the SonarQube version 7.9 to 9.9.  
We reanalyze the same project on SonarQube 9.9 then it give us the 27% code converge.  
Why it give huge difference in code coverage after upgradation.

---

<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:** [January 31, 2025, 4:25pm UTC](https://community.sonarsource.com/t/is-huge-difference-comes-in-code-coverage-after-sonarqbe-upgradation/134257/2 "2025-01-31T16:25:08Z")

</div>

Hi,

A lot changed between 7.9 and 9.9 including some coverage parameters.

You should check all the upgrade notes as well as reading your analysis log.

The analysis / scanner log is what’s output from the analysis command.

[This guide](https://community.sonarsource.com/t/how-to-find-logs-about-importing-code-coverage/73317) will help you find them.

And BTW, 9.9 is no longer the LTA. 2025.1 LTA was released last week. You should finish your migration journey.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Raj007](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@Raj007](https://community.sonarsource.com/u/Raj007)\
**Post date:** [February 5, 2025, 5:30am UTC](https://community.sonarsource.com/t/is-huge-difference-comes-in-code-coverage-after-sonarqbe-upgradation/134257/3 "2025-02-05T05:30:17Z")

</div>

Hi Ann,  
When we analyze the only required folders, we get as expected code coverage up to 72%.

But when we add one more required folder in the next analysis, then it reduces the code coverage up to 52%.

Please suggest why this kind of difference comes in code coverage.

---

<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:** [February 5, 2025, 12:59pm UTC](https://community.sonarsource.com/t/is-huge-difference-comes-in-code-coverage-after-sonarqbe-upgradation/134257/4 "2025-02-05T12:59:42Z")

</div>

Hi,

This is purely a math question. Does the additional directory have test coverage? To what degree? How large is it?

The coverage formula is in [the docs](https://docs.sonarsource.com/sonarqube-server/latest/user-guide/code-metrics/metrics-definition/#coverage).

&nbsp;  
HTH,  
Ann
