Skip to content
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

In clover.xml, count all method definitions once #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 26, 2024

  1. In clover.xml, count all method definitions once

    [The `clover.xml` specification] does not answer what a `count` means for
    a line with `type="method"`.
    
    In the case of PHP's CodeCoverage library, it is set to [the maximum
    count] for any statement within the method.
    
    Therefore, even if a file is parsed and run (so the method is defined),
    if the method is never called then it will have a count of `0`. This
    differs from how other PHP tools display `"method"` lines, which instead
    treat them as run.
    
    So, treat all methods as if they have a count of `1`.
    
    [The `clover.xml` specification]: https://bitbucket.org/atlassian/clover/src/master/etc/schema/clover.xsd
    [the maximum count]: https://github.com/sebastianbergmann/php-code-coverage/blob/main/src/Report/Clover.php#L89-L104
    mike-burns committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    391ecb6 View commit details
    Browse the repository at this point in the history