-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix(coverage): a line with two ERROR nodes reports the same range twice #1965
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edgesGraph extraction bugs, false positives, missing edgespriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.windowsWindows-specific issuesWindows-specific issues
Description
Activity
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edgesGraph extraction bugs, false positives, missing edgespriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.windowsWindows-specific issuesWindows-specific issues
scripts/setup-windows.ps1has 326 lines. Its parse-coverage report reads:Line 113 is named twice. Found while building the CI coverage gate in #1941; not fixed there.
What happens
Line 113 carries two separate ERROR nodes, at columns 25-29 and 31-32.
cbm_error_regions_pushpushes a range for each one. A line range is advice — "read these lines" — and saying it a second time adds nothing.Why it matters beyond the noise
Both copies count against
CBM_MAX_ERROR_REGIONS. A file with many multi-error lines can therefore be clipped, and report,+<N>, while carrying fewer distinct lines than the cap allows.Suggested fix
Merge a region that overlaps the range already open instead of appending a repeat. The walk visits children in source order, so a region that starts at or before the open range's end really does overlap it. The merge has to run before the cap check, or a merged region is miscounted as a dropped one.
Related: #963, #1941. Sibling finding: the past-EOF end line in the same range string.