Skip to content

Commit

Permalink
Merge pull request #22 from codebtech/feat/fix-coverage-calculation
Browse files Browse the repository at this point in the history
fix: coverage logic
  • Loading branch information
m0hanraj authored Jul 11, 2024
2 parents 9e2ac7a + 4bd51d0 commit 2d01b74
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/BadgeComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ private function processFile(string $inputFile): void
$coveredMethods = 0;

foreach ($metrics as $metric) {
$totalConditionals = (int) $metric['conditionals'];
$coveredConditionals = (int) $metric['coveredconditionals'];
$totalStatements = (int) $metric['statements'];
$coveredStatements = (int) $metric['coveredstatements'];
$totalMethods = (int) $metric['methods'];
$coveredMethods = (int) $metric['coveredmethods'];
$totalConditionals += (int) $metric['conditionals'];
$coveredConditionals += (int) $metric['coveredconditionals'];
$totalStatements += (int) $metric['statements'];
$coveredStatements += (int) $metric['coveredstatements'];
$totalMethods += (int) $metric['methods'];
$coveredMethods += (int) $metric['coveredmethods'];
}

$totalElements = $totalConditionals + $totalStatements + $totalMethods;
Expand Down

0 comments on commit 2d01b74

Please sign in to comment.