# Kover exclude: classes, packages and generated code > Kover filters take class names like shop.dto.*, not paths. Exclude packages, classes, top-level Kt files and @Generated code, measured with Kover 0.9.11. Web page: https://supercov.com/blog/kover-exclude · Published 2026-11-22 All Supercov pages for agents: https://supercov.com/llms.txt · Full text: https://supercov.com/llms-full.txt The filters that work in Kover 0.9.11, and why shop/dto/** and ShopApplication match nothing. Kover filters take class names with dots, not file paths: `shop.dto.*`, not `shop/dto/**`. A Kotlin file of top-level functions compiles to a class named after the file plus `Kt`, so exclude `shop.ShopApplicationKt`. ## Exclude patterns at a glance | To exclude | Write in `kover { reports { filters { excludes { … } } } }` | | --- | --- | | A package | `packages("shop.dto")` | | Classes by name | `classes("shop.dto.*")` | | A file of top-level functions | `classes("shop.ShopApplicationKt")` | | Classes or functions with an annotation | `annotatedBy("*Generated")` | `*` matches any characters and `?` one. The same filters apply to `koverVerify`, so the report and the rule agree. We ran every setup here with Kover 0.9.11, Kotlin 2.4.21 and Gradle 9.7.1 on JDK 21. The project has five classes: `Pricing` and `Receipt` have tests; a DTO package, a generated package and the `main` file have none. Without filters, the report has 8 of 16 lines. ## Exclude packages and classes ```kotlin kover { reports { filters { excludes { packages("shop.dto", "shop.generated") classes("shop.ShopApplicationKt") } } } } ``` `packages("shop.dto", "shop.generated")` alone left three classes, 7 of 11 lines. `classes("shop.dto.*", "shop.ShopApplicationKt")` left three as well, 8 of 11: `Pricing`, `Receipt` and the generated `MoneyKt`. ![A diagram mapping source files to the classes Kover matches: Pricing.kt to shop.Pricing, dto/OrderDto.kt to shop.dto.OrderDto, ShopApplication.kt to shop.ShopApplicationKt and generated/Money.kt to shop.generated.MoneyKt.](https://supercov.com/assets/kover-exclude-flow-1360.b8ccf7d13d.webp) *Kover matches compiled class names. Top-level functions live in a class named after the file plus Kt.* ## Exclude generated code with an annotation ```kotlin annotation class Generated @Generated fun debugDump(value: Any): String { val text = value.toString() return text } ``` ```kotlin kover { reports { filters { excludes { annotatedBy("*Generated") } } } } ``` `Receipt` went from 2 of 4 lines to 2 of 2. `annotatedBy("shop.Generated")` did the same. Kover reads the annotation from the compiled class: with `@Retention(AnnotationRetention.SOURCE)` the function stayed, at 2 of 4 lines. Kotlin's default retention, `RUNTIME`, works. ## Why your Kover exclude isn't working | What we tried | What happened | | --- | --- | | `classes("shop/dto/**", "shop/ShopApplication*.class")` | Nothing excluded: Kover matches class names, not paths | | `classes("shop.ShopApplication")` for `ShopApplication.kt` | The `main` class stayed: it is `shop.ShopApplicationKt` | | `koverVerify` with `minBound(80)` and no filters | Failed at 50% | | The same rule with the filters above | Failed at 77.8%: the filters apply to verify too | ![A grid of six filters against five classes. No filters keeps all five, 8 of 16 lines. classes with shop.dto.* and the Kt class leaves Pricing, Receipt and MoneyKt, 8 of 11. packages leaves Pricing, Receipt and the Kt class, 7 of 11. Path patterns keep all five. shop.ShopApplication misses the Kt class. annotatedBy keeps every class and drops one method.](https://supercov.com/assets/kover-exclude-grid-1360.793318e497.webp) *What each filter left in the report, measured with Kover 0.9.11.* If you came from JaCoCo, this is the opposite convention: JaCoCo excludes take `shop/dto/**`, Kover `shop.dto.*`. See [JaCoCo exclude](https://supercov.com/blog/jacoco-exclude.md). ## What Supercov adds ```sh supercov -- ./gradlew test supercov runs latest gaps ``` Supercov runs the same Gradle build and records which test covered each line, with branches and MC/DC, without Kover in the build. On this project it showed that no test tried a large order from a non-member. See [Kotlin code coverage](https://supercov.com/compare/kotlin-code-coverage.md) for Kover, JaCoCo and Supercov side by side.