Skip to content

fix: fixed all sonar cloud issue#1884

Open
lightning-sagar wants to merge 20 commits intoasyncapi:masterfrom
lightning-sagar:fix/fixing-all-sonar-cloud-issue
Open

fix: fixed all sonar cloud issue#1884
lightning-sagar wants to merge 20 commits intoasyncapi:masterfrom
lightning-sagar:fix/fixing-all-sonar-cloud-issue

Conversation

@lightning-sagar
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Author

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

@lightning-sagar
Copy link
Copy Markdown
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
Copy Markdown

@lightning-sagar
Copy link
Copy Markdown
Author

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

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions Bot added the stale label Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant