Skip to content

Files coverage computation error #3787

@sjoubert

Description

@sjoubert

Bug report

Looking at the my file coverage percentage and comparing it to the actual individual file coverage I believe the result does not reflect the reality. At least not my interpretation of "a file is covered".

  • Empty files should be considered covered: 0 / 0 correctly gives 100% file coverage but seem to count as an uncovered file
  • Non-empty zero-coverage files should be considered uncovered: 0 / N correctly gives a 0% file coverage but seems to count as a covered file

Relevant logic seems to be here:

totalFilesCovered() {
return this.coverage?.reduce((total, edge) => total + (edge.node.linesOfCodeTested + edge.node.linesOfCodeUntested > 0 ? 1 : 0), 0) ?? 0;
},
totalFilesUncovered() {
return this.coverage?.reduce((total, edge) => total + (edge.node.linesOfCodeTested + edge.node.linesOfCodeUntested === 0 ? 1 : 0), 0) ?? 0;
},

CDash Version

v5.0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions