Skip to content

Improve branch and path coverage presentation in HTML report#1141

Draft
sebastianbergmann wants to merge 5 commits intomainfrom
feature/branch-path-coverage-improvements
Draft

Improve branch and path coverage presentation in HTML report#1141
sebastianbergmann wants to merge 5 commits intomainfrom
feature/branch-path-coverage-improvements

Conversation

@sebastianbergmann
Copy link
Copy Markdown
Owner

This intends to make the branch and path coverage views in the HTML code coverage report significantly easier to read and act on.

Source view gutter column

All three source views (line, branch, path) now include a narrow gutter column between the line number and the source code.

In the branch view, this column displays the direction indicators described above. In the line and path views, the column is present but hidden to keep the layout consistent across view tabs.

Inline branch direction indicators

The branch coverage source view now shows colored markers in the gutter at decision-point lines (lines where code can take multiple directions, such as if / else expressions). Each marker represents one branch direction: green for covered, red for uncovered.

Coverage badges on method headings

Each method heading in the branch and path structure sections now shows a coverage badge color-coded green, yellow, or red. This provides a quick at-a-glance summary of how well each method's branches or paths are covered, without needing to scan through the full table.

Path rendering no longer refuses to render

Previously, methods with more than 100 code paths showed only a message saying "too many paths to sensibly render." Now the full path table is always rendered. For methods with many paths, the table is wrapped in a collapsible section (collapsed by default) so the page remains navigable while still providing access to all the data.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 96.66667% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.97%. Comparing base (d92877a) to head (59f5c88).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Report/Html/ControlFlowGraph.php 94.95% 6 Missing ⚠️
src/Report/Html/Renderer/File.php 97.77% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1141      +/-   ##
============================================
+ Coverage     96.91%   96.97%   +0.05%     
- Complexity     1478     1529      +51     
============================================
  Files           109      110       +1     
  Lines          5020     5218     +198     
============================================
+ Hits           4865     5060     +195     
- Misses          155      158       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from 7d46249 to 50f1729 Compare March 14, 2026 09:56
@sebastianbergmann
Copy link
Copy Markdown
Owner Author

Both #1140 and this have the same ancestor, but #1140 is the bigger change and should be merged first, in case both #1140 and this will be merged.

@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from 50f1729 to 911a937 Compare March 17, 2026 09:42
@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from 911a937 to 4107924 Compare March 25, 2026 07:57
@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from 4107924 to 59f5c88 Compare March 25, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant