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

fix(utils): handle rounding of small trend values #813

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

hanna-skryl
Copy link
Collaborator

Fixes #804

This PR replaces Math.round() with the custom roundValue function to handle rounding of score and value changes.

Previously, scores could be floats rounded to one decimal place, while values were always rounded to whole numbers. With the new roundValue function, both scores and values are now consistently rounded to their first decimal, ensuring uniform and accurate rounding throughout.

@hanna-skryl hanna-skryl self-assigned this Sep 11, 2024
@github-actions github-actions bot added the 📖 Project documentation improvements or additions to the project documentation label Sep 11, 2024
Copy link

github-actions bot commented Sep 11, 2024

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit b20e518 with source commit 3dde651.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 54 🟡 53 ↓ −1.2
Code coverage 🟡 90 🟡 90 ↑ +0.1
Custom checks 🟡 67 🟡 67
Security 🟡 84 🟡 84
Updates 🟡 78 🟡 78
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 99 🟢 99
👍 1 group improved, 👎 1 group regressed, 👍 3 audits improved, 👎 4 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 54 🟡 53 ↓ −1.2
Code coverage Code coverage metrics 🟡 90 🟡 90 ↑ +0.1

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Speed Index 🟥 5.9 s 🟥 6.4 s ↑ +9.4 %
Lighthouse First Contentful Paint 🟨 2.9 s 🟥 3.1 s ↑ +4.9 %
Lighthouse First Meaningful Paint 🟨 2.9 s 🟨 3.1 s ↑ +4.9 %
Lighthouse Time to Interactive 🟥 14.5 s 🟥 16.6 s ↑ +14.7 %
Code coverage Branch coverage 🟨 84.7 % 🟨 84.7 % ↑ +0.1 %
Code coverage Function coverage 🟩 92.1 % 🟩 92.1 % ↑ +0.1 %
Code coverage Line coverage 🟩 91.9 % 🟩 91.9 % ↑ +0.1 %
Lighthouse Minimizes main-thread work 🟥 15.0 s 🟥 19.9 s ↑ +32.9 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,835 KiB 🟩 Total size was 1,838 KiB ↑ +0.2 %
Lighthouse JavaScript execution time 🟥 6.9 s 🟥 9.3 s ↑ +33.2 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +14.7 %
Lighthouse Total Blocking Time 🟥 4,600 ms 🟥 6,670 ms ↑ +45.1 %
Lighthouse Uses efficient cache policy on static assets 🟨 27 resources found 🟨 27 resources found ↓ −0.1 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 1,200 ms 🟥 Potential savings of 620 ms ↓ −48.4 %
Lighthouse Max Potential First Input Delay 🟥 2,470 ms 🟥 2,820 ms ↑ +13.9 %
Lighthouse Initial server response time was short 🟩 Root document took 440 ms 🟩 Root document took 510 ms ↑ +17.4 %
Lighthouse Server Backend Latencies 🟩 200 ms 🟩 250 ms ↑ +23.1 %
Lighthouse Network Round Trip Times 🟩 80 ms 🟩 60 ms ↓ −20.5 %
Lighthouse Largest Contentful Paint 🟨 3.1 s 🟨 3.1 s ↓ −0.5 %

494 other audits are unchanged.

matejchalk
matejchalk previously approved these changes Sep 12, 2024
@hanna-skryl hanna-skryl merged commit c23e38e into main Sep 12, 2024
17 checks passed
@hanna-skryl hanna-skryl deleted the fix/report-diff-near-zero-values branch September 12, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent displaying ±0 changes in report-diff.md
2 participants