Skip to content

Commit ad618e0

Browse files
committed
📚 cite the calculation
1 parent bf16bf7 commit ad618e0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/CloverParser.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
use SimpleXMLElement;
66

7+
/**
8+
* Calculation reference https://confluence.atlassian.com/pages/viewpage.action?pageId=79986990
9+
* So in order to calculate the Total Percentage Coverage metric using data from an XML report
10+
* you have to use the following equation:
11+
*
12+
* TPC = (coveredconditionals + coveredstatements + coveredmethods) / (conditionals + statements + methods)
13+
*
14+
* Using elements is incorrect as according to that page notes, "elements" is conditionals + statements,
15+
* which means including them in the calculation would double-count statements.
16+
*/
717
class CloverParser
818
{
919
/** @var array<string> */

0 commit comments

Comments
 (0)