-
-
Notifications
You must be signed in to change notification settings - Fork 298
refactor: reduce cognitive complexity in createHttpWithAuthResolver #1957
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
|
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.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
|
Hi @Shurtu-gal sir, @AayushSaini101 sir, |
|
/u |
|
/u |
|
AayushSaini101
left a comment
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.
LGTM thanks for the contributions, keep it up : )
|
/rtm |
…refs This commit implements two major features addressing community requests: 1. Per-Command Config Defaults (asyncapi#1914) - Allows users to set default flags for commands - Eliminates repetitive flag typing - Commands: config:defaults:set, config:defaults:list, config:defaults:remove - Automatic flag resolution with proper precedence 2. Authentication Commands for Private $refs (asyncapi#1796) - Completes auth resolver implementation from PR asyncapi#1957 - Provides CLI commands to manage authentication - Commands: config:auth:list, config:auth:remove, config:auth:test - Secure token resolution from environment variables Implementation details: - Modified: config.service.ts, base.ts - Created: 6 command files, 4 test suites - Test coverage: 98.03% on ConfigService - Zero breaking changes - fully backward compatible Fixes asyncapi#1914 Related to asyncapi#1796



fixes: #1881
Description
Refactored
createHttpWithAuthResolverfunction to reduce cognitive complexity from 16 to below 15, addressing SonarCloud linting issues.Changes
fetchWithErrorHandlinghelper function to consolidate repeated fetch error handling logicfetchGitHubApiContenthelper function to handle GitHub API-specific logicreadfunction by removing nested conditionals and using early returnsBenefits
Testing