fix: fixed all sonar cloud issue
Description
This PR addresses all SonarCloud-reported issues. Changes include:
-
[x] updates: Made public static fields
readonlyinsrc/apps/cli/commands/config/auth/add.ts#1883 -
[x] Node built-in module imports: Use
'node:'prefix for built-in modules -
[x] Nullish coalescing operator: Replace
if-assignment with??= -
[x]
wildcardToRegeximprovements: UseString#replaceAll()andString.raw -
[x] GitHub URL handling and HTTP resolver:
- Use
RegExp.exec()instead ofString.match()inconvertGitHubWebUrl - Remove unnecessary
try/catchfromisValidGitHubBlobUrl - Refactor
readfunction in HTTP resolver to reduce cognitive complexity from 16 to 15
- Use
Related issue(s) This Issue is related to #1881
🦋 Changeset detected
Latest commit: 0713671cecd4d828dd0d7b7aea4f180e6dc91c83
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @asyncapi/cli | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Changeset has been generated for this PR as part of auto-changeset workflow.
Please review the changeset before merging the PR.
---
'@asyncapi/cli': patch
---
fix: fixed all sonar cloud issue
- aa5ccef: fix(config):
- use 'node:' prefix for built-in modules
- replace if-assignment with nullish coalescing (??=)
- use String#replaceAll and String.raw in wildcardToRegex
- eb7394e: refactor: improve GitHub URL handling and simplify HTTP resolver
Use RegExp.exec() instead of String.match() in convertGitHubWebUrl
Remove unnecessary try/catch from isValidGitHubBlobUrl
Refactor read function in HTTP resolver to reduce cognitive complexity from 16 to 15
- 35b917d: Refactor URL conversion to use RegExp.exec() instead of match()
- 05be198: chore: updated the validation.service.ts
- 2bd1f07: fix: address Sonar S7780 by replacing manual escaping with String.raw
- b9cf80a: chore: pull the changes
- ba5f736: replaceAll rule in wildcardToRegex function
- c3b7224: fix(config): replace unsafe regex literal with safe escapePattern to satisfy Sonar rule S7780
- 538dea1: replaceAll rule in wildcardToRegex function
chore: add changeset for PR #1884
fix(config): replace unsafe regex literal with safe escapePattern to satisfy Sonar rule S7780
- 0fe8c37: fix(config): replace unsafe regex literal with safe escapePattern to satisfy Sonar rule S7780
- b5ee095: chore: pulling from master
If you are a maintainer or the author of the PR, you can change the changeset by clicking here
[!TIP] If you don't want auto-changeset to run on this PR, you can add the label
skip-changesetto the PR or remove the changeset and change PR title to something other thanfix:orfeat:.
Hey, @AayushSaini101 when you have some time, please check the PR. Thanks!
Hey @Shurtu-gal , @AayushSaini101 just wanted to follow up on this PR.... I opened it earlier for fixing all the SonarCloud reported issues, and it looks like a newer PR (#1887) overlaps with the same fixes.... could you guys please take a quick look at this one when you get a chance? thanks!
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Ready for review now... Apologies for the multiple commits, had to resolve a few Sonar issues along the way.. Thanks!