fix: S7735 — flip negated conditions (31 occurrences)#445
Merged
Conversation
Flip if (!x) { A } else { B } to if (x) { B } else { A } for readability.
Fixes 31 SonarCloud S7735 violations across:
- src/core/bulk.ts (3 functions: bulkDelete, bulkRetag, bulkMove)
- src/web/server.ts (error handler)
- src/connectors/index.ts (ensureConnectorsDir)
- src/core/topics.ts (listTopics)
- tests/unit/config.test.ts (multiple test cleanup blocks)
- tests/unit/api.test.ts (createMockReq)
- tests/unit/workspace.test.ts (afterEach)
- tests/fixtures/helpers.ts (withEnvVars)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
- slack.ts: .replaceAll(/\n/g, " ") → .replaceAll("\n", " ")
- search.ts: .replace(/pattern/g, ...) → .replaceAll("pattern", ...)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Combine consecutive Array.push calls (search.ts, csv.ts) - Use .at(-1) instead of bracket index (indexing.ts) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The document cascade deletion pattern (FTS, embeddings, chunks, doc) was duplicated between connectors/index.ts and connectors/slack.ts. Extract deleteDocumentRows() and have both callers use it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ditions-436 # Conflicts: # src/core/topics.ts
Replace 9 manually duplicated try/finally env save/restore blocks with a shared loadConfigWithEnv() helper that uses the existing withEnv() fixture. Eliminates the duplication that pushed SonarCloud density over the 3% threshold. 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.

Flip if (!x) { A } else { B } to if (x) { B } else { A } for readability.
Fixes SonarCloud S7735 rule violations (31 total):
Changes
Test Results
Closes #436
🤖 Generated with Claude Code