Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | private function getCoverage($inputFile) |
||
48 | { |
||
49 | $xml = new SimpleXMLElement(file_get_contents($inputFile)); |
||
50 | $metrics = $xml->xpath('//metrics'); |
||
51 | $totalElements = 0; |
||
52 | $checkedElements = 0; |
||
53 | |||
54 | foreach ($metrics as $metric) { |
||
55 | $totalElements += (int)$metric['elements']; |
||
56 | $checkedElements += (int)$metric['coveredelements']; |
||
57 | } |
||
58 | |||
59 | return round(($checkedElements / $totalElements) * 100, 2); |
||
60 | } |
||
61 | } |