Skip to content

Commit

Permalink
Issue #4: points for CCed people. 0.1 per person, total rounded down …
Browse files Browse the repository at this point in the history
…with floor()
  • Loading branch information
pascalchevrel committed Mar 7, 2023
1 parent 989a484 commit c87e5c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pchevrel/BzKarma/Scoring.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ class Scoring
'?' => 1,
'---' => 0,
],
'cc' => 0.1, // Decimal point for each cc, we round the total value
];

/*
This array stores the bug data provided by the Bugzilla rest API
The list of fields retrieved are:
id, type, summary, priority, severity, keywords, duplicates, regressions, cf_webcompat_priority,
cf_tracking_firefox_nightly, cf_tracking_firefox_beta, cf_tracking_firefox_release
cf_tracking_firefox_nightly, cf_tracking_firefox_beta, cf_tracking_firefox_release, cc
The fields actually retrieved for tracking requests have release numbers, ex:
cf_tracking_firefox112, cf_tracking_firefox111, cf_tracking_firefox110
Expand Down Expand Up @@ -137,6 +138,7 @@ public function getBugScoreDetails(int $bug): array
'tracking_firefox' . $this->nightly => 0,
'tracking_firefox' . $this->beta => 0,
'tracking_firefox' . $this->release => 0,
'cc' => 0,
];
}

Expand Down Expand Up @@ -179,6 +181,7 @@ public function getBugScoreDetails(int $bug): array
'duplicates' => count($this->bugsData[$bug]['duplicates']) * $this->karma['duplicates'],
'regressions' => count($this->bugsData[$bug]['regressions']) * $this->karma['regressions'],
'webcompat' => $webcompat,
'cc' => (int) floor(count($this->bugsData[$bug]['cc']) * $this->karma['cc']),

/*
If a bug is tracked across all our releases, it is likely higher value.
Expand Down

0 comments on commit c87e5c5

Please sign in to comment.