Fix calculateWeeklyTrend bug by averaging sums (#1215)#1673
Conversation
|
@bhavyapandiya29 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
There was a problem hiding this comment.
Thanks for your first PR on DevTrack! 🎉
A maintainer will review it within 48 hours. While you wait:
- Make sure CI is passing (type-check + lint)
- Double-check the PR description is filled out and the issue is linked
- Feel free to ask questions in Discussions if you need help
If you find DevTrack useful, a ⭐ star on the repo is always appreciated — it helps the project grow and attract more contributors!
|
Hi @Priyanshu-byte-coder I have made a PR for this issue. Kindly review and merge it. |
38246ed
into
Priyanshu-byte-coder:main
|
🎉 Merged! Thanks for contributing to DevTrack. If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers. Keep an eye on open issues for your next contribution! |
Description
This PR resolves the math/logic error in the
calculateWeeklyTrendfunction withinsrc/lib/coding-activity-insights.ts. Previously, the function compared the raw sums of a 4-day period against a 3-day period, incorrectly resulting in an "up" trend for perfectly stable activity. The sums are now correctly divided by the number of days to yield a daily average before performing the trend comparison.Fixes #1215.