Repository navigation
Let class-level lines decide a file's lines - #76
Conversation
istanbul (Jest, Vitest) lists each function's declaration line under <methods>, and that line is often not part of its own line coverage, the class-level <lines>. DotCov counted those declaration lines as file lines, so its line totals ran above the tool's own: on the typescript-sdk packages by up to 779 lines per report. Lines under <methods> now count toward the file only when the class has no class-level <lines>; they still feed the method data. Coverlet repeats its method lines in the class summary, so its totals do not change. On all ten typescript-sdk Vitest reports, DotCov's line totals now equal Vitest's. Branch totals can stay lower, because the writer attaches branches only to statement lines; the README says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec0bc11f43
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| while (sub.Read()) | ||
| context.Visit(sub); | ||
| context.Complete(); |
There was a problem hiding this comment.
Finalize method-only classes on the async path
When a report contains a class whose coverage exists only under <method><lines>—the fallback this change explicitly supports—ParseAsync buffers those records in _methodLines but never invokes context.Complete() after its class loop, unlike this synchronous path. The async report therefore materializes the file with zero lines and branches rather than its method coverage; invoke Complete() from the async class case as well and cover that entrypoint.
Useful? React with 👍 / 👎.
Set 2.0.0 as the package version, the badge action's default and the README's action snippet and release-notes link, and add docs/releases/2.0.0.md. The major version marks that the same report can now count differently: istanbul line totals and coverage.py multi-root paths (#74, #76). The README's migration section now covers 1.x and points 0.x users to the 1.0 notes. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Count a file's lines from the class-level
<lines>when a class has them, so istanbul's function-declaration lines stop inflating line totals.Problem
istanbul (the Cobertura writer behind Jest and Vitest) lists each function's declaration line under
<methods>. That line is often not part of its own line coverage, the class-level<lines>. DotCov counted it as a file line, so line totals ran above the tool's own.On the ten typescript-sdk Vitest reports, all 10 disagreed before this change, by up to 823 lines. For example, server: Vitest 3170/6194 lines, DotCov 3473/6973.
What changed
<methods>count toward the file only when the class has no class-level<lines>. They still feed the method data (CRAP).Verification
fallout Test: 1392 passed.fallout Coverage: line 100.0%, branch 100.0%.Not fixable from the report
istanbul attaches branches only to lines that hold statements. Branches on other lines exist only in the report's header totals, so DotCov's branch count can stay lower (server: Vitest 4234, DotCov 3850). The README now says so.
🤖 Generated with Claude Code