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

Modifications in the projectController.js file to enhance robustness, readability and maintainability. #98

Open
ritankarsaha opened this issue Nov 3, 2024 · 1 comment
Assignees

Comments

@ritankarsaha
Copy link

There are a few improvements that could enhance performance, readability, and error handling:

-Reduce Rate Limiting Risk: Using GitHub's API for each repository’s pull requests might hit rate limits quickly, especially for organizations with many repositories. Considering to limit the repositories to only active ones or reducing data pulled in each call.

-Use Promise.allSettled for Robustness: Promise.all stops processing if any request fails. Using Promise.allSettled allows the process to continue even if some requests fail.

-Extract Authorization Headers: Moving the headers to a constant helps prevent duplication.

-Add Fallback Values: For fields that may be absent in the API response, add default values to avoid undefined errors.

-Optimize map Function: Avoiding to return unnecessary data by only fetching specific properties of the repositories and PRs that you need.

@ritankarsaha
Copy link
Author

Please assign this issue to me. I have fixed this issue and also opened a PR #99 for the same. Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant