-
Notifications
You must be signed in to change notification settings - Fork 5
Perf query cell #762
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
base: main
Are you sure you want to change the base?
Perf query cell #762
Conversation
xuewenjie123
commented
May 19, 2025
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
// 关系箭头指向错误 | ||
{ | ||
wrong: /-->/g, |
Check failure
Code scanning / CodeQL
Bad HTML filtering regexp High
Copilot Autofix
AI 4 months ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
|
||
// 未关闭括号 | ||
{ | ||
wrong: /\((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*$/, |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 months ago
To fix the issue, we need to rewrite the regular expression to eliminate the ambiguity that causes exponential backtracking. Specifically, we can replace the ambiguous [^)(]+
with a more precise sub-expression that avoids overlapping matches. Additionally, we can use a more structured approach to match nested parentheses, such as leveraging a library like xregexp
for recursive patterns if necessary.
In this case, we will rewrite the regex to use a non-ambiguous pattern for matching nested parentheses. The updated regex will ensure linear time complexity while preserving the original functionality.
-
Copy modified line R190
@@ -189,3 +189,3 @@ | ||
{ | ||
wrong: /\((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*$/, | ||
wrong: /\((?:[^)(]*\((?:[^)(]*\([^)(]*\))*[^)(]*\))*[^)(]*$/, | ||
correct: (match: string) => `${match})`, |
|
||
// 未关闭括号 | ||
{ | ||
wrong: /\((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*$/, |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
Copilot Autofix
AI 4 months ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.