Skip to content

Fixes 1156 (Issue with scalar literals in code coverage)#1157

Closed
DeveloperRob wants to merge 1 commit intosebastianbergmann:mainfrom
DeveloperRob:fix-scalar-literals-marked-executable
Closed

Fixes 1156 (Issue with scalar literals in code coverage)#1157
DeveloperRob wants to merge 1 commit intosebastianbergmann:mainfrom
DeveloperRob:fix-scalar-literals-marked-executable

Conversation

@DeveloperRob
Copy link
Copy Markdown

This fixes #1156 by updating ExecutableLinesFindingVisitor.php so that where an expression is solely a string literal, float literal, integer literal (PHPParser\Node\Scalar) or null / true / false (PHPParser\Node\Expr\ConstFetch); the node is ignored / not marked as executable.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.32%. Comparing base (c5431e1) to head (195df3c).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1157      +/-   ##
============================================
+ Coverage     82.31%   82.32%   +0.01%     
- Complexity     1562     1565       +3     
============================================
  Files           114      114              
  Lines          5315     5319       +4     
============================================
+ Hits           4375     4379       +4     
  Misses          940      940              

☔ 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
Copy link
Copy Markdown
Owner

Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it as I think 3203ed6 is a "cleaner" solution.

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.

Scalar literals produce incorrect code coverage information

2 participants