Skip to content
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

Improve db util regular expression #2859

Open
jsumners-nr opened this issue Jan 3, 2025 · 1 comment
Open

Improve db util regular expression #2859

jsumners-nr opened this issue Jan 3, 2025 · 1 comment

Comments

@jsumners-nr
Copy link
Contributor

// Suppressing a warning on this regex because it is not obvious what this
// regex does, and we don't want to break anything.
// eslint-disable-next-line sonarjs/slow-regex, sonarjs/duplicates-in-character-class
const match = /^\s*use[^\w`]+([\w$_\u0080-\uFFFF]+|`[^`]+`)[\s;]*$/i.exec(sql)
return (match && match[1]) || null

This regular expression is triggering sonar-js's "slow regex" rule. We need to investigate what the regular expression does, and see if we can improve it.

@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage Needed: Unprioritized Features
Development

No branches or pull requests

1 participant