Skip to content

Commit 8e4af5f

Browse files
committed
Remove method calculation in coverage metrics
This commit simplifies the coverage metrics calculation by eliminating the counting of method-specific metrics. The focus is now solely on conditionals and statements, ensuring more streamlined and potentially faster processing.
1 parent 2d01b74 commit 8e4af5f

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)