Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report: blend impact and guidance level to sort audits #15669

Merged
merged 2 commits into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading