fix: use String#replaceAll() over replace() with global flag (S7781)#447
Merged
fix: use String#replaceAll() over replace() with global flag (S7781)#447
Conversation
…S7781) Apply SonarCloud S7781 rule: prefer .replaceAll() over .replace() when using regex with the global flag. Converted simple literal patterns and regex patterns that do not use capture groups. Changes: - CSV parser: escape special characters - Search: FTS query double-quote escaping - Spider/URL fetcher: directory suffix handling - Webhooks: IPv6 bracket stripping - Packs: glob pattern escaping - Parsers: HTML and EPUB cleanup - Connectors: OneNote, Slack, Obsidian replacements - Tests: string manipulation patterns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Readable.push() does not accept multiple arguments like Array.push(). The null signals end-of-stream and must be a separate call, otherwise the stream never ends and API tests hang with timeouts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Apply SonarCloud S7781 rule: prefer
String#replaceAll()overString#replace()when using regex with the global flag.This refactoring improves code clarity by using the purpose-built
replaceAll()method instead ofreplace()with/gpatterns.Changes
Converted 23 instances across the codebase:
Test Plan
🤖 Generated with Claude Code