sbt / sbt-jacoco

an sbt plugin for JaCoCo Code Coverage
https://scala-sbt.org/sbt-jacoco/
Eclipse Public License 1.0
123 stars 67 forks source link

Synthetic methods are not being accounted correctly. #294

Open BillyBQ opened 9 months ago

BillyBQ commented 9 months ago

Hi sbt-jacoco Development Team,

The following two issues were discovered recently while investigating the coverage report of our product.

  1. On 04/19/2019 there was a commit "Upgrade to jacoco 0.8.2 (#119)" that was later released with tag v3.2.0. In this commit FilteringClassAnalyzer stopped updating field coverages, which causes com.github.sbt.jacoco.filter.ScalaSyntheticMethod#isSyntheticMethod not being called and synthetic method as a result not ignored from the coverage calculation.

  2. productElementName and productElementNames (from scala.Product) should be added to the list of method names in com.github.sbt.jacoco.filter.ScalaSyntheticMethod#isCaseInstanceMethod so that they can be ignored from coverage calculation as synthetic methods.

Please kindly look into the issues and release a fix if possible.

Thanks,

Billy