Skip to content

Conversation

@lightning-sagar
Copy link

Description

This PR addresses all SonarCloud-reported issues. Changes include:

  • updates: Made public static fields readonly in src/apps/cli/commands/config/auth/add.ts fix: make static properties readonly to resolve SonarCloud issue S1444 #1883

  • Node built-in module imports: Use 'node:' prefix for built-in modules

  • Nullish coalescing operator: Replace if-assignment with ??=

  • wildcardToRegex improvements: Use String#replaceAll() and String.raw

  • GitHub URL handling and 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

Related issue(s)
This Issue is related to #1881

- use 'node:' prefix for built-in modules
- replace if-assignment with nullish coalescing (??=)
- use String#replaceAll and String.raw in wildcardToRegex
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
@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

🦋 Changeset detected

Latest commit: 0713671

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

@lightning-sagar lightning-sagar changed the title Fix: fixed all sonar cloud issue fix: fixed all sonar cloud issue Oct 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2025

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-changeset to the PR or remove the changeset and change PR title to something other than fix: or feat:.

@lightning-sagar
Copy link
Author

Hey, @AayushSaini101 when you have some time, please check the PR. Thanks!

@lightning-sagar
Copy link
Author

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!

@sonarqubecloud
Copy link

@lightning-sagar
Copy link
Author

Ready for review now...
Apologies for the multiple commits, had to resolve a few Sonar issues along the way..
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant