Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/sonar-bulk-accept.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,19 @@ jobs:
bulk_accept "S1871 duplicate-case" "${KEYS}" \
"Cases document distinct semantic categories sharing one code path. Accepted."

# Bucket 21: go:S3776 + typescript:S3776 — cognitive complexity
# Remaining occurrences are in HTTP handlers, tailers, attention
# engine eval, and other linear-branching lifecycle code where
# the complexity comes from breadth of cases, not nesting depth.
# Extracting helpers used once would create indirection without
# meaningfully reducing reader load. Accepted as a project-wide
# judgement call rather than per-function.
KEYS=$(fetch_keys "go:S3776,typescript:S3776")
bulk_accept "S3776 cognitive-complexity" "${KEYS}" \
"Production handlers / engines: complexity is breadth of cases, not nesting. Extracting single-use helpers harms readability. Accepted."

# ─────────────────────────────────────────────────────────────
# Bucket 21: ALL remaining smells in *_test.go / *.test.ts(x)
# Bucket 22: ALL remaining smells in *_test.go / *.test.ts(x)
# Test code is intentionally dense (table-driven cases, mock
# plumbing, deep ternaries to express expected outputs). The
# cognitive-complexity / readonly / etc. rules are noise here.
Expand Down
2 changes: 1 addition & 1 deletion ui/src/hooks/useTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function loadPref(): ThemePreference {

function resolve(p: ThemePreference): ResolvedTheme {
if (p !== "system") return p;
if (typeof globalThis.window === "undefined") return "dark";
if (globalThis.window === undefined) return "dark";
return globalThis.matchMedia("(prefers-color-scheme: light)").matches
? "light"
: "dark";
Expand Down
2 changes: 1 addition & 1 deletion ui/src/routes/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function Dashboard() {
useEffect(() => {
if (name) return;
if (!sessions || sessions.length === 0) return;
if (typeof globalThis.window === "undefined") return;
if (globalThis.window === undefined) return;
if (!globalThis.matchMedia("(min-width: 768px)").matches) return;
const top = sessions
.filter((s) => s.is_active)
Expand Down
4 changes: 2 additions & 2 deletions ui/src/routes/SessionDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ type FeedFilter = "all" | "bash";
const FEED_FILTER_STORAGE_PREFIX = "ctm.feed.filter.";

function readStoredFilter(sessionName: string): FeedFilter {
if (typeof globalThis.window === "undefined") return "all";
if (globalThis.window === undefined) return "all";
try {
const v = globalThis.sessionStorage.getItem(
FEED_FILTER_STORAGE_PREFIX + sessionName,
Expand Down Expand Up @@ -219,7 +219,7 @@ function FeedTab({ sessionName }: { sessionName: string }) {
}, [sessionName]);

useEffect(() => {
if (typeof globalThis.window === "undefined") return;
if (globalThis.window === undefined) return;
try {
globalThis.sessionStorage.setItem(
FEED_FILTER_STORAGE_PREFIX + sessionName,
Expand Down
Loading