-
-
Notifications
You must be signed in to change notification settings - Fork 73
Structural metrics #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KminekMatej
wants to merge
22
commits into
nette:master
Choose a base branch
from
KminekMatej:structural-metrics
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Structural metrics #464
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHP 8.5 deprecated using null as an array offset. When running `-o console` without a filename, $file was null and used as array key in $outputFiles[$file], triggering E_DEPRECATED which the strict error handler converted to a fatal error. Changed the default from null to empty string '' and updated the corresponding null checks to check for empty string instead.
These lines are correctly represented by <line> xml tag, but should be counted amongst the coverage/project/metrics, affecting statements / coveredStatements metrics
…ch affects project metrics
Contributor
Author
|
Checks are failing on issues clearly independent to my updates. HTTPAssertTest is getting improper response from httpbin, often its just 502 HTTP response code. Checks related to PHPDBG are failing on weird issues, but looking into history these issues sometimes occurs even on @dg or @JanTvrdik commits. I dont think fixing these checks should be part of this PR, am I right? |
These lines are correctly represented by <line> xml tag, but should be counted amongst the coverage/project/metrics, affecting statements / coveredStatements metrics
…ch affects project metrics
0f7d4b3 to
bc7d56b
Compare
2c855ca to
0bc552e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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->statementsto 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.