Skip to content

Feat/structural metrics v2 + DROP PHP8.0 support#467

Open
KminekMatej wants to merge 18 commits intonette:masterfrom
KminekMatej:feat/structural-metrics-v2
Open

Feat/structural metrics v2 + DROP PHP8.0 support#467
KminekMatej wants to merge 18 commits intonette:masterfrom
KminekMatej:feat/structural-metrics-v2

Conversation

@KminekMatej
Copy link
Contributor

This PR created as a replacement of #464 - to avoid complicated rebase process

bug fix #463 #463
BC break? no
doc PR: Not neccessary
In my project I had to manually count code coverage for further reporting. To avoid parsing the code coverage from standard HTML report I wanted to use machine-ready structure so I checked Clover XML output. I expected by dividing project->metric->coveredStatements / project->metric->statements to reach the same percents as HTML output has, but surprisingly the number was quite different.

During diving into the used algorithm I found out that Clover XML report does not take into account lines which are actually present in the file outside the class / trait scope. Even with a small todo mentioned in comments that it needs to be finished. So I tried to finish it.

During analyzation of the code, there is new function which counts the stats of the lines outside classes / traits and adds these stats into project metrics.

I believe this is smoething to be primarily checked by @milo , who (according to git blame) wrote most of the XML coverage code (big kudos 💪 ).

This PR does not fix the entire percent count completely, as the goal is to count fomr this report same percentil as is reported in the CLI Tester after the tests, but it gets it one step closer to the end.

@KminekMatej KminekMatej marked this pull request as draft February 20, 2026 15:27
@KminekMatej KminekMatej mentioned this pull request Feb 20, 2026
@KminekMatej KminekMatej marked this pull request as ready for review February 22, 2026 14:10
@KminekMatej
Copy link
Contributor Author

Additional pipeline fixes:

  • PHPDBG does not separate stderr to its own output and outputs it directly to stdout. Had to align/skip some tests due to this behaviour
  • PHPDBG does not execute register_shutdown_function, which makes testing outputcode on die() untestable (always returns zero) - found no possible way to override it yo the edge tests are being skipped for PHPDBG
  • Dropped support for PHP8.0, due to dropped support in nette/phpstan-rules

@KminekMatej KminekMatej changed the title Feat/structural metrics v2 Feat/structural metrics v2 + DROP PHP8.0 support Feb 22, 2026
@dg dg force-pushed the master branch 4 times, most recently from 6ba014e to 10a41e7 Compare February 25, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Work with lines outside class/struct in Clover XML report

2 participants