Skip to content

chore(sonar): final cleanup — direct undefined check + S3776 bucket#15

Merged
aksOps merged 1 commit intomainfrom
chore/sonar-final-cleanup
May 1, 2026
Merged

chore(sonar): final cleanup — direct undefined check + S3776 bucket#15
aksOps merged 1 commit intomainfrom
chore/sonar-final-cleanup

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented May 1, 2026

Summary

Closes the loop on the maintainability cleanup.

  • After PR chore(sonar): clean up maintainability + reliability smells #14 merged, 4 typescript:S7741 appeared on main — "Compare with `undefined` directly instead of using `typeof`". This was a side effect of converting `typeof window` SSR guards to `typeof globalThis.window`. Since `globalThis` always exists, the property access yields `undefined` safely without `typeof`. Replaced with direct `globalThis.window === undefined` in useTheme.tsx, Dashboard.tsx, SessionDetail.tsx (×2).
  • Added a go:S3776 + typescript:S3776 bucket to the bulk-accept workflow with the justification that remaining occurrences are linear handler / engine functions where complexity is breadth-of-cases, not nesting depth.

Test plan

  • CI green
  • After merge, dispatch `Sonar Bulk Accept` again with `dry_run=false` to mark the 39 remaining S3776 smells

🤖 Generated with Claude Code

After PR #14 merged, four typescript:S7741 smells appeared on main —
a side effect of `typeof globalThis.window === "undefined"` (carried
over verbatim from the original `typeof window` SSR guards). Now that
we go through globalThis, the property access yields undefined safely
without typeof, so the typeof is genuinely redundant. Replaced with
direct `globalThis.window === undefined` in 4 sites.

Also adds a go:S3776 / typescript:S3776 bucket to the bulk-accept
workflow. Remaining occurrences are HTTP handlers / tailers / engines
where complexity is breadth of cases (auth, decode, validate,
dispatch, error) rather than nesting — extracting helpers used once
would add indirection without reducing reader load. Accepted as
project-wide judgement call rather than per-function.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

@aksOps aksOps merged commit fe891d6 into main May 1, 2026
11 checks passed
@aksOps aksOps deleted the chore/sonar-final-cleanup branch May 1, 2026 10:40
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.

1 participant