Skip to content

Commit

Permalink
Styling nits
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalchevrel committed Mar 6, 2023
1 parent 3a3cb36 commit e47f267
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/pchevrel/BzKarma/Scoring.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ class Scoring
*/
public array $bugsData;


/*
We need Firefox release numbers internally, the release train is provided in the constructor.
*/
private string $release;
private string $beta;
private string $nightly;

/**
* We work from a dataset provided by the Bugzilla rest API
/*
We work from a dataset provided by the Bugzilla rest API
*/
public function __construct(array $bugsData, int $release)
{
Expand All @@ -104,8 +106,7 @@ public function getAllBugsScores(): array
$bugs[$bug] = $this->getBugScore($bug);
}

// We sort them in reverse order to list best nugs first
arsort($bugs);
arsort($bugs); // We sort in reverse order to list best bugs first

return $bugs;
}
Expand All @@ -127,9 +128,9 @@ public function getBugScoreDetails(int $bug): array
'duplicates' => 0,
'regressions' => 0,
'webcompat' => 0,
'tracking_firefox'. $this->nightly => 0,
'tracking_firefox'. $this->beta => 0,
'tracking_firefox'. $this->release => 0,
'tracking_firefox' . $this->nightly => 0,
'tracking_firefox' . $this->beta => 0,
'tracking_firefox' . $this->release => 0,
];
}

Expand Down Expand Up @@ -168,16 +169,16 @@ public function getBugScoreDetails(int $bug): array
'priority' => $this->karma['priority'][$this->bugsData[$bug]['priority']] ?? 0,
'severity' => $this->karma['severity'][$this->bugsData[$bug]['severity']] ?? 0,
'keywords' => $keywords_value,
'duplicates' => count($this->bugsData[$bug]['duplicates']) * $this->karma['duplicates'],
'duplicates' => count($this->bugsData[$bug]['duplicates']) * $this->karma['duplicates'],
'regressions' => count($this->bugsData[$bug]['regressions']) * $this->karma['regressions'],
'webcompat' => $webcompat,

/*
If a bug is tracked across all our releases, it is likely higher value
If a bug is tracked across all our releases, it is likely higher value.
*/
'tracking_firefox'. $this->nightly => $nightly,
'tracking_firefox'. $this->beta => $beta,
'tracking_firefox'. $this->release => $release,
'tracking_firefox' . $this->nightly => $nightly,
'tracking_firefox' . $this->beta => $beta,
'tracking_firefox' . $this->release => $release,
];

return $impact;
Expand All @@ -186,7 +187,4 @@ public function getBugScoreDetails(int $bug): array
public function getBugScore(int $bug): int {
return array_sum($this->getBugScoreDetails($bug));
}
}



}

0 comments on commit e47f267

Please sign in to comment.