# Coverage Broken: why does nobody care?

**URL:** <https://contributors.scala-lang.org/t/coverage-broken-why-does-nobody-care/6262>\
**Category:** Compiler\
**Created:** [August 10, 2023, 1:05am UTC](https://contributors.scala-lang.org/t/coverage-broken-why-does-nobody-care/6262 "2023-08-10T01:05:09Z")\
**Posts on this page:** 4\
**Page:** 3

<div class="post-metadata">

**Author:** ![goshacodes](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/goshacodes/32/3068_2.png) [@goshacodes](https://contributors.scala-lang.org/u/goshacodes)\
**Post date:** [October 31, 2024, 12:52pm UTC](https://contributors.scala-lang.org/t/coverage-broken-why-does-nobody-care/6262/45 "2024-10-31T12:52:19Z")

</div>

Hi! I see both PR’s are merged as a part of 3.3.2. But we have same behavior on 3.3.3 (Coverage drop from 80% to 31%) and this one is just closed [Draft: Fix coverage reporting with for comprehensions by vijaykramesh · Pull Request #17239 · scala/scala3 · GitHub](https://github.com/scala/scala3/pull/17239). This is the last part of the migration. Could you please tell, is it finally fixed and which version is it?

---

<div class="post-metadata">

**Author:** ![WojciechMazur](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/wojciechmazur/32/1963_2.png) [@WojciechMazur](https://contributors.scala-lang.org/u/WojciechMazur)\
**Post date:** [October 31, 2024, 2:08pm UTC](https://contributors.scala-lang.org/t/coverage-broken-why-does-nobody-care/6262/46 "2024-10-31T14:08:50Z")

</div>

The original issue was fixed and released in Scala 3.3.2 / 3.3.3 - see coverage changelog for Scala 3.3.3 [Release 3.3.3 · scala/scala3 · GitHub](https://github.com/scala/scala3/releases/tag/3.3.3)  
It contains both fixes mentioned in the original issue: [Compiler produces incorrect/incomplete coverage data · Issue #16634 · scala/scala3 · GitHub](https://github.com/scala/scala3/issues/16634#issuecomment-1704913874)  
I guess your problems might be related to some other issues. In such a case, we’d require a reproducer to fix it.

If you’ve used exclusions for coverage reports in Scala 2, then these were added in Scala 3.3.4 (as a backport from 3.4.2)([Port coverage filter options for packages and files by KacperFKorban · Pull Request #19727 · scala/scala3 · GitHub](https://github.com/scala/scala3/pull/19727))

---

<div class="post-metadata">

**Author:** ![goshacodes](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/goshacodes/32/3068_2.png) [@goshacodes](https://contributors.scala-lang.org/u/goshacodes)\
**Post date:** [November 2, 2024, 4:45am UTC](https://contributors.scala-lang.org/t/coverage-broken-why-does-nobody-care/6262/47 "2024-11-02T04:45:44Z")

</div>

Thank you! It wasn’t 31, it was pipeline failure (some tests were not included) and missing exclusion filters. Now looks like the reports are almost identical and I have 65 compared to 80. I’ll try to collect differences and open an issue

---

<div class="post-metadata">

**Author:** ![goshacodes](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/goshacodes/32/3068_2.png) [@goshacodes](https://contributors.scala-lang.org/u/goshacodes)\
**Post date:** [November 2, 2024, 1:00pm UTC](https://contributors.scala-lang.org/t/coverage-broken-why-does-nobody-care/6262/48 "2024-11-02T13:00:32Z")

</div>

> <https://github.com/scala/scala3/issues/21877>
>
> \## Compiler version
> 3.3.4
> 
> \## Problem
> Scala 3 coverage of my project is stil…l significantly lower than scala 2 (~ 20% for statements and 27% for branches)
> I've tried to inspect reports to see differences.
> 1. In general Scala 3 has much more statements and branches. Why this may be so? 
> 2. Scala 3 has much more classes then Scala 2. And looks like this is because of \`$anon\` class. I've tried to look closer and looks like now macro generated code is also covered. IMO macro generated by some library code should not be covered by default, since library users are not testing libraries, but their own code.
> 
> So is it just more precise score and this is a desired behavior or not? 
> 
> \## Scala 2.13 report
> \<img width="1285" alt="image" src="https://github.com/user-attachments/assets/02673df9-491e-41eb-b2f7-e033eed0b4d1"\>
> 
> \## Scala 3 report
> \<img width="1277" alt="image" src="https://github.com/user-attachments/assets/92e2cde8-c972-4f41-817d-619b96f5915d"\>
> 
> \## Scala 2.13 report
> \<img width="1277" alt="image" src="https://github.com/user-attachments/assets/3867b24d-e1b2-487f-a2ce-457a3006cc3e"\>
> 
> \## Scala 3 report
> \<img width="1278" alt="image" src="https://github.com/user-attachments/assets/39a98e73-0834-49bd-b7cc-562c6e5e5f91"\>
> 
> \## Statements
> \<img width="997" alt="image" src="https://github.com/user-attachments/assets/ccb90e84-fbc0-450f-a691-baf1e30f9c5e"\>
> \<img width="1030" alt="image" src="https://github.com/user-attachments/assets/7802827a-29e6-46a9-90ee-2c978bc1aa22"\>

[Previous page](https://contributors.scala-lang.org/t/coverage-broken-why-does-nobody-care/6262.md?page=2)
