Skip to content

Commit 3c14f5d

Browse files
authored
Merge pull request #23 from jonnynews/fix/coverage
Remove method calculation in coverage metrics
2 parents 2d01b74 + 8e4af5f commit 3c14f5d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/BadgeComposer.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,18 @@ private function processFile(string $inputFile): void
116116

117117
$totalConditionals = 0;
118118
$totalStatements = 0;
119-
$totalMethods = 0;
120119
$coveredStatements = 0;
121120
$coveredConditionals = 0;
122-
$coveredMethods = 0;
123121

124122
foreach ($metrics as $metric) {
125123
$totalConditionals += (int) $metric['conditionals'];
126124
$coveredConditionals += (int) $metric['coveredconditionals'];
127125
$totalStatements += (int) $metric['statements'];
128126
$coveredStatements += (int) $metric['coveredstatements'];
129-
$totalMethods += (int) $metric['methods'];
130-
$coveredMethods += (int) $metric['coveredmethods'];
131127
}
132128

133-
$totalElements = $totalConditionals + $totalStatements + $totalMethods;
134-
$coveredElements = $coveredConditionals + $coveredStatements + $coveredMethods;
129+
$totalElements = $totalConditionals + $totalStatements;
130+
$coveredElements = $coveredConditionals + $coveredStatements;
135131
$coverageRatio = $totalElements ? $coveredElements / $totalElements : 0;
136132
$this->totalCoverage[] = (int) round($coverageRatio * 100);
137133

0 commit comments

Comments
 (0)