Skip to content

Work with lines outside class/struct in Clover XML report #463

@KminekMatej

Description

@KminekMatej

Version: 2.5.7

Bug Description

CodeCoverage generator, when specifying Clover XML as output natively does not work with lines outside class / struct definition at project metrics level.

Steps To Reproduce

Run local tests of this project. Tested file tests/CodeCoverage/fixtures.clover/Logger.php has two lines outside the class scope:

$logger = new Logger('php://stdout');  # 1
$logger->log('foo');  # 1

These lines has been tested and reported by xdebug as covered, but statementsCount metric did not count them:

statements: 5
coveredStatements: 3

Expected Behavior

statements: 7
coveredStatements: 5

Possible Solution

PR In the comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions