refactor: reduce cognitive complexity in createHttpWithAuthResolver#1957
refactor: reduce cognitive complexity in createHttpWithAuthResolver#1957asyncapi-bot merged 3 commits intoasyncapi:masterfrom
Conversation
|
There was a problem hiding this comment.
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.
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