Skip to content

chore: resolve safe SonarCloud maintainability issues (S6582, S7762)#1399

Merged
mathuo merged 2 commits into
masterfrom
claude/sonarcloud-fixes-wd2pht
Jul 5, 2026
Merged

chore: resolve safe SonarCloud maintainability issues (S6582, S7762)#1399
mathuo merged 2 commits into
masterfrom
claude/sonarcloud-fixes-wd2pht

Conversation

@mathuo

@mathuo mathuo commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Address low-risk, behaviour-preserving code smells:

  • S7762: use childNode.remove() instead of parentNode.removeChild(childNode)
  • S6582: prefer optional chaining over a && a.b guards

Skipped the S7747 (unnecessary Array.from) reports: each [...collection]
is a deliberate defensive copy because the loop body mutates the collection
being iterated. Also left the CRITICAL/BLOCKER buckets untouched.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01B6tAi449PHv5hbMSyhtxMk

claude added 2 commits July 4, 2026 20:08
Address low-risk, behaviour-preserving code smells:

- S7762: use childNode.remove() instead of parentNode.removeChild(childNode)
- S6582: prefer optional chaining over `a && a.b` guards

Skipped the S7747 (unnecessary Array.from) reports: each `[...collection]`
is a deliberate defensive copy because the loop body mutates the collection
being iterated. Also left the CRITICAL/BLOCKER buckets untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6tAi449PHv5hbMSyhtxMk
…7735)

The optional-chaining rewrite left an if/else with a negated condition.
Flip to the positive `=== 'svg'` form and swap the branches so both
S6582 (optional chaining) and S7735 (no negated condition) are satisfied.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6tAi449PHv5hbMSyhtxMk
@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

@mathuo mathuo merged commit ca4e101 into master Jul 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants