Skip to content

Commit

Permalink
report: blend impact and guidance level to sort audits (#15669)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianaixba committed Dec 9, 2023
1 parent a60c73d commit d6340fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions report/renderer/performance-category-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,16 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
if (scoreA !== scoreB) return scoreA - scoreB;

// Overall impact is the estimated improvement to the performance score
if (a.overallImpact !== b.overallImpact) return b.overallImpact - a.overallImpact;
if (a.overallImpact !== b.overallImpact) {
return b.overallImpact * b.guidanceLevel - a.overallImpact * a.guidanceLevel;
}

// Fall back to the linear impact if the normal impact is rounded down to 0
if (
a.overallImpact === 0 && b.overallImpact === 0 &&
a.overallLinearImpact !== b.overallLinearImpact
) {
return b.overallLinearImpact - a.overallLinearImpact;
return b.overallLinearImpact * b.guidanceLevel - a.overallLinearImpact * a.guidanceLevel;
}

// Audits that have no estimated savings should be prioritized by the guidance level
Expand Down

0 comments on commit d6340fa

Please sign in to comment.