-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: stargazer type can be null #68
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
Conversation
|
Warning Rate limit exceeded@ArjinAlbay has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 35 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/lib/api/github-graphql-client.ts (3)
172-172: Make the filter robust and clearer using nullish coalescing.Avoid relying on truthiness of numbers; compare against a numeric fallback. Also removes duplicate property access.
- .filter(issue => issue.repository?.stargazerCount && issue.repository.stargazerCount >= 5) + .filter(issue => (issue.repository?.stargazerCount ?? 0) >= 5)Optional: extract 5 to a shared constant to avoid duplication across methods.
262-262: Same robustness/readability improvement for the star threshold filter.- .filter(issue => issue.repository?.stargazerCount && issue.repository.stargazerCount >= 5) + .filter(issue => (issue.repository?.stargazerCount ?? 0) >= 5)
282-282: Prefer nullish coalescing (and optional chain) for defaulting.Use ?? so 0 is preserved intentionally, and guard repository defensively to match the earlier optional chain usage.
- stars: issue.repository.stargazerCount || 0, + stars: issue.repository?.stargazerCount ?? 0,
…ile return type in GitHubAPIClient
Summary by CodeRabbit
Bug Fixes
Refactor