Public report of thedotmack/claude-mem, published 24 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 24 October 2026, 16:06 UTC · Survey ID cd_38f57217ce8b4fc4aaa7582f4f75e804

thedotmack/claude-mem

Measured 24 October 2026, 15:27 UTC, at code version 75fc021

Regression: 3 dimensions fell since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 27out of 100 At risk Down 20 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 200,841 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 2.1 person-years · Weakest lens: Domain Modelling, 10

Findings by how serious they are

89 critical 2123 serious 312 minor

11 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 15:27 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

89of 94 dimensions measured by tools. The other 5 are advisory notes from an AI model, which explain the code but don't count towards the score.
2492of 2524 findings point to an exact file and line, so you can open each one in the code. The other 32 concern the repository as a whole, such as missing documentation.
94dimensions across 8 lenses, read from 200,841 lines of product code in 6 projects.
Chapters

Executive summary

thedotmack/claude-mem scores 27 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged.

The weakest lens counts most in the score, and here that is Domain Modelling, which scores 10 and is rated Critical. Its Domain ↔ infrastructure boundary dimension scores 1 out of 10, and until that reaches 4, Domain Modelling can't be rated higher than Adequate. The first actions are to keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository) and to resolve the 2 Leaked secret finding(s) in Secret Scanning, and if Domain Modelling rose to 70, the score would rise from 27 to about 41.

89 findings are critical: 56 in Static Analysis (SAST), 12 in Dependency Vulnerabilities, eight in IaC & Container Security, three in Change Coupling, three in Domain ↔ infrastructure boundary, two in Circular Imports, two in Secret Scanning, two in Web-Security Posture and one in Forms & labels.

Watchdog couldn't measure 11 dimensions in this code, among them Internal API Consistency, Navigability and Secrets (history), so they are left out of the score. The product code is 200,841 lines, which would take an estimated 2.1 person-years, around €300,000, to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Domain Modelling 10 · counts for 45%Production Readiness 27 · counts for 25%Security and Compliance 44 · counts for 14%Accessibility 52 · counts for 8%Code Health 58 · counts for 4%Performance 60 · counts for 2%Maturity 84 · counts for 1%Architecture 85 · counts for 1%

If Domain Modelling rose from 10 to 70, the lowest score rated Strong, the score would rise from 27 to about 41.

Code composition: what the lines of code are
Product code 51%Tests 49%
New since the last survey: 590 findings

These 590 critical or serious findings weren't in the previous survey, on 10 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · buildHumanRequests (cyclomatic 114) src/services/work-view/request-projection.mjs
  • Cyclomatic Complexity · buildAgentView (cyclomatic 67) src/services/work-view/agent-view.mjs
  • Cyclomatic Complexity · to-work-model.toRequest (cyclomatic 54) src/ui/my-work/src/live/to-work-model.ts
  • Cyclomatic Complexity · runCli (cyclomatic 48) src/services/work-view/request-groups.mjs
  • Cyclomatic Complexity · applyGroupDecisions (cyclomatic 46) src/services/work-view/request-groups.mjs
  • Cyclomatic Complexity · teambrain.parseTeamBrainBoard (cyclomatic 45) src/shared/teambrain.ts
  • Cyclomatic Complexity · refresh-task.buildRefreshTask.run (cyclomatic 44) src/services/work-view/refresh-task.ts
  • Cyclomatic Complexity · my-rules.MyRules (cyclomatic 43) src/ui/my-work/src/pages/my-rules.tsx
  • Cyclomatic Complexity · reduceWorkState (cyclomatic 43) src/services/work-view/data-source.mjs
  • Cyclomatic Complexity · validateProgress (cyclomatic 40) src/services/work-view/request-groups.mjs
  • Cyclomatic Complexity · run (cyclomatic 40) REDACTED
  • Cyclomatic Complexity · save_goals.main (cyclomatic 34) plugin/skills/owner-goals/scripts/save_goals.py
  • Cyclomatic Complexity · buildRules (cyclomatic 32) src/services/work-view/my-rules.mjs
  • Cyclomatic Complexity · readCandidates (cyclomatic 31) src/services/work-view/request-groups.mjs
  • Cyclomatic Complexity · productsFromFields (cyclomatic 29) src/services/work-view/work-product.mjs
  • Cyclomatic Complexity · mergeProducts (cyclomatic 29) src/services/work-view/work-product.mjs
  • Cyclomatic Complexity · read (cyclomatic 29) src/services/work-view/data-source.mjs
  • Cyclomatic Complexity · OpenRouterProvider.buildOpenRouterRequestBody (cyclomatic 26) src/services/worker/OpenRouterProvider.ts
  • Cyclomatic Complexity · WorkViewRoutes.saveRule (cyclomatic 26) REDACTED
  • Cyclomatic Complexity · deriveSessionProjects (cyclomatic 26) src/services/work-view/session-project.mjs
  • Cyclomatic Complexity · memory-search.bashSearchPattern (cyclomatic 25) src/cli/handlers/memory-search.ts
  • Cyclomatic Complexity · my-work.MyWork (cyclomatic 25) src/ui/my-work/src/pages/my-work.tsx
  • Cyclomatic Complexity · export_owner_prompts.read_owner_typed_prompts (cyclomatic 25) plugin/skills/owner-goals/scripts/export_owner_prompts.py
  • Cyclomatic Complexity · install.verifyReceipt (cyclomatic 24) ods/install.mjs
  • Cyclomatic Complexity · install.install (cyclomatic 24) ods/install.mjs
  • Cyclomatic Complexity · export_owner_prompts.read_agent_authored_text (cyclomatic 24) plugin/skills/owner-goals/scripts/export_owner_prompts.py
  • Cyclomatic Complexity · observe (cyclomatic 24) src/services/work-view/human-copy-worker.mjs
  • Cyclomatic Complexity · install-launcher.ensureLauncherOnPath (cyclomatic 23) src/launcher/install-launcher.ts
  • Cyclomatic Complexity · buildAgentView::getGroup (cyclomatic 23) src/services/work-view/agent-view.mjs
  • Cyclomatic Complexity · observer-health.renderObserverHealthWarning (cyclomatic 21) src/shared/observer-health.ts
  • Cyclomatic Complexity · mode-validation.validateMode (cyclomatic 21) src/services/domain/mode-validation.ts
  • Cyclomatic Complexity · hermes-config-yaml.findBlock (cyclomatic 21) src/services/integrations/hermes-config-yaml.ts
  • Cyclomatic Complexity · App.LoadedApp (cyclomatic 21) src/ui/my-work/src/App.tsx
  • Cyclomatic Complexity · connection-status.getConnectionStatus (cyclomatic 21) src/ui/my-work/src/live/connection-status.ts
  • Cyclomatic Complexity · readGoals (cyclomatic 21) src/services/work-view/request-groups.mjs
  • Cyclomatic Complexity · HermesInstaller.uninstallHermesIntegration (cyclomatic 20) src/services/integrations/HermesInstaller.ts
  • Cyclomatic Complexity · data.assertConsistentRequest (cyclomatic 20) src/ui/my-work/src/data.ts
  • Cyclomatic Complexity · createHumanCopyInput (cyclomatic 20) src/services/work-view/human-copy.mjs
  • Cyclomatic Complexity · buildAgentView::metadataFor (cyclomatic 20) src/services/work-view/agent-view.mjs
  • Cyclomatic Complexity · tree-sitter-cli-provision.ensureTreeSitterCliBinary (cyclomatic 19) src/services/smart-file-read/tree-sitter-cli-provision.ts
  • Cyclomatic Complexity · teambrain.runJoin (cyclomatic 19) src/npx-cli/commands/teambrain.ts
  • Cyclomatic Complexity · teambrain.runLeave (cyclomatic 19) src/npx-cli/commands/teambrain.ts
  • Cyclomatic Complexity · SearchOrchestrator.supplementEmptyCategories (cyclomatic 19) src/services/worker/search/SearchOrchestrator.ts
  • Cyclomatic Complexity · sample-source.applySampleRuleChange (cyclomatic 19) src/ui/my-work/src/live/sample-source.ts
  • Cyclomatic Complexity · commitsFrom (cyclomatic 19) src/services/work-view/work-product.mjs
  • Cyclomatic Complexity · SessionSearch.searchSessions (cyclomatic 18) src/services/sqlite/SessionSearch.ts
  • Cyclomatic Complexity · spool-hook-event.uploadRemoteHookSpool (cyclomatic 18) src/cli/spool-hook-event.ts
  • Cyclomatic Complexity · bun-runtime.findBun (cyclomatic 18) src/launcher/bun-runtime.ts
  • Cyclomatic Complexity · CodexCliInstaller.tomlStructuralLines (cyclomatic 18) src/services/integrations/CodexCliInstaller.ts
  • Cyclomatic Complexity · HermesInstaller.installHermesIntegration (cyclomatic 18) src/services/integrations/HermesInstaller.ts
  • Cyclomatic Complexity · processGeneratedResponse.persistGeneratedObservations (cyclomatic 18) src/server/generation/processGeneratedResponse.ts
  • Cyclomatic Complexity · recall-mcp-server.dispatchToolCall (cyclomatic 18) src/server/mcp/recall-mcp-server.ts
  • Cyclomatic Complexity · request-detail.RequestDetail (cyclomatic 18) src/ui/my-work/src/components/request-detail.tsx
  • Cyclomatic Complexity · tag-stripping.stripBalancedMemoryTags (cyclomatic 17) src/utils/tag-stripping.ts
  • Cyclomatic Complexity · provider-dispatch.noteQuotaFallbackTransition (cyclomatic 17) src/services/worker/provider-dispatch.ts
  • Cyclomatic Complexity · SessionRoutes.admitAndStartGenerator (cyclomatic 17) REDACTED
  • Cyclomatic Complexity · FileTailer.readNewZstdFrames (cyclomatic 17) src/services/transcripts/watcher.ts
  • Cyclomatic Complexity · my-rules.AgentFile (cyclomatic 17) src/ui/my-work/src/pages/my-rules.tsx
  • Cyclomatic Complexity · productsFromToolUse (cyclomatic 17) src/services/work-view/work-product.mjs
  • Cyclomatic Complexity · validateOutcome (cyclomatic 17) src/services/work-view/request-groups.mjs
  • Cyclomatic Complexity · SessionSearch.ensureFTSTables (cyclomatic 16) src/services/sqlite/SessionSearch.ts
  • Cyclomatic Complexity · SessionSearch.buildFilterClause (cyclomatic 16) src/services/sqlite/SessionSearch.ts
  • Cyclomatic Complexity · ServerClient.request (cyclomatic 16) src/services/hooks/server-client.ts
  • Cyclomatic Complexity · EnvManager.buildIsolatedEnvWithFreshOAuth (cyclomatic 16) src/shared/EnvManager.ts
  • Cyclomatic Complexity · mcp-http.startMcpHttpServer.handle (cyclomatic 16) src/servers/mcp-http.ts
  • Cyclomatic Complexity · CcsAlignMiddleCache.appendMiddleCacheRecordsAtomic (cyclomatic 16) src/services/integrations/CcsAlignMiddleCache.ts
  • Cyclomatic Complexity · agent-view.buildAgentView.getGroup (cyclomatic 16) src/services/work-view/agent-view.mjs
  • Cyclomatic Complexity · status-normalization.normalizeRequestStatus (cyclomatic 16) src/ui/my-work/src/live/status-normalization.ts
  • Cyclomatic Complexity · pushesFrom (cyclomatic 16) src/services/work-view/work-product.mjs
  • Cyclomatic Complexity · buildHumanRequests::requestFor (cyclomatic 16) src/services/work-view/request-projection.mjs
  • Cyclomatic Complexity · readAgentRecords (cyclomatic 16) src/services/work-view/agent-view.mjs
  • Cognitive Complexity · buildHumanRequests (cognitive 160) src/services/work-view/request-projection.mjs
  • Cognitive Complexity · buildAgentView (cognitive 97) src/services/work-view/agent-view.mjs
  • Cognitive Complexity · reduceWorkState (cognitive 68) src/services/work-view/data-source.mjs
  • Cognitive Complexity · runCli (cognitive 67) src/services/work-view/request-groups.mjs
  • Cognitive Complexity · applyGroupDecisions (cognitive 66) src/services/work-view/request-groups.mjs
  • Cognitive Complexity · read (cognitive 56) src/services/work-view/data-source.mjs
  • Cognitive Complexity · memory-search.bashSearchPattern (cognitive 51) src/cli/handlers/memory-search.ts
  • Cognitive Complexity · to-work-model.toRequest (cognitive 51) src/ui/my-work/src/live/to-work-model.ts
  • Cognitive Complexity · export_owner_prompts.read_agent_authored_text (cognitive 47) plugin/skills/owner-goals/scripts/export_owner_prompts.py
  • Cognitive Complexity · export_owner_prompts.read_owner_typed_prompts (cognitive 46) plugin/skills/owner-goals/scripts/export_owner_prompts.py
  • Cognitive Complexity · run (cognitive 44) REDACTED
  • Cognitive Complexity · mcp-text-format.formatMcpPayload (cognitive 43) src/servers/mcp-text-format.ts
  • Cognitive Complexity · productsFromFields (cognitive 42) src/services/work-view/work-product.mjs
  • Cognitive Complexity · install.install (cognitive 40) ods/install.mjs
  • Cognitive Complexity · OpenAICompatProvider.queryChatCompletions (cognitive 38) src/services/worker/OpenAICompatProvider.ts
  • Cognitive Complexity · readCandidates (cognitive 38) src/services/work-view/request-groups.mjs
  • Cognitive Complexity · validateProgress (cognitive 36) src/services/work-view/request-groups.mjs
  • Cognitive Complexity · save_goals.main (cognitive 35) plugin/skills/owner-goals/scripts/save_goals.py
  • Cognitive Complexity · buildRules (cognitive 35) src/services/work-view/my-rules.mjs
  • Cognitive Complexity · mode-validation.validateMode (cognitive 34) src/services/domain/mode-validation.ts
  • Cognitive Complexity · mergeProducts (cognitive 34) src/services/work-view/work-product.mjs
  • Cognitive Complexity · deriveSessionProjects (cognitive 33) src/services/work-view/session-project.mjs
  • Cognitive Complexity · bun-runtime.findBun (cognitive 32) src/launcher/bun-runtime.ts
  • Cognitive Complexity · SearchOrchestrator.supplementEmptyCategories (cognitive 31) src/services/worker/search/SearchOrchestrator.ts
  • Cognitive Complexity · my-work.MyWork (cognitive 31) src/ui/my-work/src/pages/my-work.tsx
  • Cognitive Complexity · install.verifyReceipt (cognitive 30) ods/install.mjs
  • Cognitive Complexity · HumanCopyWorker.observe (cognitive 30) src/services/work-view/human-copy-worker.mjs
  • Cognitive Complexity · WorkViewRoutes.saveRule (cognitive 30) REDACTED
  • Cognitive Complexity · buildAgentView::getGroup (cognitive 29) src/services/work-view/agent-view.mjs

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 635 findings

These 635 critical or serious findings were in the previous survey, on 10 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · ProgressiveSearch.run (cyclomatic 33) src/shared/progressive-search.ts
  • Cyclomatic Complexity · SearchManager.performChromaSemanticSearch (cyclomatic 24) src/services/worker/SearchManager.ts
  • Cyclomatic Complexity · atomic-json.writeJsonFileAtomic (cyclomatic 21) src/shared/atomic-json.ts
  • Cyclomatic Complexity · RateLimitStore.shouldAbortForQuota (cyclomatic 21) src/services/worker/RateLimitStore.ts
  • Cyclomatic Complexity · ProgressiveSearch.result (cyclomatic 17) src/shared/progressive-search.ts
  • Cognitive Complexity · ProgressiveSearch.run (cognitive 46) src/shared/progressive-search.ts
  • Cognitive Complexity · SearchManager.performChromaSemanticSearch (cognitive 36) src/services/worker/SearchManager.ts
  • Cognitive Complexity · RateLimitStore.shouldAbortForQuota (cognitive 24) src/services/worker/RateLimitStore.ts
  • Cognitive Complexity · install.applyClaudeCodePathSetupIfNeeded (cognitive 23) REDACTED
  • Cognitive Complexity · ProgressiveSearch.result (cognitive 20) src/shared/progressive-search.ts
  • Cognitive Complexity · ModeManager.loadMode (cognitive 19) src/services/domain/ModeManager.ts
  • God Classes · ClassTooLong: SessionSearch src/services/sqlite/SessionSearch.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: scripts/pr-babysit-status.ts scripts/pr-babysit-status.ts
  • Code Coverage · Low coverage: scripts/sync-marketplace.cjs scripts/sync-marketplace.cjs
  • Code Coverage · Low coverage: src/cli/adapters/raw.ts src/cli/adapters/raw.ts
  • Code Coverage · Low coverage: src/cli/adapters/windsurf.ts src/cli/adapters/windsurf.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/npx-cli/banner.ts src/npx-cli/banner.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/npx-cli/commands/runtime.ts src/npx-cli/commands/runtime.ts
  • Code Coverage · Low coverage: src/npx-cli/commands/uninstall.ts src/npx-cli/commands/uninstall.ts
  • Code Coverage · Low coverage: src/npx-cli/install/setup-runtime.ts src/npx-cli/install/setup-runtime.ts
  • Code Coverage · Low coverage: src/npx-cli/utils/paths.ts src/npx-cli/utils/paths.ts
  • Code Coverage · Low coverage: src/server/compat/SessionsObservationsAdapter.ts src/server/compat/SessionsObservationsAdapter.ts
  • Code Coverage · Low coverage: src/server/compat/SessionsSummarizeAdapter.ts src/server/compat/SessionsSummarizeAdapter.ts
  • Code Coverage · Low coverage: src/server/generation/ProviderObservationGenerator.ts src/server/generation/ProviderObservationGenerator.ts
  • Code Coverage · Low coverage: src/server/generation/processGeneratedResponse.ts src/server/generation/processGeneratedResponse.ts
  • Code Coverage · Low coverage: src/server/middleware/postgres-auth.ts src/server/middleware/postgres-auth.ts
  • Code Coverage · Low coverage: src/server/middleware/rate-limit.ts src/server/middleware/rate-limit.ts
  • Code Coverage · Low coverage: src/server/middleware/usage-metering.ts src/server/middleware/usage-metering.ts
  • Code Coverage · Low coverage: src/server/routes/v1/ServerV1PostgresRoutes.ts src/server/routes/v1/ServerV1PostgresRoutes.ts
  • Code Coverage · Low coverage: src/server/runtime/ActiveServerGenerationWorkerManager.ts src/server/runtime/ActiveServerGenerationWorkerManager.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/server/runtime/SessionGenerationPolicy.ts src/server/runtime/SessionGenerationPolicy.ts
  • Code Coverage · Low coverage: src/server/runtime/create-server-service.ts src/server/runtime/create-server-service.ts
  • Code Coverage · Low coverage: src/server/services/EndSessionService.ts src/server/services/EndSessionService.ts
  • Code Coverage · Low coverage: src/server/services/IngestEventsService.ts src/server/services/IngestEventsService.ts
  • Code Coverage · Low coverage: src/services/hooks/server-bootstrap.ts src/services/hooks/server-bootstrap.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/services/integrations/CursorHooksInstaller.ts src/services/integrations/CursorHooksInstaller.ts
  • Code Coverage · Low coverage: src/services/integrations/DeepSeekHarnessInstaller.ts src/services/integrations/DeepSeekHarnessInstaller.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/services/telemetry/cli-telemetry.ts src/services/telemetry/cli-telemetry.ts
  • Code Coverage · Low coverage: src/services/transcripts/cli.ts src/services/transcripts/cli.ts
  • Code Coverage · Low coverage: src/services/worker-spawner.ts src/services/worker-spawner.ts
  • Code Coverage · Low coverage: src/services/worker/FormattingService.ts src/services/worker/FormattingService.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/services/worker/knowledge/KnowledgeAgent.ts src/services/worker/knowledge/KnowledgeAgent.ts
  • Code Coverage · Low coverage: src/services/worker/search/ResultFormatter.ts src/services/worker/search/ResultFormatter.ts
  • Code Coverage · Low coverage: src/shared/windows-listen-socket.ts src/shared/windows-listen-socket.ts
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/storage/postgres/agent-events.ts src/storage/postgres/agent-events.ts
  • Code Coverage · Low coverage: src/storage/postgres/auth.ts src/storage/postgres/auth.ts
  • Code Coverage · Low coverage: src/storage/postgres/config.ts src/storage/postgres/config.ts
  • Code Coverage · Low coverage: src/storage/postgres/data-deletion.ts src/storage/postgres/data-deletion.ts
  • Code Coverage · Low coverage: src/storage/postgres/generation-jobs.ts src/storage/postgres/generation-jobs.ts
  • Code Coverage · Low coverage: src/storage/postgres/observations.ts src/storage/postgres/observations.ts
  • Code Coverage · Low coverage: src/storage/postgres/pool.ts src/storage/postgres/pool.ts
  • Code Coverage · Low coverage: src/storage/postgres/projects.ts src/storage/postgres/projects.ts
  • Code Coverage · Low coverage: src/storage/postgres/rate-limit.ts src/storage/postgres/rate-limit.ts
  • Code Coverage · Low coverage: src/storage/postgres/server-sessions.ts src/storage/postgres/server-sessions.ts
  • Code Coverage · Low coverage: src/storage/postgres/teams.ts src/storage/postgres/teams.ts
  • Code Coverage · Low coverage: src/storage/postgres/usage.ts src/storage/postgres/usage.ts
  • Code Coverage · Low coverage: src/storage/postgres/utils.ts src/storage/postgres/utils.ts
  • Code Coverage · Low coverage: src/supervisor/shutdown.ts src/supervisor/shutdown.ts
  • Code Coverage · Low coverage: src/ui/viewer/components/ContextSettingsModal.tsx src/ui/viewer/components/ContextSettingsModal.tsx
  • Code Coverage · Low coverage: REDACTED REDACTED
  • Code Coverage · Low coverage: src/ui/viewer/components/WelcomeCard.tsx src/ui/viewer/components/WelcomeCard.tsx
  • Code Coverage · Low coverage: src/ui/viewer/hooks/useContextPreview.ts src/ui/viewer/hooks/useContextPreview.ts
  • Code Coverage · Low coverage: src/ui/viewer/hooks/useSettings.ts src/ui/viewer/hooks/useSettings.ts
  • Code Coverage · Low coverage: src/utils/agents-md-utils.ts src/utils/agents-md-utils.ts
  • Churn × Complexity Hotspots · Hotspot: workers/sync-hub/src/do/SyncHub.ts workers/sync-hub/src/do/SyncHub.ts
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: workers/sync-hub/vitest.config.ts workers/sync-hub/vitest.config.ts
  • Churn × Complexity Hotspots · Hotspot: workers/sync-hub/src/watchdog.ts workers/sync-hub/src/watchdog.ts
  • Churn × Complexity Hotspots · Repeated repair: src/cli/handlers/context.ts src/cli/handlers/context.ts
  • Churn × Complexity Hotspots · Repeated repair: src/shared/observer-health.ts src/shared/observer-health.ts
  • Churn × Complexity Hotspots · Repeated repair: src/servers/mcp-server.ts src/servers/mcp-server.ts
  • Churn × Complexity Hotspots · Repeated repair: src/shared/EnvManager.ts src/shared/EnvManager.ts
  • Churn × Complexity Hotspots · Repeated repair: src/services/integrations/CodexCliInstaller.ts src/services/integrations/CodexCliInstaller.ts
  • Churn × Complexity Hotspots · Repeated repair: src/services/hooks/server-client.ts src/services/hooks/server-client.ts
  • Churn × Complexity Hotspots · Repeated repair: src/server/generation/processGeneratedResponse.ts src/server/generation/processGeneratedResponse.ts
  • Churn × Complexity Hotspots · Repeated repair: REDACTED REDACTED
  • Churn × Complexity Hotspots · Repeated repair: REDACTED REDACTED
  • Churn × Complexity Hotspots · Repeated repair: src/supervisor/env-sanitizer.ts src/supervisor/env-sanitizer.ts
  • Churn × Complexity Hotspots · Repeated repair: src/npx-cli/install/npm-install-helper.ts src/npx-cli/install/npm-install-helper.ts
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Dependency Vulnerabilities · Critical CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • IaC & Container Security · Medium IaC: REDACTED REDACTED
  • IaC & Container Security · Medium IaC: REDACTED REDACTED
  • Change Coupling · Change coupling: REDACTED ↔ REDACTED REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Code Duplication · Duplication concentrated across 9 sibling directories (57 clone groups) services/sync-api/src/canonical-content.ts
Rebuild cost: about €300,000 · Estimate
Cost to rebuild€100,000 to €500,000, for 1,663 to 5,274 hours of work, about 2.1 person-years for 1 to 4 engineers
Difficulty of the problemLow, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 27. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 200,841 lines of product code

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
Raises the score by about 14 points · Medium effort · Domain ↔ infrastructure boundary
2
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.
Raises the score by about 6 points · Low effort · Secret Scanning
3
Resolve the 6 Low coverage finding(s) in Code Coverage — start with canonical-content.ts, REDACTED, projection.ts.
Raises the score by about 2 points · Low effort · Code Coverage

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Files that change often carry extra risk · Combined risk
One file is changed often and is hard to read, which makes it the likeliest place for a mistake. It also has under half its code tested, or was written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to this file therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (183 files) · Code Coverage (6 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: REDACTED
What to do: Add tests to these files and have a second person review every change to them, starting with REDACTED.
Where the investment is most exposed · Value at risk
This code would cost about €300,000 to build again, about 2.1 person-years of work. Its weakest lens is Domain Modelling, at 10 (Critical). Domain Modelling is about whether the code protects the rules the business depends on. Because the weakest lens counts most in the score, work on Domain Modelling also moves the score most.
Based on: the rebuild estimate · the Domain Modelling grade · how much each lens counts
What to do: Start with the Domain Modelling actions in Top priorities.
If you do one thing first · First action
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository). Of all the actions in this report, it raises the score most for the work it takes: about 14 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 510,284 lines over the last 90 days, which is about 2,069,485 lines a year. At that pace, the extra work comes to an estimated 274 to 1643.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

604 modules, with 771 dependencies between them. One loop runs through 5 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 564 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 src.npx-cli.commands2 src.server.middleware.auth3 src.services.context.types4 src.services.integrations5 src.services.sqlite.types6 src.services.sync.CanonicalContent7 src.services.worker-types8 src.storage.postgres.pool9 src.storage.postgres.utils10 src.ui.viewer.components11 src.services.server.Server12 src.services.sqlite.SessionStore13 src.services.worker.http.BaseRouteHandler14 src.storage.postgres.generation-jobs15 src.ui.my-work.src16 src.ui.my-work.src.live17 scripts.sync-matrix-e2e18 src.server.generation.providers.shared.types19 src.server.routes.v1.ServerV1PostgresRoutes20 src.servers21 src.services.infrastructure22 src.services.worker.DatabaseManager23 src.services.worker.SearchManager24 src.shared25 src.storage.postgres26 scripts27 services.sync-api.src28 src.server.runtime29 src.services.worker.SessionManager30 src.services.worker.ClaudeProvider31 src.services.worker.OpenAICompatibleProvider32 src.services.worker.CodexProvider33 src.services.worker.GeminiProvider34 src.services.worker.OpenAICompatProvider35 src.services.worker.OpenRouterProvider36 src.services.worker37 src.services.worker.http.routes.SessionRoutes38 src.services.worker-service39 src.services.worker.session.GeneratorRunner40 src.services.worker.session
1 src.npx-cli.commands
2 src.server.middleware.auth
3 src.services.context.types
4 src.services.integrations
5 src.services.sqlite.types
6 src.services.sync.CanonicalContent
7 src.services.worker-types
8 src.storage.postgres.pool
9 src.storage.postgres.utils
10 src.ui.viewer.components
11 src.services.server.Server1
12 src.services.sqlite.SessionStore1
13 src.services.worker.http.BaseRouteHandler1
14 src.storage.postgres.generation-jobs2
15 src.ui.my-work.src1
16 src.ui.my-work.src.live1
17 scripts.sync-matrix-e2e1
18 src.server.generation.providers.shared.types1
19 src.server.routes.v1.ServerV1PostgresRoutes111
20 src.servers1
21 src.services.infrastructure1
22 src.services.worker.DatabaseManager1
23 src.services.worker.SearchManager11
24 src.shared11
25 src.storage.postgres1147
26 scripts11
27 services.sync-api.src231
28 src.server.runtime111
29 src.services.worker.SessionManager31
30 src.services.worker.ClaudeProvider211
31 src.services.worker.OpenAICompatibleProvider211
32 src.services.worker.CodexProvider22
33 src.services.worker.GeminiProvider112
34 src.services.worker.OpenAICompatProvider1113
35 src.services.worker.OpenRouterProvider1113
36 src.services.worker412121
37 src.services.worker.http.routes.SessionRoutes111111111
38 src.services.worker-service111111111
39 src.services.worker.session.GeneratorRunner1111111
40 src.services.worker.session521
Uses a module listed above itPart of a loopThe module itself
1 src.npx-cli.commands2 src.server.middleware.auth3 src.services.context.types4 src.services.integrations5 src.services.sqlite.types6 src.services.sync.CanonicalContent7 src.services.worker-types8 src.storage.postgres.pool9 src.storage.postgres.utils10 src.ui.viewer.components11 src.services.server.Server12 src.services.sqlite.SessionStore13 src.services.worker.http.BaseRouteHandler14 src.storage.postgres.generation-jobs15 src.ui.my-work.src16 src.ui.my-work.src.live17 scripts.sync-matrix-e2e18 src.server.generation.providers.shared.types19 src.server.routes.v1.ServerV1PostgresRoutes20 src.servers21 src.services.infrastructure22 src.services.worker.DatabaseManager23 src.services.worker.SearchManager24 src.shared25 src.storage.postgres26 scripts27 services.sync-api.src28 src.server.runtime29 src.services.worker.SessionManager30 src.services.worker.ClaudeProvider31 src.services.worker.OpenAICompatibleProvider32 src.services.worker.CodexProvider33 src.services.worker.GeminiProvider34 src.services.worker.OpenAICompatProvider35 src.services.worker.OpenRouterProvider36 src.services.worker37 src.services.worker.http.routes.SessionRoutes38 src.services.worker-service39 src.services.worker.session.GeneratorRunner40 src.services.worker.sessionsrc.npx-cli.commands1src.server.middleware.auth2src.services.context.types3src.services.integrations4src.services.sqlite.types5src.services.sync.CanonicalContent6src.services.worker-types7src.storage.postgres.pool8src.storage.postgres.utils9src.ui.viewer.components10src.services.server.Server11src.services.sqlite.SessionStore12src.services.worker.http.BaseRouteHandler13src.storage.postgres.generation-jobs14src.ui.my-work.src15src.ui.my-work.src.live16scripts.sync-matrix-e2e17src.server.generation.providers.shared.types18src.server.routes.v1.ServerV1PostgresRoutes19src.servers20src.services.infrastructure21src.services.worker.DatabaseManager22src.services.worker.SearchManager23src.shared24src.storage.postgres25scripts26services.sync-api.src27src.server.runtime28src.services.worker.SessionManager29src.services.worker.ClaudeProvider30src.services.worker.OpenAICompatibleProvider31src.services.worker.CodexProvider32src.services.worker.GeminiProvider33src.services.worker.OpenAICompatProvider34src.services.worker.OpenRouterProvider35src.services.worker36src.services.worker.http.routes.SessionRoutes37src.services.worker-service38src.services.worker.session.GeneratorRunner39src.services.worker.session401112111111111111111147112311113121121122112111311134121211111111111111111111111111521+564 more modules (most-connected shown)

At a glance — Code Health · 58% · Adequate · gated by D1, D2, R3 ·

At a glance — Architecture · 85% · Strong ·

At a glance — Maturity · 84% · Strong ·

At a glance — Readiness · 27% · Weak · gated by D13, R8, P3, P5, P7 ·

At a glance — Security · 44% · Weak · gated by D29, D30, D36, S1 ·

At a glance — Domain Modelling · 10% · Critical · gated by DM6 ·

At a glance — Accessibility · 52% · Adequate ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection209High / Critical
A03:2025 — Software Supply Chain Failures26High / Critical
A02:2025 — Security Misconfiguration24High / Critical
A07:2025 — Authentication Failures2High / Critical
A01:2025 — Broken Access Control1Medium

Roadmap

First, isolate the domain layer from infrastructure concerns by using a repository pattern to map data models, ensuring entities remain framework-free. Next, immediately resolve the two identified secret leaks in the E2E scripts and integrate a SAST step into CI to prevent security regressions from merging. Finally, codify disaster recovery procedures with clear RTO/RPO documentation, remove unused dependencies, and explicitly declare all imports to maintain dependency hygiene.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).+14.4 ptsMediumDomain ↔ infrastructure boundary
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.+6.2 ptsLowSecret Scanning
Resolve the 6 Low coverage finding(s) in Code Coverage — start with canonical-content.ts, REDACTED, projection.ts.+1.8 ptsLowCode Coverage
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.+2.4 ptsMediumSecurity & performance tooling
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.+2.4 ptsMediumDR & Backup
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+2.4 ptsMediumDependency Hygiene
Stop accepting every TLS certificate: delete `rejectUnauthorized: false` / `NODE_TLS_REJECT_UNAUTHORIZED=0` so the chain, hostname and expiry are verified, and trust a self-signed or private server by passing its CA (`ca`, or `NODE_EXTRA_CA_CERTS`) — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 2 sites, not one: `src/storage/postgres/config.ts:62` (`rejectUnauthorized: false`), `src/storage/postgres/config.ts:68` (`rejectUnauthorized: false`). Each is a separate decision — fixing only the line this row cites leaves the others in place.+1.9 ptsMediumWeb-Security Posture
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.+1.3 ptsMediumOutbound HTTP resilience

File quality

Per-file score 0–10 — a quality signature. Of 393 files carrying findings, judged against the Production bar: 2% slop · 75% mixed · 23% near-clean.

FileScoreBandWorst signal
REDACTED0.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.2SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedIaC & Container Security: High IaC: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 89

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 2123

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 312

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 11

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 89 of 94 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 94 dimensions across the health lenses
D1D2D3D4D5D6D7D8D9D10D11D12D13D14D15D16D17D19D20D21D25D26D29D30D31D32D34D35D36D37D43D44AC1AC2AC3AC4AC5AC7AX10AX3AX5AX6C2DM6DM9GD1IC1M1M2M3M4P1P10P2P3P4P5P6P7PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X27X28X29X3X30X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2492 of 2524 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a16e86-6c8b-77c3-8105-4b2fd4197071.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 9,473 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 87 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Test reliability for the vitest suite in workers/sync-hub/ was NOT MEASURED: the dependency install for workers/sync-hub/ failed in the analyzer sandbox (npm error Cannot read properties of null (reading 'edgesOut')), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published REDACTED's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D28 Secrets (history) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `gitleaks` TIMED OUT after 180s against a 180s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
  • D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. `plugin/scripts/context-read-worker.cjs`, `plugin/scripts/mcp-server.cjs`, `plugin/scripts/transcript-watcher.cjs`, `plugin/ui/viewer-bundle.js`, `plugin/ui/work-view/assets/index-Dtpx5EcX.js`, … (+14 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AC6 Visual & motion safety — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex').
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in REDACTED, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.claude-mem-worker.environment.CLAUDE_MEM_SERVER_DATABASE_URL: required variable POSTGRES_USER is missing a value: POSTGRES_USER is required; runtime evidence skipped.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'postgres' is imported (services/sync-api/src/store.ts:17), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'postgres' is imported (services/sync-api/src/store.ts:17), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'postgres' is imported (services/sync-api/src/store.ts:17), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'postgres' is imported (services/sync-api/src/store.ts:17), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • DM9 Scattered domain decisions — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 260 further occurrence(s) are not listed individually; the score already reflects all 300.
  • P2 Observability — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 544 further occurrence(s) are not listed individually; the score already reflects all 584.
  • PF3 Async & latency hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 88 further occurrence(s) are not listed individually; the score already reflects all 128.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 385 further occurrence(s) are not listed individually; the score already reflects all 425.
  • R3 Large Files — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 76 further occurrence(s) are not listed individually; the score already reflects all 116.
  • R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 47 further occurrence(s) are not listed individually; the score already reflects all 87.
  • R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 21 further occurrence(s) are not listed individually; the score already reflects all 61.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 282 further occurrence(s) are not listed individually; the score already reflects all 322.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D25 ADR Conformance: ADR conformance is the LLM-scored fraction of sampled code that follows recorded decisions — it checks the decisions that were written down and the slices it sampled, not unrecorded rules or the whole tree.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (5): D19, D20, D21, D25, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

435 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was mistakes.run at 159. A further 6 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being parser.getQueryKey at 25 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/ui/viewer/hooks/useSSE.ts (useSSE.useSSE at 21), src/ui/viewer/components/SessionList.tsx (SessionList.SessionList at 18). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

mistakes.run (cyclomatic 159) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:98
rollup.build (cyclomatic 88) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:58
render.details (cyclomatic 69) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:393
wins.build (cyclomatic 60) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:234
behavior.scan (cyclomatic 45) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:116

+ 294 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 6 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with mistakes.run (cyclomatic 159), mistakes.run (cyclomatic 159), mistakes.run (cyclomatic 159). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cyclomatic Complexity from 2.0 to about 2.6/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

581 method(s) exceeded the cognitive complexity threshold of 15; the worst was mistakes.run at 262.

mistakes.run (cognitive 262) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:98
rollup.build (cognitive 126) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:58
behavior.scan (cognitive 98) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:116
wins.build (cognitive 91) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:234
render.details (cognitive 89) · ×5claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:393

+ 411 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 63 bodies over 60 down to 60 or less in Cognitive Complexity — start with mistakes.run (cognitive 262), mistakes.run (cognitive 262), mistakes.run (cognitive 262). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 63 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.2 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.2 / 10 · rule-coverage 100% · ceiling Prevented

113 god class(es) detected.

FileTooLong: sqlite/SessionStore.ts · ×39src/services/sqlite/SessionStore.ts
FunctionTooLong: ContextSettingsModal.ContextSettingsModal · ×39src/ui/viewer/components/ContextSettingsModal.tsx:144
MethodTooLong: ServerV1PostgresRoutes.setupRoutes · ×20src/server/routes/v1/ServerV1PostgresRoutes.ts:161
TooManyMethods: SessionStore · ×10src/services/sqlite/SessionStore.ts:228
ClassTooLong: SearchManager · ×5src/services/worker/SearchManager.ts:41

What to do

  1. Resolve the 39 FileTooLong finding(s) in God Classes — start with REDACTED (2), SessionStore.ts, REDACTED. — One of this dimension's main actionable groups (39 warning-level).
  2. Resolve the 39 FunctionTooLong finding(s) in God Classes — start with REDACTED (4), REDACTED (3), ContextSettingsModal.tsx. — One of this dimension's main actionable groups (39 warning-level).
  3. Resolve the 20 MethodTooLong finding(s) in God Classes — start with ServerV1PostgresRoutes.ts (2), SearchManager.ts (2), REDACTED (2). — One of this dimension's main actionable groups (20 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.5 / 10Stronggated by 295 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Verified

192 duplicated block group(s) detected. A further 103 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. Measured on part of this repository only: .ts (84% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Members sharing a duplicated core (5 members, 50+ identical tokens) · ×60claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:77
Duplicated block (5 lines × 5) · ×57claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:68
Duplicated block (6 lines × 5) · ×36claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:102
Duplicated block (7 lines × 5) · ×32claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:77
Duplicated block (8 lines × 5) · ×21claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:88

+ 38 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 60 Members sharing a duplicated core (5 members, 50+ identical tokens) finding(s) in Code Duplication — start with behavior.py (9), patterns.py (9), render.py (8). — One of this dimension's main actionable groups (60 warning-level).
  2. Resolve the 57 Duplicated block (5 lines × 5) finding(s) in Code Duplication — start with rollup.py (9), behavior.py (7), wins.py (5). — One of this dimension's main actionable groups (57 warning-level).
  3. Resolve the 36 Duplicated block (6 lines × 5) finding(s) in Code Duplication — start with wins.py (6), rollup.py (5), mistakes.py (4). — One of this dimension's main actionable groups (36 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

6 production modules (npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 5 of the 6 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 96 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D7 · Architectural Integrity10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

All 9 mechanizable ADR(s) are enforced: 1 by analyzers, 8 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

✓ On the Gold path — maintain.

Detailed fixes: d7_recommendation.md.

D8 · Code Coverage7.1 / 10Strong✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.1 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 35.3% — 6 file(s) below 50%. Measured from the JavaScript/TypeScript suite (node:test via `npm install --ignore-scripts` (no lockfile) in openclaw/; bun:test via `npm install --ignore-scripts` (no lockfile) in services/sync-api/; node:test in src/ui/my-work/: not run).

Low coverage: services/sync-api/src/canonical-content.ts · ×6services/sync-api/src/canonical-content.ts:1

What to do

  1. Resolve the 6 Low coverage finding(s) in Code Coverage — start with canonical-content.ts, REDACTED, projection.ts. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

10324 test methods: 10163 unit, 137 integration, 0 BDD, 24 e2e. The JavaScript/TypeScript suite contributes 9473 `it`/`test` case(s) across 1017 test file(s) declaring at least one; its tier split is read from package names and paths only. The Python suite contributes 851 test function(s) across 76 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.9 / 10Stronggated by 54 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Prevented

72 skipped (50 with a documented reason), 9 zero-assertion, 23 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 9473 tests. Measured on the JavaScript/TypeScript suite only — at least 87 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

Fixed-sleep synchronisation: ends a stalled transaction so it cannot keep holding a user's lock · ×23services/sync-api/test/lock-hold.test.ts:191
Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL · ×22tests/compat/sessions-observations-adapter.test.ts:30
No assertions: deleting a never-captured session is idempotent · ×9ods/test/native.test.mjs:191
Skipped (documented): (unnamed test) · ×50services/sync-api/test/ipv6-host-url.test.ts:30

What to do

  1. Resolve the 23 Fixed-sleep synchronisation finding(s) in Test Quality — start with sync-client.test.ts (5), wait-for-slot.test.ts (4), cloud-sync.test.ts (4). — One of this dimension's main actionable groups (23 warning-level).
  2. Resolve the 22 Skipped test finding(s) in Test Quality — start with sessions-observations-adapter.test.ts, session-start-context-from-store.test.ts, server-service.test.ts. — One of this dimension's main actionable groups (22 warning-level).
  3. Resolve the 9 No assertions finding(s) in Test Quality — start with remote-spool-scheduling.test.ts (3), logger-usage-standards.test.ts (2), sync-client-realtime.test.ts (2). — One of this dimension's main actionable groups (9 warning-level).
  4. Enforce Test Quality in CI to reach Prevented (currently Verified). — Hardens enforcement from Verified toward Prevented — provenance only; does not change the score.

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 1 measured tier(s). JavaScript/TypeScript (node:test via `npm install --ignore-scripts` (no lockfile) in openclaw/ (48 tests); bun:test via `npm install --ignore-scripts` (no lockfile) in services/sync-api/ (52 tests); node:test via `npm ci --ignore-scripts` in src/ui/my-work/ (8 tests); vitest via `npm install --ignore-scripts` (no lockfile) in workers/sync-hub/): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.7 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Verified

6 outdated direct production npm dependency(ies) of 44 graded, 0 pinning defect(s), across 6 REDACTED (6 of them the product) and 4 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 0 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Outdated (npm): ai · ×6

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · Secret Scanning0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

2 secret(s) detected.

REDACTED

What to do

  1. Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 44 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 44 production dependency(ies) this repository's committed lockfile resolves, across 6 product REDACTED manifest(s). Its 74 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.3 / 10Stronggated by 195 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: REDACTED (46×120=5520); REDACTED (54×101=5454); REDACTED (55×94=5170) Repeated repair below the complexity floor: src/services/context/ObservationCompiler.ts (14 of 18 changes were fixes); src/services/context/ContextBuilder.ts (13 of 18 changes were fixes); src/cli/handlers/session-init.ts (13 of 15 changes were fixes)

Hotspot: REDACTED · ×116REDACTED:703
Repeated repair: src/services/context/ObservationCompiler.ts · ×79src/services/context/ObservationCompiler.ts:308

What to do

  1. Resolve the 116 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (5), rollup.py (5), REDACTED. — One of this dimension's main actionable groups (116 warning-level).
  2. Resolve the 79 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), ObservationCompiler.ts, ContextBuilder.ts. — One of this dimension's main actionable groups (79 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

34 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is workers/sync-hub/src/index.ts. Counted over 558 of the 763 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 deducted task-comment markers across 171253 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×2REDACTED:5

What to do

  1. Resolve the 2 TodoComment finding(s) in Explicit Debt — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation QualityStrong◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

The repository's documentation is comprehensive and well-structured: the READMEs for each directory (expense-pricing, evals/read-gate, hermes/claude-mem, plans/hackathon, scripts/*) are complete within their own directories, covering installation, usage, contribution guidance, and license; architecture/design docs like SESSION_ID_ARCHITECTURE.md provide detailed design rationale and a full outline for every visible document. The README Translator script is well-documented with requirements, CLI options, programmatic usage, and an API-options table. The project's documentation is strong and well-organized: a README for each directory (including one for Codex subscription providers) plus architecture/overview markdown documents covering the system layers, hook lifecycle, data flow, and provider details. The Server API section describes every V1 endpoint with auth requirements, rate limiting, and usage-metering semantics; the architecture overview covers the code/host, CLI, worker daemon, storage, and MCP server layers with a detailed table of events and timeouts. Docker is documented as a single-file compose up command plus environment variables. (10 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

Documentation: contradicts the codedocs/anti-pattern-cleanup-plan.md

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with anti-pattern-cleanup-plan.md. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D20 · ADR QualityStrong◐ Sampled · advisory

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

Evaluated 9 ADR(s) individually; mean quality 8.0/10 (consistently complete and clear). 0 flagged with a specific gap.

What to do

  1. Improve ADR Quality — currently 8.0/10. — Evaluated 9 ADR(s) individually; mean quality 8.0/10 (consistently complete and clear). 0 flagged with a specific gap.

Detailed fixes: d20_recommendation.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D25 · ADR ConformanceExemplary◐ Sampled · advisory

What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.

Method: Judged by language model at low temperature against ADRs plus a deterministic structural code summary; findings linked to repo-rooted ADR paths for traceability. Advisory.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

2 conform / 0 violate across 9 ADRs.

✓ On the Gold path — maintain.

Detailed fixes: d25_recommendation.md.

D26 · Project Cohesion4.1 / 10Weak✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 4.1 / 10 · rule-coverage 100% · ceiling Documented

2 of 6 build units (npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

210 finding(s): 0 critical, 56 high, 153 medium, 1 low. 42 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 25 file(s) — `docs/context/agent-sdk-v2-examples.ts` (line 32, line 46, line 82, …), `openclaw/install.sh` (line 356), `plugin/scripts/context-generator.cjs`, `plugin/scripts/context-read-worker.cjs` (line 293), `plugin/scripts/mcp-server.cjs`, … (+20 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 13 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. No action in Static Analysis (SAST) — all 42 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (42 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities1.3 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 1.3 / 10 · rule-coverage 100% · ceiling Documented

15 finding(s): 1 critical, 11 high, 3 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 11 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (11 issue-level).
  2. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 3 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

24 finding(s): 0 critical, 8 high, 13 medium, 3 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 13 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (7), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 8 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (8 issue-level).
  3. Resolve the 3 Low IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 recommendation-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D32 · Data Compliance (PII/GDPR)9.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.

Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using Watchdog's own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 0 high, 1 medium, 0 low. semgrep could not parse 19 file(s) — `plugin/scripts/context-read-worker.cjs`, `plugin/scripts/mcp-server.cjs`, `plugin/scripts/transcript-watcher.cjs`, `plugin/ui/viewer-bundle.js`, `plugin/ui/work-view/assets/index-Dtpx5EcX.js`, … (+14 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.

REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d32_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 558 of the 763 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.7 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: REDACTED↔uninstall.ts 74%; SettingsDefaultsManager.ts↔settings.ts 72%; telemetry.ts↔scrub.ts 68%

Boundary-crossing change coupling: telemetry.ts ↔ scrub.ts · ×3src/npx-cli/commands/telemetry.ts:1
Change coupling: REDACTED ↔ uninstall.ts · ×10REDACTED:1
Change coupling clique: SettingsDefaultsManager.ts, settings.ts, types.tssrc/shared/SettingsDefaultsManager.ts

What to do

  1. Resolve the 3 Boundary-crossing change coupling finding(s) in Change Coupling — start with telemetry.ts, file-context.ts, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 10 Change coupling finding(s) in Change Coupling — start with REDACTED, SessionStore.ts, worker-types.ts. — One of this dimension's main actionable groups (10 warning-level).
  3. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with SettingsDefaultsManager.ts. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 4 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC1 · Text alternatives4.3 / 10Weak✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×2) — plugin/ui/tv.html:133, src/ui/tv.html:133

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels7.6 / 10Strong✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). — src/ui/viewer/components/ContextSettingsModal.tsx:129
  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. — src/ui/viewer/components/ContextSettingsModal.tsx:268

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure6.3 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — plugin/ui/tv.html:2, src/ui/tv.html:2
  • An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative. (×2) — plugin/ui/tv.html:122, src/ui/tv.html:122

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics4.3 / 10Weak✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×2) — src/ui/viewer/components/ContextSettingsModal.tsx:206, src/ui/viewer/components/WelcomeCard.tsx:181

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 78 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain you already use: add `jsx-a11y` to the `plugins` array in your oxlint config (its a11y rules are off until the plugin is listed), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition9.5 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

C2 · Access Controls7.0 / 10Strong✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.

What to do

  • Name the access rules — roles/permissions declared once (a @Roles/@Permissions decorator with its guard, a CASL ability, a casbin model, or Supabase CREATE POLICY) and consulted where access is checked, so the rule set is reviewable and testable on its own.
DM6 · Domain ↔ infrastructure boundary1.0 / 10Critical✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (TypeORM/Prisma/MikroORM/Sequelize/Mongoose) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

  • `src/services/domain/ModeManager.ts` (domain layer) depends on `fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — src/services/domain/ModeManager.ts:2
  • `src/services/domain/ModeManager.ts` (domain layer) depends on `../../utils/logger.js` (import of `src/utils/logger.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — src/services/domain/ModeManager.ts:5
  • `src/services/domain/ModeManager.ts` (domain layer) depends on `../../shared/paths.js` (import of `src/shared/paths.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — src/services/domain/ModeManager.ts:6

What to do

  • Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
DM9 · Scattered domain decisions8.4 / 10Strong✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

  • scripts.sync-matrix-e2e-supabase.HubStatus's [device_count, head_seq, op_count, projected_seq] are judged in scripts.sync-matrix-e2e, scripts.sync-matrix-e2e-supabase — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • scripts.sync-matrix-e2e-supabase.HubStatus's [head_seq, projected_seq] are judged in scripts.sync-matrix-e2e, scripts.sync-matrix-e2e-supabase — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • src.shared.SettingsDefaultsManager.SettingsDefaults's [CLAUDE_MEM_CLOUD_SYNC_HUB_URL, CLAUDE_MEM_CLOUD_SYNC_TOKEN, CLAUDE_MEM_CLOUD_SYNC_USER_ID] are judged in src.npx-cli.commands.teambrain, src.services.worker.DatabaseManager.DatabaseManager — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • src.storage.postgres.generation-jobs.PostgresObservationGenerationJob's [attempts, maxAttempts] are judged in src.server.generation.processGeneratedResponse, src.storage.postgres.generation-jobs — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.

What to do

  • Move each repeated judgement onto the type that owns the members it reads, so the rule has one home and cannot drift.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs7.0 / 10Strong✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `cmdPRs` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:357
  • `cleanupOldTranscripts` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — ragtime/ragtime.ts:57
  • `main` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — scripts/regenerate-claude-md.ts:379
  • `selectChangesPage` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — services/sync-api/src/store.ts:524
  • `installAntigravityCliHooks` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:408
  • `notifyGrokBotAwareness` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/integrations/GrokBotAwarenessPusher.ts:136
  • The guard above `return cwd;` also returns `cwd`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/services/integrations/GrokBotInstaller.ts:121
  • `installGooseMcpIntegration` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:247
  • `installOmpHooks` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/integrations/OmpHooksInstaller.ts:51
  • `initialize` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/worker/DatabaseManager.ts:23
  • `close` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/worker/DatabaseManager.ts:73
  • `requestSessionWrapup` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/worker/SessionManager.ts:443
  • `isAnySessionProcessing` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/worker/SessionManager.ts:821
  • `finalizeSession` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/worker/session/SessionCompletionHandler.ts:14
  • The guard above `return false;` also returns `false`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — REDACTED:2098
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×22) — tests/compat/sessions-observations-adapter.test.ts:30, tests/server/connect-keys.test.ts:29, tests/server/context-recency-mode.test.ts:26, …

What to do

  • Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
M1 · Documentation (README)7.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add a README to the 5 of 6 project(s) that lack one — worth up to 1.7 pts.
M2 · Architecture documentation8.5 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

What to do

  • Grow the ADR log (currently 9) — reach 20 to raise the maturity tier; document significant decisions as they're made.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy8.0 / 10Strong◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • cursor-hooks/README.md names `session-init.sh`, but no file or folder `session-init.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — cursor-hooks/README.md:122
  • cursor-hooks/README.md names `context-inject.sh`, but no file or folder `context-inject.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — cursor-hooks/README.md:123
  • cursor-hooks/README.md names `session-summary.sh`, but no file or folder `session-summary.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — cursor-hooks/README.md:140
  • cursor-hooks/README.md names `common.sh`, but no file or folder `common.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — cursor-hooks/README.md:236
  • docs/SESSION_ID_ARCHITECTURE.md names `src/services/worker/SDKAgent.ts`, but no file or folder `src/services/worker/SDKAgent.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/SESSION_ID_ARCHITECTURE.md:248
  • docs/SESSION_ID_ARCHITECTURE.md names `tests/session_id_refactor.test.ts`, but no file or folder `tests/session_id_refactor.test.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/SESSION_ID_ARCHITECTURE.md:251
  • ods/README.md names `ods/current`, but no file or folder `ods/current` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — ods/README.md:8
  • docs/context/agent-sdk-v2-preview.md links to `/docs/en/agent-sdk/typescript`, but `docs/en/agent-sdk/typescript` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/context/agent-sdk-v2-preview.md:8
  • docs/context/cursor-hooks-reference.md links to `/blog/hooks-partners`, but `blog/hooks-partners` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/context/cursor-hooks-reference.md:237
  • docs/i18n/README.ar.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.ar.md:390
  • docs/i18n/README.ar.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.ar.md:390
  • docs/i18n/README.ar.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.ar.md:391
  • docs/i18n/README.ar.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.ar.md:393
  • docs/i18n/README.ar.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.ar.md:399
  • docs/i18n/README.bn.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.bn.md:389
  • docs/i18n/README.bn.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.bn.md:390
  • docs/i18n/README.bn.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.bn.md:391
  • docs/i18n/README.bn.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.bn.md:393
  • docs/i18n/README.bn.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.bn.md:399
  • docs/i18n/README.cs.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.cs.md:389
  • docs/i18n/README.cs.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.cs.md:389
  • docs/i18n/README.cs.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.cs.md:390
  • docs/i18n/README.cs.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.cs.md:393
  • docs/i18n/README.cs.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.cs.md:399
  • docs/i18n/README.da.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.da.md:389
  • docs/i18n/README.da.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.da.md:389
  • docs/i18n/README.da.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.da.md:390
  • docs/i18n/README.da.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.da.md:393
  • docs/i18n/README.da.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.da.md:399
  • docs/i18n/README.de.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.de.md:389
  • docs/i18n/README.de.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.de.md:389
  • docs/i18n/README.de.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.de.md:390
  • docs/i18n/README.de.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.de.md:393
  • docs/i18n/README.de.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.de.md:399
  • docs/i18n/README.el.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.el.md:389
  • docs/i18n/README.el.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.el.md:389
  • docs/i18n/README.el.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.el.md:390
  • docs/i18n/README.el.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.el.md:393
  • docs/i18n/README.el.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.el.md:399
  • docs/i18n/README.es.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/i18n/README.es.md:389

What to do

  • Reconcile the README with reality: cursor-hooks/README.md names `session-init.sh`, but no file or folder `session-init.sh` exists; cursor-hooks/README.md names `context-inject.sh`, but no file or folder `context-inject.sh` exists; cursor-hooks/README.md names `session-summary.sh`, but no file or folder `session-summary.sh` exists; cursor-hooks/README.md names `common.sh`, but no file or folder `common.sh` exists; docs/SESSION_ID_ARCHITECTURE.md names `src/services/worker/SDKAgent.ts`, but no file or folder `src/services/worker/SDKAgent.ts` exists.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability9.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 2/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `services/sync-api`.
  • `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 188 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/integrations/opencode-plugin/v2.ts:188
  • `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 238 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/integrations/opencode-plugin/v2.ts:238
  • `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 246 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/integrations/opencode-plugin/v2.ts:246
  • `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 381 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/integrations/opencode-plugin/v2.ts:381
  • `src/integrations/opencode-plugin/v1.ts` reports through `console.*` at line 73 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/integrations/opencode-plugin/v1.ts:73
  • `REDACTED` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:113
  • `REDACTED` reports through `console.*` at line 118 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:118
  • `REDACTED` reports through `console.*` at line 144 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:144
  • `REDACTED` reports through `console.*` at line 150 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:150
  • `REDACTED` reports through `console.*` at line 268 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:268
  • `src/npx-cli/banner.ts` reports through `console.*` at line 38 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/banner.ts:38
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 43 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:43
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 57 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:57
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:113
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 121 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:121
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 123 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:123
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 178 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:178
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 187 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:187
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 198 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:198
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 206 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:206
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 216 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:216
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 228 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:228
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 292 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:292
  • `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 470 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/uninstall.ts:470
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 120 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:120
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 121 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:121
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 122 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:122
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 123 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:123
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 124 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:124
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 133 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:133
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 134 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:134
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 136 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:136
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 138 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:138
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 140 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:140
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 142 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:142
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 143 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:143
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 148 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:148
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 149 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:149
  • `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 212 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/npx-cli/commands/telemetry.ts:212

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 41409 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.

What to do

  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

  • A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.

What to do

  • Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×8) — ragtime/ragtime.ts:122, REDACTED:84, REDACTED:34, …
  • `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×5) — src/services/integrations/telegram-transport.ts:14, src/shared/openrouter-token-compatibility.ts:33, src/shared/openrouter-token-compatibility.ts:52, …

What to do

  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `fs.mkdirSync` in `createEvalArm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:562
  • `fs.writeFileSync` in `createEvalArm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:566, REDACTED:568
  • `fs.readFileSync` in `seedObservationDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:907
  • `fs.writeFileSync` in `seedObservationDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:931
  • `fs.mkdirSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1513
  • `fs.writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:1541, REDACTED:1574, REDACTED:1575
  • `fs.existsSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1567
  • `fs.readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1570
  • `statSync` in `exportMemories` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:133
  • `writeFileSync` in `exportMemories` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:141
  • `existsSync` in `refreshAgent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — scripts/grok-bot-session-inject.mjs:746, scripts/grok-bot-session-inject.mjs:757, scripts/grok-bot-session-inject.mjs:811
  • `readFileSync` in `refreshAgent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — scripts/grok-bot-session-inject.mjs:757, scripts/grok-bot-session-inject.mjs:811
  • `existsSync` in `stampBucketMtime` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — scripts/grok-bot-session-inject.mjs:824, scripts/grok-bot-session-inject.mjs:827
  • `readFileSync` in `stampBucketMtime` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — scripts/grok-bot-session-inject.mjs:824, scripts/grok-bot-session-inject.mjs:827
  • `rmSync` in `runMatrix` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:705
  • `existsSync` in `generateClaudeMd` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/cli/claude-md-commands.ts:464
  • `readdirSync` in `walkForClaudeMd` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/cli/claude-md-commands.ts:550
  • `readFileSync` in `walkForClaudeMd` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/cli/claude-md-commands.ts:560
  • `statSync` in `lookupFileObservationHistory` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/cli/handlers/file-context.ts:447
  • `spawnSync` in `findBun` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/launcher/bun-runtime.ts:148
  • `existsSync` in `probeChromaCensus` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:185
  • `readFileSync` in `probeChromaCensus` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:186
  • `existsSync` in `runDoctorCommand` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:476, REDACTED:477, REDACTED:547
  • `readFileSync` in `runDoctorCommand` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:550
  • `rmSync` in `copyPluginToCache` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:838
  • `cpSync` in `copyPluginToCache` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:840
  • `existsSync` in `runNpmInstallInMarketplace` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:893
  • `existsSync` in `runInstallCommandInner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:2676
  • `readFileSync` in `runInstallCommandInner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:2682
  • `existsSync` in `task` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:2983

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety9.6 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication8.8 / 10Strong✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

  • 64 duplicated blocks under the repository root have copies in at least two of the sibling directories cowork, install, ods, openclaw, plugin, ragtime (+4 more sibling(s) not listed) — 55 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 64 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 64 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 64 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — services/sync-api/src/canonical-content.ts:1
  • 33 duplicated blocks under src/ have copies in at least two of the sibling directories cli, integrations, launcher, npx-cli, server, services (+5 more sibling(s) not listed) — 21 of them are reported below, and 12 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 33 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 33 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 33 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/server/generation/providers/GeminiObservationProvider.ts:48
  • 22 duplicated blocks under src/services/ have copies in at least two of the sibling directories agent-runner, context, domain, infrastructure, integrations, memory (+7 more sibling(s) not listed) — 11 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 22 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 22 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 22 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — REDACTED:48
  • services/sync-api/src/canonical-content.ts:1 · workers/sync-hub/src/canonical-content.ts:1 — these 2 files are line-for-line copies of one another — 309 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — services/sync-api/src/canonical-content.ts:1
  • services/sync-api/src/auth.ts:23 · workers/sync-hub/src/index.ts:168 — the two spans are one implementation copied and then locally edited — 1173 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — services/sync-api/src/auth.ts:23
  • scripts/sync-matrix-e2e-supabase.ts:445 · REDACTED:489 — the two spans are one implementation copied and then locally edited — 1621 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/sync-matrix-e2e-supabase.ts:445
  • src/ui/my-work/src/components/ui/dialog.tsx:10 · src/ui/my-work/src/components/ui/sheet.tsx:8 — the two spans are one implementation copied and then locally edited — 473 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/ui/my-work/src/components/ui/dialog.tsx:10
  • services/sync-api/src/projection.ts:183 · workers/sync-hub/src/index.ts:839 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — services/sync-api/src/projection.ts:183
  • services/sync-api/src/canonical-content.ts:282 · src/services/sync/CanonicalContent.ts:345 · workers/sync-hub/src/canonical-content.ts:282 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — services/sync-api/src/canonical-content.ts:282
  • src/server/compat/SessionsObservationsAdapter.ts:41 · src/server/compat/SessionsSummarizeAdapter.ts:27 — the two spans are one implementation copied and then locally edited — 611 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/server/compat/SessionsObservationsAdapter.ts:41
  • src/services/context/formatters/AgentFormatter.ts:14 · src/services/context/formatters/HumanFormatter.ts:14 — the two spans are one implementation copied and then locally edited — 445 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/services/context/formatters/AgentFormatter.ts:14
  • services/sync-api/src/store.ts:96 · workers/sync-hub/src/do/SyncHub.ts:85 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — services/sync-api/src/store.ts:96
  • services/sync-api/src/projection.ts:38 · workers/sync-hub/src/index.ts:677 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — services/sync-api/src/projection.ts:38
  • src/server/generation/providers/GeminiObservationProvider.ts:174 · src/server/generation/providers/OpenRouterObservationProvider.ts:68 — the two spans are one implementation copied and then locally edited — 288 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/server/generation/providers/GeminiObservationProvider.ts:174
  • src/services/integrations/CcsAlignMiddleCache.ts:99 · src/services/integrations/GrokBotAwarenessPusher.ts:33 — the two spans are one implementation copied and then locally edited — 364 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/services/integrations/CcsAlignMiddleCache.ts:99
  • src/services/worker/ClaudeProvider.ts:1253 · src/services/worker/OpenAICompatibleProvider.ts:524 — the two spans are one implementation copied and then locally edited — 302 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/services/worker/ClaudeProvider.ts:1253
  • scripts/check-hook-io-discipline.cjs:35 · scripts/check-spawn-env-discipline.cjs:31 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/check-hook-io-discipline.cjs:35
  • src/server/generation/providers/GeminiObservationProvider.ts:48 · src/services/worker/GeminiProvider.ts:198 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — src/server/generation/providers/GeminiObservationProvider.ts:48
  • scripts/sync-matrix-e2e-supabase.ts:342 · REDACTED:437 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/sync-matrix-e2e-supabase.ts:342
  • REDACTED:190 · workers/sync-hub/src/index.ts:485 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:190
  • src/storage/postgres/projects.ts:8 · src/storage/postgres/teams.ts:26 — the two spans are one implementation copied and then locally edited — 239 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/storage/postgres/projects.ts:8
  • REDACTED:7 · plugin/skills/mode-creator/scripts/install-mode.mjs:54 — the two spans are one implementation copied and then locally edited — 363 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:7
  • src/server/services/IngestEventsService.ts:92 · src/server/services/IngestEventsService.ts:159 — the two spans are one implementation copied and then locally edited — 242 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/server/services/IngestEventsService.ts:92
  • src/services/sqlite/tool-uses.ts:353 · src/services/sqlite/tool-uses.ts:405 — the two spans are one implementation copied and then locally edited — 236 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/services/sqlite/tool-uses.ts:353
  • src/services/sync/ChromaSync.ts:987 · src/services/sync/ChromaSync.ts:1054 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/services/sync/ChromaSync.ts:987
  • src/services/integrations/CursorHooksInstaller.ts:345 · REDACTED:237 — the two spans are one implementation copied and then locally edited — 204 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/services/integrations/CursorHooksInstaller.ts:345
  • services/sync-api/src/projection-protocol.ts:2 · workers/sync-hub/src/projection-protocol.ts:2 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — services/sync-api/src/projection-protocol.ts:2
  • src/server/generation/providers/ClaudeObservationProvider.ts:91 · src/server/generation/providers/OpenRouterObservationProvider.ts:186 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/server/generation/providers/ClaudeObservationProvider.ts:91
  • services/sync-api/src/projection.ts:297 · workers/sync-hub/src/index.ts:959 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — services/sync-api/src/projection.ts:297
  • scripts/regenerate-claude-md.ts:203 · src/cli/claude-md-commands.ts:281 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — scripts/regenerate-claude-md.ts:203
  • src/ui/viewer/components/ContextSettingsModal.tsx:314 · src/ui/viewer/components/ContextSettingsModal.tsx:694 — the two spans are one implementation copied and then locally edited — 143 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/ui/viewer/components/ContextSettingsModal.tsx:314
  • services/sync-api/src/projection.ts:147 · workers/sync-hub/src/index.ts:805 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — services/sync-api/src/projection.ts:147
  • src/ui/my-work/src/components/ui/empty.tsx:33 · src/ui/my-work/src/components/ui/item.tsx:86 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/ui/my-work/src/components/ui/empty.tsx:33
  • src/ui/viewer/components/ContextSettingsModal.tsx:378 · src/ui/viewer/components/ContextSettingsModal.tsx:623 — the two spans are one implementation copied and then locally edited — 194 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/ui/viewer/components/ContextSettingsModal.tsx:378
  • src/ui/my-work/src/components/ui/carousel.tsx:174 · src/ui/my-work/src/components/ui/carousel.tsx:204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/ui/my-work/src/components/ui/carousel.tsx:174
  • REDACTED:156 · workers/sync-hub/src/index.ts:437 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:156
  • src/ui/viewer/components/LogsModal.tsx:444 · src/ui/viewer/components/LogsModal.tsx:471 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/ui/viewer/components/LogsModal.tsx:444
  • REDACTED:300 · workers/sync-hub/src/index.ts:623 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:300
  • services/sync-api/src/projection.ts:118 · workers/sync-hub/src/index.ts:773 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — services/sync-api/src/projection.ts:118
  • src/ui/my-work/src/components/ai-elements/commit.tsx:246 · src/ui/my-work/src/components/ai-elements/terminal.tsx:132 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/ui/my-work/src/components/ai-elements/commit.tsx:246

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries9.9 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • src/ui/my-work/scripts/coverage.mjs:6 imports src/ui/my-work/src/spec/requirements.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — src/ui/my-work/scripts/coverage.mjs:6

What to do

  • Fix the listed violations: move the shared test helper into a source directory production code may depend on (1 row).
R2 · Cyclomatic Complexity8.0 / 10Strong✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • buildHumanRequests has cyclomatic complexity 114 and cognitive complexity 160; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/work-view/request-projection.mjs:97
  • startSession has cyclomatic complexity 109 and cognitive complexity 212; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/worker/ClaudeProvider.ts:372
  • buildSymbols has cyclomatic complexity 108 and cognitive complexity 216; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:703
  • main has cyclomatic complexity 95 and cognitive complexity 122; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1475
  • runInstallCommandInner has cyclomatic complexity 93 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:2653
  • validateSettings has cyclomatic complexity 80 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:354
  • execute has cyclomatic complexity 70 and cognitive complexity 73; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/cli/handlers/context.ts:163
  • search has cyclomatic complexity 69 and cognitive complexity 135; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/worker/SearchManager.ts:442
  • buildAgentView has cyclomatic complexity 67 and cognitive complexity 97; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/work-view/agent-view.mjs:158
  • processAgentResponse has cyclomatic complexity 65 and cognitive complexity 100; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/worker/agents/ResponseProcessor.ts:419
  • (anonymous) has cyclomatic complexity 60 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:769
  • classifyOpenRouterError has cyclomatic complexity 58 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/worker/OpenRouterProvider.ts:166
  • computeSessionCompressedRollup has cyclomatic complexity 55 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/telemetry/buffer.ts:135
  • ingestObservation has cyclomatic complexity 54 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:149
  • main has cyclomatic complexity 53 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/npx-cli/index.ts:144
  • toRequest has cyclomatic complexity 49 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/ui/my-work/src/live/to-work-model.ts:137
  • resolveOpenRouterConfig has cyclomatic complexity 49 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/services/worker/OpenRouterProvider.ts:694
  • ContextSettingsModal has cyclomatic complexity 48 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/ui/viewer/components/ContextSettingsModal.tsx:144
  • ensureWorkerRunning has cyclomatic complexity 47 and cognitive complexity 89; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1242
  • run has cyclomatic complexity 47 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/cli/handlers/session-init.ts:140

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files3.4 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • src/services/sqlite/SessionStore.ts has 4339 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/sqlite/SessionStore.ts:1
  • REDACTED has 3059 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/server/routes/v1/ServerV1PostgresRoutes.ts has 2244 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/server/routes/v1/ServerV1PostgresRoutes.ts:1
  • REDACTED has 2170 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 2112 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/services/sync/CloudSync.ts has 2095 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/sync/CloudSync.ts:1
  • src/services/sync/ChromaSync.ts has 2070 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/sync/ChromaSync.ts:1
  • REDACTED has 1932 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/services/sync/SyncApply.ts has 1549 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/sync/SyncApply.ts:1
  • REDACTED has 1481 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/services/worker/ClaudeProvider.ts has 1356 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/ClaudeProvider.ts:1
  • src/servers/mcp-server.ts has 1317 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/servers/mcp-server.ts:1
  • REDACTED has 1274 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/services/sync/SyncClient.ts has 1251 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/sync/SyncClient.ts:1
  • workers/sync-hub/src/index.ts has 1146 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — workers/sync-hub/src/index.ts:1
  • src/services/worker/agents/ResponseProcessor.ts has 1131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/agents/ResponseProcessor.ts:1
  • src/services/worker/SearchManager.ts has 1130 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/SearchManager.ts:1
  • src/services/worker/OpenRouterProvider.ts has 1117 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/OpenRouterProvider.ts:1
  • src/services/sqlite/SessionSearch.ts has 1092 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/sqlite/SessionSearch.ts:1
  • src/services/transcripts/watcher.ts has 1085 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/transcripts/watcher.ts:1
  • REDACTED has 1065 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 1047 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 993 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/services/worker/CodexAppServerClient.ts has 955 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/CodexAppServerClient.ts:1
  • src/supervisor/process-registry.ts has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/supervisor/process-registry.ts:1
  • services/sync-api/src/store.ts has 923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — services/sync-api/src/store.ts:1
  • REDACTED has 903 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • workers/sync-hub/src/do/SyncHub.ts has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — workers/sync-hub/src/do/SyncHub.ts:1
  • REDACTED has 881 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • evals/read-gate/fixture-large/src/shipping/carrier-tariffs.ts has 878 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — evals/read-gate/fixture-large/src/shipping/carrier-tariffs.ts:1
  • src/shared/SettingsDefaultsManager.ts has 873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/SettingsDefaultsManager.ts:1
  • src/services/worker/SessionManager.ts has 836 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/SessionManager.ts:1
  • src/services/infrastructure/WorktreeAdoption.ts has 798 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/infrastructure/WorktreeAdoption.ts:1
  • src/npx-cli/commands/teambrain.ts has 784 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/npx-cli/commands/teambrain.ts:1
  • src/shared/observer-health.ts has 765 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/observer-health.ts:1
  • src/ui/my-work/src/pages/my-rules.tsx has 752 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/ui/my-work/src/pages/my-rules.tsx:1
  • src/services/worker/OpenAICompatibleProvider.ts has 748 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/OpenAICompatibleProvider.ts:1
  • src/services/worker/OpenAICompatProvider.ts has 740 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/worker/OpenAICompatProvider.ts:1
  • src/launcher/install-launcher.ts has 734 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/launcher/install-launcher.ts:1
  • src/storage/postgres/observations.ts has 731 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/storage/postgres/observations.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage8.7 / 10Strong✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — src/ui/my-work/src/pages/my-rules.tsx:1, REDACTED:1, src/ui/my-work/src/pages/my-goals.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness9.4 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

What to do

  • Bump outdated dependencies to current versions to limit upgrade debt.
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code7.9 / 10Strong✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 111 application, 58 tooling and 1107 test entry point(s) detected in this repo. Gate removals on `bun run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×7) — src/ui/my-work/src/components/ai-elements/commit.tsx, src/ui/my-work/src/components/ui/dropdown-menu.tsx, src/ui/my-work/src/components/ui/item.tsx, …
  • no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/ui/my-work/src/components/ai-elements/commit.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — src/ui/my-work/src/components/ui/avatar.tsx
  • no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (src/ui/my-work/src/components/ai-elements/checkpoint.tsx, src/ui/my-work/src/components/ui/item.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — src/ui/my-work/src/components/ui/separator.tsx
  • Nothing imports this binding — it is safe to review for removal. (×27) — services/sync-api/src/canonical-content.ts:3, services/sync-api/src/projection.ts:18, src/core/schemas/team.ts:41, …
  • Nothing imports THIS copy of 'decimalAtLeast' — but services/sync-api/src/projection.ts:97 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep services/sync-api/src/projection.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other. — services/sync-api/src/canonical-content.ts:133
  • Nothing ultimately consumes this binding: its only referrer is the re-export in src/storage/postgres/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/storage/postgres/index.ts in the same commit, or the barrel will import a name that no longer exists. — src/storage/postgres/pool.ts:57
  • Nothing ultimately consumes this binding: its only referrer is the re-export in src/storage/sqlite/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/storage/sqlite/index.ts in the same commit, or the barrel will import a name that no longer exists. — src/storage/sqlite/schema.ts:5

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene0.0 / 10Critical✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
  • Every import is type-only — move it to devDependencies. — src/ui/my-work/src/components/ai-elements/agent.tsx:10

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports6.4 / 10Adequate✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

  • src/services/telemetry/buffer.ts → src/services/telemetry/telemetry.ts → src/services/telemetry/buffer.ts — src/services/telemetry/buffer.ts:30
  • src/shared/SettingsDefaultsManager.ts → src/shared/openrouter-base-url.ts → src/utils/logger.ts → src/shared/paths.ts → src/shared/SettingsDefaultsManager.ts — src/shared/SettingsDefaultsManager.ts:7

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture2.0 / 10Critical✓ Tool-verified

Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository. Its Node HTTP listeners were read for HTTPS enforcement alone — TLS served, a redirect to https:// or HSTS, or a TLS-terminating proxy configuration committed beside the server — each judged per server package.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose. (×2) — src/storage/postgres/config.ts:62, src/storage/postgres/config.ts:68
  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — src/services/telemetry/backfill.ts:80
  • This code fixes scrypt at N=16,384 (r=8, p=1). A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price. — src/server/auth/sqlite-api-key-service.ts:69
  • `net(…).listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) — ods/service/gateway.mjs:20
  • `http(…).listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) — ods/service/gateway.mjs:43
  • `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) (×4) — REDACTED:225, REDACTED:194, REDACTED:295, …
  • `httpServer.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) — src/servers/mcp-http.ts:432

What to do

  • Stop accepting every TLS certificate: delete `rejectUnauthorized: false` / `NODE_TLS_REJECT_UNAUTHORIZED=0` so the chain, hostname and expiry are verified, and trust a self-signed or private server by passing its CA (`ca`, or `NODE_EXTRA_CA_CERTS`) — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 2 sites, not one: `src/storage/postgres/config.ts:62` (`rejectUnauthorized: false`), `src/storage/postgres/config.ts:68` (`rejectUnauthorized: false`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
  • Raise the cost parameter to current guidance — PBKDF2 at 1,300,000 (HMAC-SHA1), 600,000 (SHA-256) or 210,000 (SHA-512) iterations; scrypt at N=2^17, r=8, p=1; bcrypt at a work factor of 10 or more — or move to a memory-hard KDF (Argon2id, scrypt) where the platform offers one. Read the parameter from configuration and tune it to roughly 100 ms per derivation on the slowest hardware that must run it, so the price can be raised again without shipping new code.
  • Enforce HTTPS on each listed server: serve TLS itself, or redirect plain requests to `https://` and send `Strict-Transport-Security` (`helmet()` does by default) behind the TLS-terminating proxy — and commit that proxy's configuration beside the service. A server only this machine reaches should bind `127.0.0.1`.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document2.7 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `strip_tags` is public and takes `value: Any` from its caller, and it calls itself at line 77 (`strip_tags`) with a piece of `value` (and at line 79) — and nowhere in `strip_tags` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `strip_tags` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:77
  • `canonicalJson` is exported, takes a document from its caller (line 71) and hands it to `normalizeJson`, which calls itself at line 89 (`normalizeJson`) with a piece of `value` (and at line 97) — and nowhere in `normalizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `normalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. (×2) — services/sync-api/src/canonical-content.ts:89, workers/sync-hub/src/canonical-content.ts:89
  • `canonicalJson` is exported, takes a document from its caller (line 74) and hands it to `normalizeJson`, which calls itself at line 92 (`normalizeJson`) with a piece of `value` (and at line 102) — and nowhere in `normalizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `normalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/services/sync/CanonicalContent.ts:92
  • `contentFingerprint` is exported, takes a document from its caller (line 23) and hands it to `canonical`, which calls itself at line 16 (`canonical`) with a piece of `value` (and at line 18) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/services/work-view/review-store.ts:16
  • `canonicalJson` is exported, takes a document from its caller (line 82) and hands it to `sortJson`, which calls itself at line 95 (`sortJson`) with a piece of `value` (and at line 102) — and nowhere in `sortJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sortJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/storage/postgres/utils.ts:95

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation8.7 / 10Strong✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 52/67 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `workerPost` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:311
  • `workerGetText` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:368
  • `sendDirectTelegram` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:471
  • `telegramCall` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:106
  • `waitForQueueToEmpty` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — ragtime/ragtime.ts:115
  • `importMemories` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:15
  • `postToDiscord` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:53
  • `runSearchCommand` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/npx-cli/commands/runtime.ts:256
  • `backfillMissingEmbeddings` awaits `query(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `query(url, { signal })`. — src/server/services/ObservationEmbeddingService.ts:256
  • `fetchWindsurfContextFromWorker` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:264
  • `workerFetch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:135
  • `postForWorkModel` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/ui/my-work/src/live/local-source.ts:65
  • `loadWorkModel` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/ui/my-work/src/live/local-source.ts:83
  • `setRequestChecked` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/ui/my-work/src/live/local-source.ts:99
  • `fetchProjects` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/ui/viewer/hooks/useContextPreview.ts:38

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation7.5 / 10Strong✓ Tool-verified

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

  • `debug` at line 170 is called with an argument built by `observation_types.map(t => t.id)` (line 171), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/domain/ModeManager.ts:170
  • `debug` at line 153 is called with an argument built by `args.join(' ')` (line 153), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/infrastructure/WorktreeAdoption.ts:153
  • `debug` at line 165 is called with an argument built by `args.join(' ')` (line 165), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/infrastructure/WorktreeAdoption.ts:165
  • `debug` at line 89 is called with an argument built by `Array.from(map.keys())` (line 91), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — REDACTED:89
  • `debug` at line 1436 is called with an argument built by `JSON.stringify(toolArguments)` (line 1437), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — REDACTED:1436
  • `debug` at line 645 is called with an argument built by `history.reduce((sum, m) => sum + m.content.length, 0)` (line 647), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/worker/OpenAICompatProvider.ts:645
  • `debug` at line 676 is called with an argument built by `content.map((c : any) => String(c?.type))` (line 680), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/worker/ClaudeProvider.ts:676
  • `debug` at line 185 is called with an argument built by `refillCategories.join(',')` (line 186), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/worker/search/SearchOrchestrator.ts:185

What to do

  • Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.1 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×23) — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:77, claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:91, claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:122, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×15) — cowork/scripts/cmem-hook.mjs:42, cowork/scripts/cmem-hook.mjs:50, cowork/scripts/cmem-hook.mjs:213, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — cowork/scripts/cmem-hook.mjs:222
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — cowork/scripts/cmem-hook.mjs:435

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types7.3 / 10Strong✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 5/7 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
  • ~1.3 `!` null assertions per 1k TypeScript source lines — 221 assertion(s) across the 165555 source line(s) of the 645 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (12), REDACTED (12), src/services/sync/SyncApply.ts (11). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

WCAG coverage — what static analysis assessed

Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 42 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.3, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health58%Adequate — gated by D1, D2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture85%StrongStrongest area.
Maturity84%StrongSolid.
Readiness27%Weak — gated by D13, R8, P3, P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security44%Weak — gated by D29, D30, D36, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling10%Critical — gated by DM6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility52%AdequateAcceptable, with room to improve.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 4 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 23 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 36 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: this repository stores data through 'postgres' (services/sync-api/src/store.ts:17) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'postgres' (services/sync-api/src/store.ts:17) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'postgres' (services/sync-api/src/store.ts:17) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 39 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.claude-mem-worker.environment.CLAUDE_MEM_SERVER_DATABASE_URL: required variable POSTGRES_USER is missing a value: POSTGRES_USER is required; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: this repository stores data through 'postgres' (services/sync-api/src/store.ts:17) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.cjs,.html,.js,.mjs,.ts), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D28 Secrets (history) — gitleaks killed before it finished — this repository's git history not scanned
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • DM1 Aggregate boundaries — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM10 One transaction, one aggregate — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM2 Strongly-typed ids — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM4 Rich vs anemic model — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM5 Encapsulated state — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 14 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a REDACTED, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: TypeScript/JavaScript and Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 89 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 17 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×3
  • Boundary-crossing change coupling: telemetry.ts ↔ scrub.ts src/npx-cli/commands/telemetry.ts:1 — `src/npx-cli/commands/telemetry.ts` (context npx-cli) and `src/services/telemetry/scrub.ts` (context services) sit in DIFFERENT parts of the tree yet change together 68% of the time (15 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `39aea924` feat(worker): opt-in idle exit via CLAUDE_MEM_IDLE_EXIT_SEC (#4524); `f4da8d87` fix(observer): correct a drifted observer turn instead of letting the…; `e3584a2b` fix(worker): preserve rejected observer batches (#3624) — run `git show` on any of them.
  • Boundary-crossing change coupling: file-context.ts ↔ get.ts src/cli/handlers/file-context.ts:1 — `src/cli/handlers/file-context.ts` (context cli) and `src/services/sqlite/observations/get.ts` (context services) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `daf6d9dc` fix: concrete standalone bugs — project name, dot-path, path-match, C…; `753a9936` fix: address PR #1641 review comments (round 3); `e3475180` fix: address PR review — day sort, path canonicalization, dead code c… — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ observer-health.ts REDACTED:1 — `REDACTED` (context services) and `src/shared/observer-health.ts` (context shared) sit in DIFFERENT parts of the tree yet change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `023f4a53` feat(worker): fall back between an API key and the Claude subscriptio…; `3dc125f2` feat(observer): fall back to the Anthropic plan by default when the s…; `06294664` feat(worker): opt-in quota fallback provider (#4268) — run `git show` on any of them.
DM6 · Domain ↔ infrastructure boundary · Domain depends on infrastructure · ×3
  • Domain depends on infrastructure: ModeManager src/services/domain/ModeManager.ts:2 — `src/services/domain/ModeManager.ts` (domain layer) depends on `fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: ModeManager src/services/domain/ModeManager.ts:5 — `src/services/domain/ModeManager.ts` (domain layer) depends on `../../utils/logger.js` (import of `src/utils/logger.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: ModeManager src/services/domain/ModeManager.ts:6 — `src/services/domain/ModeManager.ts` (domain layer) depends on `../../shared/paths.js` (import of `src/shared/paths.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
D13 · Secret Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
S1 · Web-Security Posture · TLS certificate validation disabled · ×2
  • TLS certificate validation disabled src/storage/postgres/config.ts:62 — `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose.
  • TLS certificate validation disabled src/storage/postgres/config.ts:68 — `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose.
AC2 · Forms & labels · <button> with no accessible text · ×1
  • <button> with no accessible text src/ui/viewer/components/ContextSettingsModal.tsx:129 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) src/services/telemetry/buffer.ts:30 — src/services/telemetry/buffer.ts → src/services/telemetry/telemetry.ts → src/services/telemetry/buffer.ts
R9 · Circular Imports · Import cycle (4 files) · ×1
  • Import cycle (4 files) src/shared/SettingsDefaultsManager.ts:7 — src/shared/SettingsDefaultsManager.ts → src/shared/openrouter-base-url.ts → src/utils/logger.ts → src/shared/paths.ts → src/shared/SettingsDefaultsManager.ts
Serious — 2123 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×116
  • Hotspot: REDACTED REDACTED:703 — REDACTED changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 120 in parser.buildSymbols at line 703. 44 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:2653 — REDACTED changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in install.runInstallCommandInner at line 2653. 32 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:1475 — REDACTED changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in worker-service.main at line 1475. 32 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/worker/ClaudeProvider.ts src/services/worker/ClaudeProvider.ts:372 — src/services/worker/ClaudeProvider.ts changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in ClaudeProvider.startSession at line 372. 37 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/ClaudeProvider.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/SettingsDefaultsManager.ts src/shared/SettingsDefaultsManager.ts:733 — src/shared/SettingsDefaultsManager.ts changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in SettingsDefaultsManager.loadFromFile at line 733. 38 of those changes were fix/bug commits, and the other 52 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/shared/SettingsDefaultsManager.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:354 — REDACTED changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in SettingsRoutes.validateSettings at line 354. 20 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/worker/agents/ResponseProcessor.ts src/services/worker/agents/ResponseProcessor.ts:419 — src/services/worker/agents/ResponseProcessor.ts changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in ResponseProcessor.processAgentResponse at line 419. 24 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/agents/ResponseProcessor.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/worker/OpenRouterProvider.ts src/services/worker/OpenRouterProvider.ts:166 — src/services/worker/OpenRouterProvider.ts changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in OpenRouterProvider.classifyOpenRouterError at line 166. 27 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/OpenRouterProvider.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/worker/SearchManager.ts src/services/worker/SearchManager.ts:442 — src/services/worker/SearchManager.ts changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in SearchManager.search at line 442. 22 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/SearchManager.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:1242 — REDACTED changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in worker-utils.ensureWorkerRunning at line 1242. 26 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:245 — REDACTED changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in SessionRoutes.ensureGeneratorRunningLocked at line 245. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/server/routes/v1/ServerV1PostgresRoutes.ts src/server/routes/v1/ServerV1PostgresRoutes.ts:161 — src/server/routes/v1/ServerV1PostgresRoutes.ts changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 136 in ServerV1PostgresRoutes.setupRoutes at line 161. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/server/routes/v1/ServerV1PostgresRoutes.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/sqlite/SessionStore.ts src/services/sqlite/SessionStore.ts:3207 — src/services/sqlite/SessionStore.ts changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in SessionStore.getObservationsByIds at line 3207. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/sqlite/SessionStore.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/worker/session/GeneratorRunner.ts src/services/worker/session/GeneratorRunner.ts:135 — src/services/worker/session/GeneratorRunner.ts changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in GeneratorRunner.startGeneratorWithProvider at line 135. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/session/GeneratorRunner.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:149 — REDACTED changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in shared.ingestObservation at line 149. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/ui/viewer/components/ContextSettingsModal.tsx src/ui/viewer/components/ContextSettingsModal.tsx:144 — src/ui/viewer/components/ContextSettingsModal.tsx changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in ContextSettingsModal.ContextSettingsModal at line 144. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/ui/viewer/components/ContextSettingsModal.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/work-view/request-projection.mjs src/services/work-view/request-projection.mjs:97 — src/services/work-view/request-projection.mjs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in request-projection.buildHumanRequests at line 97. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/work-view/request-projection.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/work-view/refresh-task.ts src/services/work-view/refresh-task.ts:110 — src/services/work-view/refresh-task.ts changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in refresh-task.buildRefreshTask.run at line 110. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/work-view/refresh-task.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/build-hooks.js scripts/build-hooks.js:442 — scripts/build-hooks.js changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in build-hooks.buildHooks at line 442. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- scripts/build-hooks.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/npx-cli/index.ts src/npx-cli/index.ts:144 — src/npx-cli/index.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in index.main at line 144. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/npx-cli/index.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:1419 — REDACTED changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in ChromaMcpManager.callToolUnqueued at line 1419. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/transcripts/watcher.ts src/services/transcripts/watcher.ts:932 — src/services/transcripts/watcher.ts changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in TranscriptWatcher.startTailer at line 932. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/transcripts/watcher.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/sync/ChromaSync.ts src/services/sync/ChromaSync.ts:1874 — src/services/sync/ChromaSync.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ChromaSync.queryChroma at line 1874. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/sync/ChromaSync.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/ui/my-work/src/live/to-work-model.ts src/ui/my-work/src/live/to-work-model.ts:137 — src/ui/my-work/src/live/to-work-model.ts changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in to-work-model.toRequest at line 137. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/ui/my-work/src/live/to-work-model.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/services/work-view/request-groups.mjs src/services/work-view/request-groups.mjs:201 — src/services/work-view/request-groups.mjs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in request-groups.applyGroupDecisions at line 201. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/work-view/request-groups.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 91 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×79
  • Repeated repair: src/services/context/ObservationCompiler.ts src/services/context/ObservationCompiler.ts:308 — src/services/context/ObservationCompiler.ts changed 18 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ObservationCompiler.parseAssistantTextFromLine at line 308), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(context): reject path separators in prior-session ids (#4990)”; “fix(core): linearize tag stripping to kill quadratic regex stalls (#4801)”; “fix(context): guard concepts JSON in the context injection query (#4875)”; “fix(context): finalize single-use SQLite statements in context queries (#4573)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/context/ObservationCompiler.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/services/context/ContextBuilder.ts src/services/context/ContextBuilder.ts:308 — src/services/context/ContextBuilder.ts changed 18 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is ContextBuilder.truncateTerminalPreview at line 308), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(context): resolve prior transcripts by observed host session ID (#4433)”; “fix(search): search every project key a checkout reads; by-file summaries and Azure slugs (#4303)”; “fix(server): one bounded /v1/context read per SessionStart, #3536 folder semantics, main-agent-only filter (#4290)”; “fix(worker): scope every cooldown read to the current Claude account, stop uncapped setup and overflow retries (#4296)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/context/ContextBuilder.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/cli/handlers/session-init.ts src/cli/handlers/session-init.ts:430 — src/cli/handlers/session-init.ts changed 15 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is session-init.fetchServerSemanticContext at line 430), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(grok-bot): skip research sub-agent briefing prompts (#4811) (#4921)”; “fix: bound work-state capture to public turns and recent receipts”; “fix(telemetry): preserve unknown host attribution through capture”; “fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215) (#4380)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/cli/handlers/session-init.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/integrations/opencode-plugin/index.ts src/integrations/opencode-plugin/index.ts:28 — src/integrations/opencode-plugin/index.ts changed 12 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is index.server at line 28), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(opencode): support the V2 plugin contract (#4577)”; “fix(opencode): honor worker host settings and IPv6 addresses (#4445)”; “fix(opencode): retain built-in tool file evidence (#4421)”; “fix(opencode): stop writing memory into the global AGENTS.md; remember a failed context fetch for a minute (#4314)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/integrations/opencode-plugin/index.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/services/telemetry/scrub.ts src/services/telemetry/scrub.ts:241 — src/services/telemetry/scrub.ts changed 19 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is scrub.copyAllowedProperties at line 241), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(telemetry): flag hook_failed escalations that read a pre-latch failure counter (#4835)”; “fix(observer): correct a drifted observer turn instead of letting the model copy it (#3475)”; “fix(worker): preserve rejected observer batches (#3624)”; “fix(observer): surface SDK auth failures in the health ledger (#4154)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/telemetry/scrub.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:117 — REDACTED changed 14 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is DataRoutes.jsonStringifyFields at line 117), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(worker): reject cross-origin loopback writes to /api/import (#5025)”; “Fix Smart timeline and detail scope across merged projects (#4949)”; “fix(chroma): log a corrupt-collection drop at warn level in live write catches (#4909)”; “fix(worker): delete a row's Chroma documents when the delete API removes it (#4813)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/npx-cli/commands/telemetry.ts src/npx-cli/commands/telemetry.ts:146 — src/npx-cli/commands/telemetry.ts changed 14 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is telemetry.runTelemetryEnable at line 146), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(telemetry): flag hook_failed escalations that read a pre-latch failure counter (#4835)”; “fix(observer): correct a drifted observer turn instead of letting the model copy it (#3475)”; “fix(worker): preserve rejected observer batches (#3624)”; “fix(observer): surface SDK auth failures in the health ledger (#4154)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/npx-cli/commands/telemetry.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/build/hook-shell-template.ts src/build/hook-shell-template.ts:127 — src/build/hook-shell-template.ts changed 10 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is candidateBlock at line 127), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hooks): quote unsafe extraEnv values in generated shell commands (#4992)”; “fix(hooks): support Fish when launching POSIX hook commands (#4962)”; “fix(codex): reject a host root without its dependencies in the hook resolver (#4766)”; “fix(hooks): call claude-mem directly — no bash, no console flash on Windows (#4345)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/build/hook-shell-template.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/shared/quota-cooldown.ts src/shared/quota-cooldown.ts:118 — src/shared/quota-cooldown.ts changed 14 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is quota-cooldown.hydrateFromDisk at line 118), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(gemini): stop reading a per-minute throttle as a spent quota (#4089)”; “fix(worker): scope every cooldown read to the current Claude account, stop uncapped setup and overflow retries (#4296)”; “fix(gateway): restore the cmem trial-expiry fallback, single gateway re-probe, and key lock (#4276)”; “fix(worker): scope quota state to the Claude account that recorded it (#4272)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/shared/quota-cooldown.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/services/worker/search/strategies/ChromaSearchStrategy.ts src/services/worker/search/strategies/ChromaSearchStrategy.ts:83 — src/services/worker/search/strategies/ChromaSearchStrategy.ts changed 9 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is ChromaSearchStrategy.executeChromaSearch at line 83), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(search): widen filtered semantic candidates before pagination (#4960)”; “fix(search): make the implicit 90-day recency window configurable (#4773)”; “fix(corpus): preserve the requested observation budget (#4746)”; “fix(search): paginate semantic memories after filtering and merging (#4617)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/search/strategies/ChromaSearchStrategy.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/utils/project-name.ts src/utils/project-name.ts:212 — src/utils/project-name.ts changed 10 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is project-name.parseOriginUrlToSlug at line 212), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(work-view): address Greptile review findings”; “fix(search): search every project key a checkout reads; by-file summaries and Azure slugs (#4303)”; “fix(worktree): trust a deleted checkout only for folder-derived project keys (#4291)”; “fix(worktree): collapse doubled project names and make search honor merged_into_project (#3643)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/utils/project-name.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/cli/claude-md-commands.ts src/cli/claude-md-commands.ts:234 — src/cli/claude-md-commands.ts changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is claude-md-commands.extractRelevantFile at line 234), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude-md): keep the block that generate and regenerate write BMP-only (#2787) (#4993)”; “fix(folder-claude-md): keep newest-first day order when rewriting the by-file timeline (#4886)”; “fix(claude-md): include absolute-path evidence when generating folder CLAUDE.md (#4890)”; “fix(context-files): keep CLAUDE.md/AGENTS.md symlinks when refreshing context (#4784)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/cli/claude-md-commands.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/cli/adapters/claude-code.ts src/cli/adapters/claude-code.ts:30 — src/cli/adapters/claude-code.ts changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is claude-code.normalizeSubmittedPrompt at line 30), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hooks): skip timeline injection on Claude Code resume (#4423)”; “fix(hooks): a failed tool call is still an observation (#4339)”; “fix(cli): honour a host-reported submitted_prompt in session-init (#4215) (#4224)”; “fix(hooks): summarize after another plugin's blocking Stop hook, report unbindable ports as boot failures, keep UserPromptSubmit under its Windows cap (#4299)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/cli/adapters/claude-code.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:114 — REDACTED changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is parser.parseObservationBlocks at line 114), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(parser): retain notes-only summaries and show notes in the viewer (#4388)”; “fix(parser): omit array entries that decode to whitespace (#4397)”; “fix(parser): decode XML character references after extracting values (#4360)”; “fix(observer): correct a drifted observer turn instead of letting the model copy it (#3475)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/shared/cmem-gateway.ts src/shared/cmem-gateway.ts:227 — src/shared/cmem-gateway.ts changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is cmem-gateway.clearProFallback at line 227), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(security): one cmem key lock for every provider pool; mask every secret shape (#4309)”; “fix(gateway): bound unattended resumes and re-probe the gateway when it is the quota fallback (#4306)”; “fix(worker): resume buffered work after observer deadline (#4273)”; “fix(settings): a wrapped settings.json's env block wins over stale root copies, and the cmem fallback marker follows the shared rule (#4286)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/shared/cmem-gateway.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/shared/spawn.ts src/shared/spawn.ts:95 — src/shared/spawn.ts changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is spawn.selectWindowsCommandCandidate at line 95), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent-runner): find and start npm-installed codex and gemini on Windows”; “fix(hooks): call claude-mem directly — no bash, no console flash on Windows (#4345)”; “fix(windows): filter where output to existing paths and add Windows home candidates (#4694) (#4703)”; “fix(observer): report setup error instead of raw spawn crash on Windows/Codex (#4122)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/shared/spawn.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/cli/hook-command.ts src/cli/hook-command.ts:89 — src/cli/hook-command.ts changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is hook-command.hookCommand at line 89), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(telemetry): measure only flushed model-bound hook context”; “fix: flush hook stdout before graceful exit (#4331)”; “fix(hooks): never exit 2 on an unexpected hook error; map stop_hook_active (#3168)”; “fix: never block Claude Code harness on worker outages (#2892)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/cli/hook-command.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/server/generation/providers/OpenRouterObservationProvider.ts src/server/generation/providers/OpenRouterObservationProvider.ts:92 — src/server/generation/providers/OpenRouterObservationProvider.ts changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is OpenRouterObservationProvider.generate at line 92), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(observer): stop reasoning from consuming the output budget (#5029)”; “fix(server): extract text blocks from compatible provider replies (#4542)”; “fix(providers): context overflow recycles, billing-link throttles stay rate limits, pools and server stream right (#4317)”; “fix(server): feed session summaries the whole session, head and tail (#4137)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/server/generation/providers/OpenRouterObservationProvider.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:20 — REDACTED changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is ViewerRoutes.lazyUiHtml at line 20), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(viewer): refuse framing of the viewer UI (#4989)”; “fix(viewer): stop caching a missing UI file for the life of the worker (#4903)”; “fix(viewer): bound restart recovery requests and response bodies (#4529)”; “fix(restart-page): require successor readiness, not just a bound port”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/services/worker/session/recycle-conversation.ts src/services/worker/session/recycle-conversation.ts:43 — src/services/worker/session/recycle-conversation.ts changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is recycle-conversation.loadSessionStartContext at line 43), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(observer): anchor the schema in a system message and make the output cap configurable (#3868)”; “fix(worker): bound observer generations by the context the model actually read (#2957)”; “fix(worker): prevent history amplification after auth failures (#3479)”; “fix(context): keep the outage banner out of the observer's own briefing (#4221) (#4225)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/session/recycle-conversation.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/npx-cli/install/setup-runtime.ts src/npx-cli/install/setup-runtime.ts:334 — src/npx-cli/install/setup-runtime.ts changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is setup-runtime.ensureUv at line 334), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tree-sitter): report a missing or unrunnable CLI correctly on musl (#4866)”; “fix(hooks): call claude-mem directly — no bash, no console flash on Windows (#4345)”; “fix(read-gate): provision tree-sitter for marketplace installs, plan-mode smart tools, eval suite out of plugin/ (#4551)”; “fix(installer): provision tree-sitter-cli past script suppression; warn on install, abort on repair (refs #2910) (#3254)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/npx-cli/install/setup-runtime.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/server/generation/providers/shared/prompt-builder.ts src/server/generation/providers/shared/prompt-builder.ts:46 — src/server/generation/providers/shared/prompt-builder.ts changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is prompt-builder.buildServerGenerationPrompt at line 46), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(server): cut generation prompt overhead (#4681)”; “fix(context): preserve summary notes through next-session rendering”; “fix(worker): preserve rejected observer batches (#3624)”; “fix(server): feed session summaries the whole session, head and tail (#4137)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/server/generation/providers/shared/prompt-builder.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/services/worker/provider-errors.ts src/services/worker/provider-errors.ts:108 — src/services/worker/provider-errors.ts changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ClassifiedProviderError.constructor at line 108), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex): classify deterministic failures; keep subagent rollouts across turns (#4316)”; “fix(providers): context overflow recycles, billing-link throttles stay rate limits, pools and server stream right (#4317)”; “fix(observer): report setup error instead of raw spawn crash on Windows/Codex (#4122)”; “fix(observer): raise the LLM request deadline above gateway latency and migrate the old default (#4278)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/worker/provider-errors.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:109 — REDACTED changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is redaction.redactSensitive at line 109), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(redaction): redact the AWS secret key under its lowercase key name (#5017)”; “fix(redaction): redact PGP private key blocks and encrypted PKCS#8 keys (#5014)”; “fix(redaction): redact keys whose last character is a dash (#4928)”; “fix(redaction): redact GitHub ghu_ user-to-server tokens (#4892)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/services/sync/ChromaSyncState.ts src/services/sync/ChromaSyncState.ts:57 — src/services/sync/ChromaSyncState.ts changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ChromaSyncState.normalizeProjectWatermarks at line 57), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(chroma-sync): retry Windows EPERM renames and keep a failed checkpoint write from aborting backfill (#4877)”; “fix(chroma): recover invalid checkpoint root shapes (#4466)”; “fix(sync): forward revised remote rows to the semantic index (#4432)”; “fix(chroma): drop and rebuild a collection only when its HNSW segment is confirmed corrupt (#3203)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:26:47 -07:00' --until='2026-10-23 20:26:47 -07:00' --full-history --no-merges -- src/services/sync/ChromaSyncState.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 54 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×79
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 54 more in this group — see findings.md.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×60
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:77 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:77-84 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:77-84 | cowork/skills/agent-cost-report/scripts/acr.py:77-84 | openclaw/skills/agent-cost-report/scripts/acr.py:77-84 | plugin/skills/agent-cost-report/scripts/acr.py:77-84 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:104 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:104-110 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:104-110 | cowork/skills/agent-cost-report/scripts/acr.py:104-110 | openclaw/skills/agent-cost-report/scripts/acr.py:104-110 | plugin/skills/agent-cost-report/scripts/acr.py:104-110 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:127 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:127-131 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:127-131 | cowork/skills/agent-cost-report/scripts/acr.py:127-131 | openclaw/skills/agent-cost-report/scripts/acr.py:127-131 | plugin/skills/agent-cost-report/scripts/acr.py:127-131 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:74 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:74-79 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:74-79 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:74-79 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:74-79 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:74-79 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:88 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:88-95 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:88-95 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:88-95 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:88-95 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:88-95 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:104 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:104-109 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:171 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:171-177 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:181 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:181-188 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:198 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:198-202 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:198-202 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:198-202 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:198-202 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:198-202 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:216 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:216-221 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:216-221 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:216-221 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:216-221 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:216-221 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:247 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:247-260 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:247-260 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:247-260 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:247-260 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:247-260 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:264 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:264-275 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:264-275 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:264-275 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:264-275 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:264-275 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:44 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:44-53 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/classify.py:44-53 | cowork/skills/agent-cost-report/scripts/acr/classify.py:44-53 | openclaw/skills/agent-cost-report/scripts/acr/classify.py:44-53 | plugin/skills/agent-cost-report/scripts/acr/classify.py:44-53 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:25 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:25-29 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:25-29 | cowork/skills/agent-cost-report/scripts/acr/costs.py:25-29 | openclaw/skills/agent-cost-report/scripts/acr/costs.py:25-29 | plugin/skills/agent-cost-report/scripts/acr/costs.py:25-29 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:102 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:102-121 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:102-121 | cowork/skills/agent-cost-report/scripts/acr/costs.py:102-121 | openclaw/skills/agent-cost-report/scripts/acr/costs.py:102-121 | plugin/skills/agent-cost-report/scripts/acr/costs.py:102-121 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:52 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:52-57 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py:52-57 | cowork/skills/agent-cost-report/scripts/acr/devices.py:52-57 | openclaw/skills/agent-cost-report/scripts/acr/devices.py:52-57 | plugin/skills/agent-cost-report/scripts/acr/devices.py:52-57 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:55 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:55-67 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:71 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:71-77 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:71-77 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:71-77 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:71-77 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:71-77 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:158 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:158-165 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:158-165 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:158-165 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:158-165 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:158-165 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:42 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:42-57 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:42-57 | cowork/skills/agent-cost-report/scripts/acr/labels.py:42-57 | openclaw/skills/agent-cost-report/scripts/acr/labels.py:42-57 | plugin/skills/agent-cost-report/scripts/acr/labels.py:42-57 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:70 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:70-74 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:70-74 | cowork/skills/agent-cost-report/scripts/acr/labels.py:70-74 | openclaw/skills/agent-cost-report/scripts/acr/labels.py:70-74 | plugin/skills/agent-cost-report/scripts/acr/labels.py:70-74 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:75 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:75-89 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:75-89 | cowork/skills/agent-cost-report/scripts/acr/measure.py:75-89 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:75-89 | plugin/skills/agent-cost-report/scripts/acr/measure.py:75-89 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:50 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:50-57 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:50-57 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:50-57 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:50-57 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:50-57 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:65 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:65-72 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:65-72 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:65-72 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:65-72 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:65-72 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:83 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:83-95 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:83-95 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:83-95 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:83-95 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:83-95 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • + 35 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×57
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:68 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:68-72 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:68-72 | cowork/skills/agent-cost-report/scripts/acr.py:68-72 | openclaw/skills/agent-cost-report/scripts/acr.py:68-72 | plugin/skills/agent-cost-report/scripts/acr.py:68-72 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:74 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:74-78 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:74-78 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:74-78 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:74-78 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:74-78 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:88 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:88-92 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:88-92 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:88-92 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:88-92 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:88-92 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:117 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:117-121 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:117-121 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:117-121 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:117-121 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:117-121 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:216 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:216-220 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:216-220 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:216-220 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:216-220 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:216-220 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:303 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:303-307 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:303-307 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:303-307 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:303-307 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:303-307 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:309 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:309-313 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:309-313 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:309-313 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:309-313 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:309-313 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:57 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:57-61 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/classify.py:57-61 | cowork/skills/agent-cost-report/scripts/acr/classify.py:57-61 | openclaw/skills/agent-cost-report/scripts/acr/classify.py:57-61 | plugin/skills/agent-cost-report/scripts/acr/classify.py:57-61 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/classify.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:74 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:74-78 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:74-78 | cowork/skills/agent-cost-report/scripts/acr/costs.py:74-78 | openclaw/skills/agent-cost-report/scripts/acr/costs.py:74-78 | plugin/skills/agent-cost-report/scripts/acr/costs.py:74-78 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:80 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:80-84 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:80-84 | cowork/skills/agent-cost-report/scripts/acr/costs.py:80-84 | openclaw/skills/agent-cost-report/scripts/acr/costs.py:80-84 | plugin/skills/agent-cost-report/scripts/acr/costs.py:80-84 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:67 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:67-71 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py:67-71 | cowork/skills/agent-cost-report/scripts/acr/devices.py:67-71 | openclaw/skills/agent-cost-report/scripts/acr/devices.py:67-71 | plugin/skills/agent-cost-report/scripts/acr/devices.py:67-71 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 4 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:125 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:125-129 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:125-129 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:125-129 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:125-129 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:125-129 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:138 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:138-142 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:138-142 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:138-142 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:138-142 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:138-142 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:158 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:158-162 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:158-162 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:158-162 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:158-162 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:158-162 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:22 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:22-26 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:22-26 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:22-26 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:22-26 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:22-26 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:65 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:65-69 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:65-69 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:65-69 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:65-69 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:65-69 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:259 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:259-263 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:259-263 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:259-263 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:259-263 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:259-263 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:202 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:202-206 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:202-206 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:202-206 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:202-206 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:202-206 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:51 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:51-55 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:51-55 | cowork/skills/agent-cost-report/scripts/acr/prices.py:51-55 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:51-55 | plugin/skills/agent-cost-report/scripts/acr/prices.py:51-55 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:98 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:98-102 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:98-102 | cowork/skills/agent-cost-report/scripts/acr/prices.py:98-102 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:98-102 | plugin/skills/agent-cost-report/scripts/acr/prices.py:98-102 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:395 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:395-399 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:395-399 | cowork/skills/agent-cost-report/scripts/acr/render.py:395-399 | openclaw/skills/agent-cost-report/scripts/acr/render.py:395-399 | plugin/skills/agent-cost-report/scripts/acr/render.py:395-399 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:481 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:481-485 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:481-485 | cowork/skills/agent-cost-report/scripts/acr/render.py:481-485 | openclaw/skills/agent-cost-report/scripts/acr/render.py:481-485 | plugin/skills/agent-cost-report/scripts/acr/render.py:481-485 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:49 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:49-53 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:49-53 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:49-53 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:49-53 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:49-53 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:67 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:67-71 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:67-71 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:67-71 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:67-71 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:67-71 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:135 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:135-139 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:135-139 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:135-139 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:135-139 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:135-139 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 32 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking REDACTED:562 — `fs.mkdirSync` in `createEvalArm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:566 — `fs.writeFileSync` in `createEvalArm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:568 — `fs.writeFileSync` in `createEvalArm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:907 — `fs.readFileSync` in `seedObservationDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:931 — `fs.writeFileSync` in `seedObservationDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:1513 — `fs.mkdirSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:1541 — `fs.writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:1567 — `fs.existsSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:1570 — `fs.readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:1574 — `fs.writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:1575 — `fs.writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:133 — `statSync` in `exportMemories` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:141 — `writeFileSync` in `exportMemories` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:746 — `existsSync` in `refreshAgent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:757 — `existsSync` in `refreshAgent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:757 — `readFileSync` in `refreshAgent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:811 — `existsSync` in `refreshAgent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:811 — `readFileSync` in `refreshAgent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:824 — `existsSync` in `stampBucketMtime` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:824 — `readFileSync` in `stampBucketMtime` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:827 — `existsSync` in `stampBucketMtime` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/grok-bot-session-inject.mjs:827 — `readFileSync` in `stampBucketMtime` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:705 — `rmSync` in `runMatrix` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking src/cli/claude-md-commands.ts:464 — `existsSync` in `generateClaudeMd` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking src/cli/claude-md-commands.ts:550 — `readdirSync` in `walkForClaudeMd` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 15 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file src/ui/my-work/src/pages/my-rules.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/pages/my-goals.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/strip-comments.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/regenerate-claude-md.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/ai-elements/commit.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/pages/my-work.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/integrations/dsh-plugin/tools.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file workers/sync-hub/canary/canary.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/translate-readme/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/launcher/claude-mem-launcher.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/ai-elements/inline-citation.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/ai-elements/queue.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/ai-elements/terminal.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/bits.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/ui/dropdown-menu.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/bug-report/cli.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/ui/carousel.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file ragtime/ragtime.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/App.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/translate-readme/cli.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/ai-elements/chain-of-thought.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/components/request-detail.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/ui/my-work/src/data-goals.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 15 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×39
  • FileTooLong: sqlite/SessionStore.ts src/services/sqlite/SessionStore.ts — FileTooLong — 3262 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: SessionStore (228-4827). The bar is 500 significant lines; this is 2762 over it, 6.52× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2074 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1574 over it, 4.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: v1/ServerV1PostgresRoutes.ts src/server/routes/v1/ServerV1PostgresRoutes.ts — FileTooLong — 1660 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: ServerV1PostgresRoutes (133-2007). The bar is 500 significant lines; this is 1160 over it, 3.32× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: sync/CloudSync.ts src/services/sync/CloudSync.ts — FileTooLong — 1459 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: CloudSync (567-2204). The bar is 500 significant lines; this is 959 over it, 2.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: sync/ChromaSync.ts src/services/sync/ChromaSync.ts — FileTooLong — 1380 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: ChromaSync (292-2254). The bar is 500 significant lines; this is 880 over it, 2.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1300 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 800 over it, 2.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1295 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: ChromaMcpManager (251-2308). The bar is 500 significant lines; this is 795 over it, 2.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1279 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 779 over it, 2.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1068 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 568 over it, 2.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 494 over it, 1.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: servers/mcp-server.ts src/servers/mcp-server.ts — FileTooLong — 968 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 468 over it, 1.94× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: sync/SyncApply.ts src/services/sync/SyncApply.ts — FileTooLong — 946 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: SyncApply (373-1645). The bar is 500 significant lines; this is 446 over it, 1.89× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: worker/SearchManager.ts src/services/worker/SearchManager.ts — FileTooLong — 828 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SearchManager (41-1263). The bar is 500 significant lines; this is 328 over it, 1.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: worker/ClaudeProvider.ts src/services/worker/ClaudeProvider.ts — FileTooLong — 820 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: ClaudeProvider (301-1441). The bar is 500 significant lines; this is 320 over it, 1.64× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 311 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: sync/SyncClient.ts src/services/sync/SyncClient.ts — FileTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: SyncClient (272-1318). The bar is 500 significant lines; this is 299 over it, 1.60× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: agents/ResponseProcessor.ts src/services/worker/agents/ResponseProcessor.ts — FileTooLong — 788 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 288 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: scripts/build-hooks.js scripts/build-hooks.js — FileTooLong — 775 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: buildHooks (442-1205). The bar is 500 significant lines; this is 275 over it, 1.55× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: worker/CodexAppServerClient.ts src/services/worker/CodexAppServerClient.ts — FileTooLong — 756 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 256 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/store.ts services/sync-api/src/store.ts — FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: Tx (221-971). The bar is 500 significant lines; this is 254 over it, 1.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: sqlite/SessionSearch.ts src/services/sqlite/SessionSearch.ts — FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 254 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED workers/sync-hub/src/index.ts — FileTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 232 over it, 1.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: do/SyncHub.ts workers/sync-hub/src/do/SyncHub.ts — FileTooLong — 711 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: SyncHub (183-954). The bar is 500 significant lines; this is 211 over it, 1.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: SessionRoutes (68-1138). The bar is 500 significant lines; this is 207 over it, 1.41× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: transcripts/watcher.ts src/services/transcripts/watcher.ts — FileTooLong — 702 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 202 over it, 1.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 14 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×39
  • FunctionTooLong: ContextSettingsModal.ContextSettingsModal src/ui/viewer/components/ContextSettingsModal.tsx:144 — FunctionTooLong — ContextSettingsModal runs 574 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 474 over it, 5.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: build-hooks.buildHooks scripts/build-hooks.js:442 — FunctionTooLong — buildHooks runs 544 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 444 over it, 5.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: LogsModal.LogsDrawer src/ui/viewer/components/LogsModal.tsx:73 — FunctionTooLong — LogsDrawer runs 359 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 259 over it, 3.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: install.runInstallCommandInner REDACTED:2653 — FunctionTooLong — runInstallCommandInner runs 355 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 255 over it, 3.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.claudeMemPlugin REDACTED:630 — FunctionTooLong — claudeMemPlugin runs 353 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 253 over it, 3.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ResponseProcessor.processAgentResponse src/services/worker/agents/ResponseProcessor.ts:419 — FunctionTooLong — processAgentResponse runs 322 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 222 over it, 3.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: worker-service.main REDACTED:1475 — FunctionTooLong — main runs 306 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 206 over it, 3.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: App.App src/ui/viewer/App.tsx:54 — FunctionTooLong — App runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: to-work-model.cleanText src/ui/my-work/src/live/to-work-model.ts:42 — FunctionTooLong — cleanText runs 276 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 176 over it, 2.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: schema.ensureServerStorageSchema src/storage/sqlite/schema.ts:21 — FunctionTooLong — ensureServerStorageSchema runs 242 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 142 over it, 2.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: GeneratorRunner.startGeneratorWithProvider src/services/worker/session/GeneratorRunner.ts:135 — FunctionTooLong — startGeneratorWithProvider runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: install.makeIDETask REDACTED:291 — FunctionTooLong — makeIDETask runs 227 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agent-view.buildAgentView src/services/work-view/agent-view.mjs:158 — FunctionTooLong — buildAgentView runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: WorktreeAdoption.adoptMergedWorktrees src/services/infrastructure/WorktreeAdoption.ts:492 — FunctionTooLong — adoptMergedWorktrees runs 206 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 106 over it, 2.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: request-projection.buildHumanRequests src/services/work-view/request-projection.mjs:97 — FunctionTooLong — buildHumanRequests runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.claudeMemPi src/integrations/pi-extension/index.ts:81 — FunctionTooLong — claudeMemPi runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: processGeneratedResponse.persistGeneratedObservations src/server/generation/processGeneratedResponse.ts:293 — FunctionTooLong — persistGeneratedObservations runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.main src/npx-cli/index.ts:144 — FunctionTooLong — main runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mcp-http.startMcpHttpServer src/servers/mcp-http.ts:241 — FunctionTooLong — startMcpHttpServer runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: uninstall.runUninstallCommand src/npx-cli/commands/uninstall.ts:254 — FunctionTooLong — runUninstallCommand runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: refresh-task.buildRefreshTask src/services/work-view/refresh-task.ts:103 — FunctionTooLong — buildRefreshTask runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: my-rules.MyRules src/ui/my-work/src/pages/my-rules.tsx:634 — FunctionTooLong — MyRules runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: backfill.collectDailyRollups src/services/telemetry/backfill.ts:189 — FunctionTooLong — collectDailyRollups runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: worker-spawner.ensureWorkerStarted src/services/worker-spawner.ts:179 — FunctionTooLong — ensureWorkerStarted runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: worker-utils.ensureWorkerRunning REDACTED:1242 — FunctionTooLong — ensureWorkerRunning runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×36
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:102 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:102-107 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:102-107 | cowork/skills/agent-cost-report/scripts/acr/costs.py:102-107 | openclaw/skills/agent-cost-report/scripts/acr/costs.py:102-107 | plugin/skills/agent-cost-report/scripts/acr/costs.py:102-107 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:37 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:37-42 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py:37-42 | cowork/skills/agent-cost-report/scripts/acr/devices.py:37-42 | openclaw/skills/agent-cost-report/scripts/acr/devices.py:37-42 | plugin/skills/agent-cost-report/scripts/acr/devices.py:37-42 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 4 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:71 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:71-76 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:71-76 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:71-76 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:71-76 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:71-76 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:54 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:54-59 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:54-59 | cowork/skills/agent-cost-report/scripts/acr/measure.py:54-59 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:54-59 | plugin/skills/agent-cost-report/scripts/acr/measure.py:54-59 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:50 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:50-55 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:50-55 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:50-55 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:50-55 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:50-55 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:268 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:268-273 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:268-273 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:268-273 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:268-273 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:268-273 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:130 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:130-135 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:130-135 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:130-135 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:130-135 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:130-135 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:284 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:284-289 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:284-289 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:284-289 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:284-289 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:284-289 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/period.py:85 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/period.py:85-90 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/period.py:85-90 | cowork/skills/agent-cost-report/scripts/acr/period.py:85-90 | openclaw/skills/agent-cost-report/scripts/acr/period.py:85-90 | plugin/skills/agent-cost-report/scripts/acr/period.py:85-90 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/period.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/period.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:87 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:87-92 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:87-92 | cowork/skills/agent-cost-report/scripts/acr/prices.py:87-92 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:87-92 | plugin/skills/agent-cost-report/scripts/acr/prices.py:87-92 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:160 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:160-165 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:160-165 | cowork/skills/agent-cost-report/scripts/acr/render.py:160-165 | openclaw/skills/agent-cost-report/scripts/acr/render.py:160-165 | plugin/skills/agent-cost-report/scripts/acr/render.py:160-165 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:128 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:128-133 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:128-133 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:128-133 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:128-133 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:128-133 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:179 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:179-184 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:179-184 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:179-184 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:179-184 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:179-184 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rules.py:63 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rules.py:63-68 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rules.py:63-68 | cowork/skills/agent-cost-report/scripts/acr/rules.py:63-68 | openclaw/skills/agent-cost-report/scripts/acr/rules.py:63-68 | plugin/skills/agent-cost-report/scripts/acr/rules.py:63-68 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rules.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rules.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 4 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:115 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:115-120 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:115-120 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:115-120 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:115-120 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:115-120 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:172 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:172-177 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:172-177 | cowork/skills/agent-cost-report/scripts/acr/wins.py:172-177 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:172-177 | plugin/skills/agent-cost-report/scripts/acr/wins.py:172-177 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:245 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:245-250 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:245-250 | cowork/skills/agent-cost-report/scripts/acr/wins.py:245-250 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:245-250 | plugin/skills/agent-cost-report/scripts/acr/wins.py:245-250 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:320 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:320-325 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:320-325 | cowork/skills/agent-cost-report/scripts/acr/wins.py:320-325 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:320-325 | plugin/skills/agent-cost-report/scripts/acr/wins.py:320-325 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:88 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:88-93 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:88-93 | cowork/skills/agent-cost-report/scripts/acr.py:88-93 | openclaw/skills/agent-cost-report/scripts/acr.py:88-93 | plugin/skills/agent-cost-report/scripts/acr.py:88-93 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:61 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:61-66 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:61-66 | cowork/skills/agent-cost-report/scripts/acr/labels.py:61-66 | openclaw/skills/agent-cost-report/scripts/acr/labels.py:61-66 | plugin/skills/agent-cost-report/scripts/acr/labels.py:61-66 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:104 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:104-109 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:104-109 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:148 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:148-153 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:148-153 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:148-153 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:148-153 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:148-153 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:148` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:154 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:154-159 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:154-159 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:154-159 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:154-159 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:154-159 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:52 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:52-57 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py:52-57 | cowork/skills/agent-cost-report/scripts/acr/devices.py:52-57 | openclaw/skills/agent-cost-report/scripts/acr/devices.py:52-57 | plugin/skills/agent-cost-report/scripts/acr/devices.py:52-57 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 4 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:217 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:217-222 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:217-222 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:217-222 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:217-222 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:217-222 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×32
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:77 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:77-83 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:77-83 | cowork/skills/agent-cost-report/scripts/acr.py:77-83 | openclaw/skills/agent-cost-report/scripts/acr.py:77-83 | plugin/skills/agent-cost-report/scripts/acr.py:77-83 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:140 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:140-146 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:140-146 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:140-146 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:140-146 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:140-146 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:225 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:225-231 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:225-231 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:225-231 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:225-231 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:225-231 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:247 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:247-253 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:247-253 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:247-253 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:247-253 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:247-253 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:295 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:295-301 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:295-301 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:295-301 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:295-301 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:295-301 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:146 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:146-152 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:146-152 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:146-152 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:146-152 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:146-152 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:188 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:188-194 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:188-194 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:188-194 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:188-194 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:188-194 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:187 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:187-193 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:187-193 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:187-193 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:187-193 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:187-193 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:243 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:243-249 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:243-249 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:243-249 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:243-249 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:243-249 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:459 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:459-465 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:459-465 | cowork/skills/agent-cost-report/scripts/acr/render.py:459-465 | openclaw/skills/agent-cost-report/scripts/acr/render.py:459-465 | plugin/skills/agent-cost-report/scripts/acr/render.py:459-465 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:325 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:325-331 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:325-331 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:325-331 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:325-331 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:325-331 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:44 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:44-50 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:44-50 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:44-50 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:44-50 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:44-50 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:86 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:86-92 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:86-92 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:86-92 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:86-92 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:86-92 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:121 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:121-127 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:121-127 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:121-127 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:121-127 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:121-127 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:160 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:160-166 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:160-166 | cowork/skills/agent-cost-report/scripts/acr/wins.py:160-166 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:160-166 | plugin/skills/agent-cost-report/scripts/acr/wins.py:160-166 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:258 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:258-264 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:258-264 | cowork/skills/agent-cost-report/scripts/acr/wins.py:258-264 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:258-264 | plugin/skills/agent-cost-report/scripts/acr/wins.py:258-264 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:291 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:291-297 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:291-297 | cowork/skills/agent-cost-report/scripts/acr/wins.py:291-297 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:291-297 | plugin/skills/agent-cost-report/scripts/acr/wins.py:291-297 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/period.py:22 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/period.py:22-28 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/period.py:22-28 | cowork/skills/agent-cost-report/scripts/acr/period.py:22-28 | openclaw/skills/agent-cost-report/scripts/acr/period.py:22-28 | plugin/skills/agent-cost-report/scripts/acr/period.py:22-28 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/period.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/period.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:184 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:184-190 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:184-190 | cowork/skills/agent-cost-report/scripts/acr/wins.py:184-190 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:184-190 | plugin/skills/agent-cost-report/scripts/acr/wins.py:184-190 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:104 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:104-110 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:104-110 | cowork/skills/agent-cost-report/scripts/acr.py:104-110 | openclaw/skills/agent-cost-report/scripts/acr.py:104-110 | plugin/skills/agent-cost-report/scripts/acr.py:104-110 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:160 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:160-166 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:160-166 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:160-166 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:160-166 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:160-166 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:171 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:171-177 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:171-177 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:254 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:254-260 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:254-260 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:254-260 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:254-260 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:254-260 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:44 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:44-50 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/classify.py:44-50 | cowork/skills/agent-cost-report/scripts/acr/classify.py:44-50 | openclaw/skills/agent-cost-report/scripts/acr/classify.py:44-50 | plugin/skills/agent-cost-report/scripts/acr/classify.py:44-50 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/classify.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:40 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:40-46 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:40-46 | cowork/skills/agent-cost-report/scripts/acr/measure.py:40-46 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:40-46 | plugin/skills/agent-cost-report/scripts/acr/measure.py:40-46 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • + 7 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×24
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×24
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:77 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:91 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:122 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:131 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:60 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:99 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:130 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:136 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:77 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:91 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:122 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:131 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:60 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:99 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:130 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:136 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/scripts/cmem-hook.mjs:222 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/skills/agent-cost-report/scripts/acr/wins.py:77 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/skills/agent-cost-report/scripts/acr/wins.py:91 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/skills/agent-cost-report/scripts/acr/wins.py:122 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/skills/agent-cost-report/scripts/acr/wins.py:131 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/skills/agent-cost-report/scripts/acr/transcripts.py:60 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/skills/agent-cost-report/scripts/acr/transcripts.py:99 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) cowork/skills/agent-cost-report/scripts/acr/behavior.py:130 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D10 · Test Quality · Fixed-sleep synchronisation · ×23
  • Fixed-sleep synchronisation: ends a stalled transaction so it cannot keep holding a user's lock services/sync-api/test/lock-hold.test.ts:191 — This test starts work it did not wait for (`stalled`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: serializes concurrent failure writes so the warning threshold is never lost tests/observer-health.test.ts:262 — This test starts work it did not wait for (`writers`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(500)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: allows only one concurrent process to claim the latch tests/cli/worker-failure-latch.test.ts:131 — This test starts work it did not wait for (`workers`, still running when the sleep starts) and then orders itself against it with `new Promise(resolve => setTimeout(resolve, 200))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: waits through recovery lock contention so the next outage can escalate tests/cli/worker-failure-latch.test.ts:182 — This test starts work it did not wait for (`recovery`, still running when the sleep starts) and then orders itself against it with `new Promise(resolve => setTimeout(resolve, 1_200))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: re-renders every variant when Realtime joins, and removes the files when it drops tests/context/context-cache.test.ts:493 — This test starts work it did not wait for (`service`, still running when the sleep starts) and then orders itself against it with `new Promise(resolve => setTimeout(resolve, 40))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: admits at most maxConcurrent concurrent callers before any process registers tests/supervisor/wait-for-slot.test.ts:73 — This test starts work it did not wait for (`grants`, still running when the sleep starts) and then orders itself against it with `sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: holds the reserved slot until the reservation is released tests/supervisor/wait-for-slot.test.ts:93 — This test starts work it did not wait for (`second`, still running when the sleep starts) and then orders itself against it with `sleep(30)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: release is idempotent: double-releasing frees only one slot tests/supervisor/wait-for-slot.test.ts:110 — This test starts work it did not wait for (`fourth`, still running when the sleep starts) and then orders itself against it with `sleep(30)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: counts a registered process and its released reservation as one occupant tests/supervisor/wait-for-slot.test.ts:134 — This test starts work it did not wait for (`next`, still running when the sleep starts) and then orders itself against it with `sleep(30)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: never runs two drains at once and coalesces requests made during a drain into one more pass tests/worker/hook-spool-drain.test.ts:343 — This test starts work it did not wait for (`first`, still running when the sleep starts) and then orders itself against it with `new Promise(resolve => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: a concurrent call landing while a provider-switch-while-parked call is mid-flight does not double-start the new provider tests/worker/http/routes/session-routes-provider-switch.test.ts:527 — This test starts work it did not wait for (`p1`, still running when the sleep starts) and then orders itself against it with `new Promise(resolve => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: swallows failures (pull never throws, cursor unmoved) and recovers on the next pull tests/worker/sync/sync-client.test.ts:262 — This test starts work it did not wait for (`client`, still running when the sleep starts) and then orders itself against it with `sleep(20)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: pauses the poll loop on a 401/403 instead of retrying on the normal ladder tests/worker/sync/sync-client.test.ts:288 — This test starts work it did not wait for (`client`, still running when the sleep starts) and then orders itself against it with `sleep(300)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: rejects HTTP pages that do not start at cursor+1 or contain an internal sequence gap tests/worker/sync/sync-client.test.ts:359 — This test starts work it did not wait for (`client`, still running when the sleep starts) and then orders itself against it with `sleep(60)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: suspends entirely after the no-session window, and pullOnce resumes the loop tests/worker/sync/sync-client.test.ts:433 — This test starts work it did not wait for (`client`, still running when the sleep starts) and then orders itself against it with `sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: stop() halts the loop and makes pullOnce/onHeadSeq inert tests/worker/sync/sync-client.test.ts:487 — This test starts work it did not wait for (`client`, still running when the sleep starts) and then orders itself against it with `sleep(30)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: suspension tears the socket down; the session-start pull resumes it tests/worker/sync/sync-client-realtime.test.ts:767 — This test starts work it did not wait for (`client`, still running when the sleep starts) and then orders itself against it with `sleep(60)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: keeps an in-flight snapshot immutable and queues a higher rev for same-rev local drift tests/worker/sync/cloud-sync.test.ts:1031 — This test starts work it did not wait for (`flushing`, still running when the sleep starts) and then orders itself against it with `sleep(2)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: keeps an acked snapshot committed when in-flight local drift becomes invalid tests/worker/sync/cloud-sync.test.ts:1067 — This test starts work it did not wait for (`sync`, still running when the sleep starts) and then orders itself against it with `sleep(2)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: does not stamp a prompt whose sync_rev was bumped mid-flight; re-pushes corrected tests/worker/sync/cloud-sync.test.ts:1799 — This test starts work it did not wait for (`flushPromise`, still running when the sleep starts) and then orders itself against it with `sleep(2)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: stop() mid-flight halts stamping, further DB access, and retry re-arming tests/worker/sync/cloud-sync.test.ts:1969 — This test starts work it did not wait for (`flushPromise`, still running when the sleep starts) and then orders itself against it with `sleep(2)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: keeps an AbortSignal-ignoring delayed HTTP predecessor fenced through 90s, then safely replays workers/sync-hub/test/sync-hub.test.ts:531 — This test starts work it did not wait for (`stub`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 100))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: tripped ⇒ a bounded inline catch-up does not continue in the background workers/sync-hub/test/kill-switch.test.ts:178 — This test starts work it did not wait for (`stub`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 250))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D10 · Test Quality · Skipped test · ×22
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/compat/sessions-observations-adapter.test.ts:30 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/session-start-context-from-store.test.ts:30 — Skipped — switched off by it.skip
  • Skipped test: postgres integration tests skipped (set CLAUDE_MEM_TEST_POSTGRES_URL to enable) tests/server/server-service.test.ts:262 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/semantic-context-route.test.ts:29 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/paid-readiness.test.ts:47 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/data-deletion.test.ts:27 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/context-recency-mode.test.ts:26 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/connect-keys.test.ts:29 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/generation/summary-starved-input.test.ts:92 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/generation/scope-enforcement.test.ts:39 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/generation/reclaim-stale-processing-jobs.test.ts:26 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/generation/provider-observation-generator.test.ts:35 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL for Postgres integration tests/server/generation/process-generated-response.test.ts:23 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/generation/generation-attempt-fencing.test.ts:35 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/runtime/team-project-jobs-routes.test.ts:21 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/runtime/server-session-runtime.test.ts:31 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/runtime/server-session-routes.test.ts:21 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/runtime/server-mcp-routes.test.ts:29 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/runtime/server-mcp-http-routes.test.ts:35 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/runtime/memories-generation-key.test.ts:13 — Skipped — switched off by it.skip
  • Skipped test: requires CLAUDE_MEM_TEST_POSTGRES_URL tests/server/runtime/jobs-list-and-operator-routes.test.ts:25 — Skipped — switched off by it.skip
  • Skipped test: requires explicit CLAUDE_MEM_TEST_POSTGRES_URL for Postgres integration tests tests/storage/postgres/postgres-storage.test.ts:90 — Skipped — switched off by it.skip
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×21
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:88 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:88-95 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:88-95 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:88-95 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:88-95 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:88-95 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:30 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:30-37 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:30-37 | cowork/skills/agent-cost-report/scripts/acr/measure.py:30-37 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:30-37 | plugin/skills/agent-cost-report/scripts/acr/measure.py:30-37 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:83 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:83-90 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:83-90 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:83-90 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:83-90 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:83-90 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:42 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:42-49 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:42-49 | cowork/skills/agent-cost-report/scripts/acr/prices.py:42-49 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:42-49 | plugin/skills/agent-cost-report/scripts/acr/prices.py:42-49 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:493 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:493-500 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:493-500 | cowork/skills/agent-cost-report/scripts/acr/render.py:493-500 | openclaw/skills/agent-cost-report/scripts/acr/render.py:493-500 | plugin/skills/agent-cost-report/scripts/acr/render.py:493-500 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:528 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:528-535 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:528-535 | cowork/skills/agent-cost-report/scripts/acr/render.py:528-535 | openclaw/skills/agent-cost-report/scripts/acr/render.py:528-535 | plugin/skills/agent-cost-report/scripts/acr/render.py:528-535 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/sync.py:69 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/sync.py:69-76 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/sync.py:69-76 | cowork/skills/agent-cost-report/scripts/acr/sync.py:69-76 | openclaw/skills/agent-cost-report/scripts/acr/sync.py:69-76 | plugin/skills/agent-cost-report/scripts/acr/sync.py:69-76 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/sync.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/sync.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 4 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:94 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:94-101 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:94-101 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:94-101 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:94-101 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:94-101 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:236 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:236-243 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:236-243 | cowork/skills/agent-cost-report/scripts/acr/wins.py:236-243 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:236-243 | plugin/skills/agent-cost-report/scripts/acr/wins.py:236-243 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:181 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:181-188 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:181-188 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:268 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:268-275 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:268-275 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:268-275 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:268-275 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:268-275 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:64 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:64-71 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:64-71 | cowork/skills/agent-cost-report/scripts/acr/measure.py:64-71 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:64-71 | plugin/skills/agent-cost-report/scripts/acr/measure.py:64-71 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:173 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:173-180 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:173-180 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:173-180 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:173-180 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:173-180 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:208 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:208-215 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:208-215 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:208-215 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:208-215 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:208-215 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:208` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:257 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:257-264 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:257-264 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:257-264 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:257-264 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:257-264 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:193 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:193-200 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:193-200 | cowork/skills/agent-cost-report/scripts/acr/render.py:193-200 | openclaw/skills/agent-cost-report/scripts/acr/render.py:193-200 | plugin/skills/agent-cost-report/scripts/acr/render.py:193-200 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:327 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:327-334 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:327-334 | cowork/skills/agent-cost-report/scripts/acr/render.py:327-334 | openclaw/skills/agent-cost-report/scripts/acr/render.py:327-334 | plugin/skills/agent-cost-report/scripts/acr/render.py:327-334 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:232 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:232-239 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:232-239 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:232-239 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:232-239 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:232-239 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:211 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:211-218 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:211-218 | cowork/skills/agent-cost-report/scripts/acr/wins.py:211-218 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:211-218 | plugin/skills/agent-cost-report/scripts/acr/wins.py:211-218 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:266 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:266-273 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:266-273 | cowork/skills/agent-cost-report/scripts/acr/wins.py:266-273 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:266-273 | plugin/skills/agent-cost-report/scripts/acr/wins.py:266-273 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:282 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:282-289 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:282-289 | cowork/skills/agent-cost-report/scripts/acr/wins.py:282-289 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:282-289 | plugin/skills/agent-cost-report/scripts/acr/wins.py:282-289 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D3 · God Classes · MethodTooLong · ×20
  • MethodTooLong: ServerV1PostgresRoutes.setupRoutes src/server/routes/v1/ServerV1PostgresRoutes.ts:161 — MethodTooLong — setupRoutes runs 837 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 737 over it, 8.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ClaudeProvider.startSession src/services/worker/ClaudeProvider.ts:372 — MethodTooLong — startSession runs 358 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 258 over it, 3.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SearchManager.search src/services/worker/SearchManager.ts:442 — MethodTooLong — search runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ServerV1Routes.setupRoutes REDACTED:62 — MethodTooLong — setupRoutes runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WorkerService.initializeBackground REDACTED:718 — MethodTooLong — initializeBackground runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OpenRouterProvider.queryOpenRouterMultiTurn src/services/worker/OpenRouterProvider.ts:954 — MethodTooLong — queryOpenRouterMultiTurn runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SessionStore.getTimelineAroundObservation src/services/sqlite/SessionStore.ts:4288 — MethodTooLong — getTimelineAroundObservation runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SearchManager.timeline src/services/worker/SearchManager.ts:792 — MethodTooLong — timeline runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: GeminiProvider.queryGeminiMultiTurn src/services/worker/GeminiProvider.ts:453 — MethodTooLong — queryGeminiMultiTurn runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChromaMcpManager.connectInternal REDACTED:372 — MethodTooLong — connectInternal runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SettingsRoutes.validateSettings REDACTED:354 — MethodTooLong — validateSettings runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChromaMcpManager.prewarmChromaMcp REDACTED:1222 — MethodTooLong — prewarmChromaMcp runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OpenAICompatProvider.queryChatCompletions src/services/worker/OpenAICompatProvider.ts:622 — MethodTooLong — queryChatCompletions runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SessionManager.initializeSession src/services/worker/SessionManager.ts:252 — MethodTooLong — initializeSession runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.setupCoreRoutes REDACTED:440 — MethodTooLong — setupCoreRoutes runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PostgresObservationRepository.searchHybrid src/storage/postgres/observations.ts:407 — MethodTooLong — searchHybrid runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SessionRoutes.ensureGeneratorRunningLocked REDACTED:245 — MethodTooLong — ensureGeneratorRunningLocked runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ProviderObservationGenerator.process src/server/generation/ProviderObservationGenerator.ts:168 — MethodTooLong — process runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ServerV1PostgresRoutes.retryGenerationJob src/server/routes/v1/ServerV1PostgresRoutes.ts:1708 — MethodTooLong — retryGenerationJob runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChromaSync.addDocuments src/services/sync/ChromaSync.ts:727 — MethodTooLong — addDocuments runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D29 · Static Analysis (SAST) · REDACTED · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X3 · Exception handling · Swallowed exception (empty catch) · ×16
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:42 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:50 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:213 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:227 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:230 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:244 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:255 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:266 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:299 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:303 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:318 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:339 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:407 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:413 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:435 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) cowork/scripts/cmem-hook.mjs:566 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
X2 · Cancellation propagation · Async function without AbortSignal · ×15
  • Async function without AbortSignal: workerPost REDACTED:311 — `workerPost` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: workerGetText REDACTED:368 — `workerGetText` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: sendDirectTelegram REDACTED:471 — `sendDirectTelegram` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: telegramCall REDACTED:106 — `telegramCall` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: waitForQueueToEmpty ragtime/ragtime.ts:115 — `waitForQueueToEmpty` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: importMemories REDACTED:15 — `importMemories` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: postToDiscord REDACTED:53 — `postToDiscord` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: runSearchCommand src/npx-cli/commands/runtime.ts:256 — `runSearchCommand` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: backfillMissingEmbeddings src/server/services/ObservationEmbeddingService.ts:256 — `backfillMissingEmbeddings` awaits `query(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `query(url, { signal })`.
  • Async function without AbortSignal: fetchWindsurfContextFromWorker REDACTED:264 — `fetchWindsurfContextFromWorker` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: workerFetch REDACTED:135 — `workerFetch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: postForWorkModel src/ui/my-work/src/live/local-source.ts:65 — `postForWorkModel` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadWorkModel src/ui/my-work/src/live/local-source.ts:83 — `loadWorkModel` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: setRequestChecked src/ui/my-work/src/live/local-source.ts:99 — `setRequestChecked` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchProjects src/ui/viewer/hooks/useContextPreview.ts:38 — `fetchProjects` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D31 · IaC & Container Security · Medium IaC · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Fake-async · ×13
  • Fake-async — async method never awaits REDACTED:357 — `cmdPRs` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits ragtime/ragtime.ts:57 — `cleanupOldTranscripts` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits scripts/regenerate-claude-md.ts:379 — `main` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits services/sync-api/src/store.ts:524 — `selectChangesPage` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits REDACTED:408 — `installAntigravityCliHooks` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/services/integrations/GrokBotAwarenessPusher.ts:136 — `notifyGrokBotAwareness` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits REDACTED:247 — `installGooseMcpIntegration` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/services/integrations/OmpHooksInstaller.ts:51 — `installOmpHooks` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/services/worker/DatabaseManager.ts:23 — `initialize` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/services/worker/DatabaseManager.ts:73 — `close` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/services/worker/SessionManager.ts:443 — `requestSessionWrapup` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/services/worker/SessionManager.ts:821 — `isAnySessionProcessing` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/services/worker/session/SessionCompletionHandler.ts:14 — `finalizeSession` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×13
  • Outbound HTTP without resilience ragtime/ragtime.ts:122 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:84 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:34 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:46 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/npx-cli/commands/runtime.ts:269 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:270 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:273 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/services/integrations/telegram-transport.ts:14 — `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/shared/openrouter-token-compatibility.ts:33 — `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/shared/openrouter-token-compatibility.ts:52 — `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/shared/progressive-search.ts:26 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/ui/viewer/utils/feed-deletion.ts:37 — `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/ui/viewer/utils/sessions.ts:106 — `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D29 · Static Analysis (SAST) · REDACTED · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×11
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:279 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:279-287 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:279-287 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:279-287 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:279-287 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:279-287 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:232 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:232-240 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:232-240 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:232-240 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:232-240 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:232-240 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:306 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:306-314 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:306-314 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:306-314 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:306-314 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:306-314 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:321 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:321-329 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:321-329 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:321-329 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:321-329 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:321-329 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:544 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:544-552 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:544-552 | cowork/skills/agent-cost-report/scripts/acr/render.py:544-552 | openclaw/skills/agent-cost-report/scripts/acr/render.py:544-552 | plugin/skills/agent-cost-report/scripts/acr/render.py:544-552 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:544` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:245 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:245-253 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:245-253 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:245-253 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:245-253 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:245-253 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:215 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:215-223 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:215-223 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:215-223 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:215-223 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:215-223 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:136 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:136-144 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:136-144 | cowork/skills/agent-cost-report/scripts/acr/render.py:136-144 | openclaw/skills/agent-cost-report/scripts/acr/render.py:136-144 | plugin/skills/agent-cost-report/scripts/acr/render.py:136-144 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:351 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:351-359 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:351-359 | cowork/skills/agent-cost-report/scripts/acr/render.py:351-359 | openclaw/skills/agent-cost-report/scripts/acr/render.py:351-359 | plugin/skills/agent-cost-report/scripts/acr/render.py:351-359 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:220 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:220-228 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:220-228 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:220-228 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:220-228 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:220-228 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:55 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:55-63 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:55-63 | cowork/skills/agent-cost-report/scripts/acr/wins.py:55-63 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:55-63 | plugin/skills/agent-cost-report/scripts/acr/wins.py:55-63 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D3 · God Classes · TooManyMethods · ×10
  • TooManyMethods: SessionStore src/services/sqlite/SessionStore.ts:228 — TooManyMethods — 140 methods. The bar is 30 methods; this is 110 over it, 4.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CloudSync src/services/sync/CloudSync.ts:567 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ChromaMcpManager REDACTED:251 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SyncClient src/services/sync/SyncClient.ts:272 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SessionManager src/services/worker/SessionManager.ts:49 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ChromaSync src/services/sync/ChromaSync.ts:292 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SyncHub workers/sync-hub/src/do/SyncHub.ts:183 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SyncApply src/services/sync/SyncApply.ts:373 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SessionSearch src/services/sqlite/SessionSearch.ts:103 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HubStore services/sync-api/src/store.ts:225 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D35 · Change Coupling · Change coupling · ×10
  • Change coupling: REDACTED ↔ uninstall.ts REDACTED:1 — `REDACTED` and `src/npx-cli/commands/uninstall.ts` change together 74% of the time (17 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `25933005` Add Hermes Agent memory support (#4905); `ae92b267` feat: add first-party T3 Code connector (#4520); `8423fdd8` feat: add OMP (Oh My Pi) hooks adapter (#3556) — run `git show` on any of them.
  • Change coupling: SessionStore.ts ↔ SyncApply.ts src/services/sqlite/SessionStore.ts:1 — `src/services/sqlite/SessionStore.ts` and `src/services/sync/SyncApply.ts` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `31acb241` perf(sqlite): index observation file paths for by-file lookup (v68) (…; `4477a1b0` feat(work-state): sync the agent's work state to the cloud (work_stat…; `55958f64` fix(sync): one op that can never apply no longer wedges the pull fore… — run `git show` on any of them.
  • Change coupling: worker-types.ts ↔ REDACTED src/services/worker-types.ts:1 — `src/services/worker-types.ts` and `REDACTED` change together 59% of the time (29 of the 49 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 29 shared commits counted here, the most recent 3 are `8afb05a3` fix(worker): end a simple-tier run before it serves a non-simple even…; `023f4a53` feat(worker): fall back between an API key and the Claude subscriptio…; `041d5ecb` fix(worker): switch back to the recovered primary at the next message… — run `git show` on any of them.
  • Change coupling: SearchManager.ts ↔ ChromaSearchStrategy.ts src/services/worker/SearchManager.ts:1 — `src/services/worker/SearchManager.ts` and `src/services/worker/search/strategies/ChromaSearchStrategy.ts` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `d8efa528` fix(search): widen filtered semantic candidates before pagination (#4…; `4a8dab1e` fix(search): make the implicit 90-day recency window configurable (#4…; `4a90883f` fix(search): paginate semantic memories after filtering and merging (… — run `git show` on any of them.
  • Change coupling: REDACTED ↔ GeneratorExitHandler.ts REDACTED:1 — `REDACTED` and `src/services/worker/session/GeneratorExitHandler.ts` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `041d5ecb` fix(worker): switch back to the recovered primary at the next message…; `6777de07` fix(worker): resume buffered work after observer deadline (#4273); `ceaaa35a` fix(worker): prevent history amplification after auth failures (#3479) — run `git show` on any of them.
  • Change coupling: ResponseProcessor.ts ↔ GeneratorExitHandler.ts src/services/worker/agents/ResponseProcessor.ts:1 — `src/services/worker/agents/ResponseProcessor.ts` and `src/services/worker/session/GeneratorExitHandler.ts` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `f4da8d87` fix(observer): correct a drifted observer turn instead of letting the…; `e3584a2b` fix(worker): preserve rejected observer batches (#3624); `6777de07` fix(worker): resume buffered work after observer deadline (#4273) — run `git show` on any of them.
  • Change coupling: ContextSettingsModal.tsx ↔ useSettings.ts src/ui/viewer/components/ContextSettingsModal.tsx:1 — `src/ui/viewer/components/ContextSettingsModal.tsx` and `src/ui/viewer/hooks/useSettings.ts` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `50707351` fix(viewer): preserve saved settings when initial loading finishes la…; `a317c88e` fix(viewer): surface settings-save error details (refs #3457) (#3474); `0e7b03f1` security: CLAUDE_CODE_PATH HTTP write + telemetry scrub (#4166) — run `git show` on any of them.
  • Change coupling: CodexCliInstaller.ts ↔ REDACTED src/services/integrations/CodexCliInstaller.ts:1 — `src/services/integrations/CodexCliInstaller.ts` and `REDACTED` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `bfc50259` fix(transcripts): load UTF-8 BOM config and checkpoint documents (#4352); `b0e896e2` fix: stop codex transcript replay after hooks migration (#2365); `8d65b95a` fix: narrow legacy codex context cleanup — run `git show` on any of them.
  • Change coupling: ide-detection.ts ↔ uninstall.ts src/npx-cli/commands/ide-detection.ts:1 — `src/npx-cli/commands/ide-detection.ts` and `src/npx-cli/commands/uninstall.ts` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `25933005` Add Hermes Agent memory support (#4905); `ae92b267` feat: add first-party T3 Code connector (#4520); `8423fdd8` feat: add OMP (Oh My Pi) hooks adapter (#3556) — run `git show` on any of them.
  • Change coupling: OpenCodeInstaller.ts ↔ REDACTED src/services/integrations/OpenCodeInstaller.ts:1 — `src/services/integrations/OpenCodeInstaller.ts` and `REDACTED` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `41113d34` fix: use health oracle and configured worker endpoint; `3695d116` fix: use health oracle and configured worker endpoint; `c7c68e81` fix: address 10 unresolved PR review threads — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×10
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:26 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:26-35 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py:26-35 | cowork/skills/agent-cost-report/scripts/acr/devices.py:26-35 | openclaw/skills/agent-cost-report/scripts/acr/devices.py:26-35 | plugin/skills/agent-cost-report/scripts/acr/devices.py:26-35 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 4 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:134 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:134-143 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:134-143 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:134-143 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:134-143 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:134-143 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:23 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:23-32 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:23-32 | cowork/skills/agent-cost-report/scripts/acr/prices.py:23-32 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:23-32 | plugin/skills/agent-cost-report/scripts/acr/prices.py:23-32 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:508 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:508-517 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:508-517 | cowork/skills/agent-cost-report/scripts/acr/render.py:508-517 | openclaw/skills/agent-cost-report/scripts/acr/render.py:508-517 | plugin/skills/agent-cost-report/scripts/acr/render.py:508-517 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:508` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:66 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:66-75 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:66-75 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:66-75 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:66-75 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:66-75 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:30 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:30-39 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:30-39 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:30-39 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:30-39 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:30-39 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:230 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:230-239 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:230-239 | cowork/skills/agent-cost-report/scripts/acr/render.py:230-239 | openclaw/skills/agent-cost-report/scripts/acr/render.py:230-239 | plugin/skills/agent-cost-report/scripts/acr/render.py:230-239 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:288 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:288-297 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:288-297 | cowork/skills/agent-cost-report/scripts/acr/render.py:288-297 | openclaw/skills/agent-cost-report/scripts/acr/render.py:288-297 | plugin/skills/agent-cost-report/scripts/acr/render.py:288-297 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:306 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:306-315 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:306-315 | cowork/skills/agent-cost-report/scripts/acr/render.py:306-315 | openclaw/skills/agent-cost-report/scripts/acr/render.py:306-315 | plugin/skills/agent-cost-report/scripts/acr/render.py:306-315 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:87 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:87-96 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:87-96 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:87-96 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:87-96 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:87-96 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D10 · Test Quality · No assertions · ×9
  • No assertions: deleting a never-captured session is idempotent ods/test/native.test.mjs:191 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should NOT use console.log/console.error (these logs are invisible in background services) tests/logger-usage-standards.test.ts:156 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should have logger coverage in high-priority files tests/logger-usage-standards.test.ts:176 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: shares one upload per burst and schedules one follow-up for events arriving during delivery tests/cli/remote-spool-scheduling.test.ts:52 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: allows a later event to retry after an uploader error or unsuccessful exit tests/cli/remote-spool-scheduling.test.ts:69 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: allows another attempt after spawn throws synchronously tests/cli/remote-spool-scheduling.test.ts:90 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: is not an error when the target is already gone tests/shared/kill-process-tree-modes.test.ts:77 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: a malformed advance (numeric epoch) is an anomaly too tests/worker/sync/sync-client-realtime.test.ts:296 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: an unanswered heartbeat declares the socket dead and reconnects tests/worker/sync/sync-client-realtime.test.ts:329 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D8 · Code Coverage · Low coverage · ×6
  • Low coverage: services/sync-api/src/canonical-content.ts services/sync-api/src/canonical-content.ts:1 — 0.2% line coverage (1/424).
  • Low coverage: REDACTED REDACTED:1 — 16.9% line coverage (72/425).
  • Low coverage: services/sync-api/src/projection.ts services/sync-api/src/projection.ts:1 — 3.6% line coverage (10/275).
  • Low coverage: services/sync-api/src/sockets.ts services/sync-api/src/sockets.ts:1 — 30.8% line coverage (8/26).
  • Low coverage: services/sync-api/src/store.ts services/sync-api/src/store.ts:1 — 4.0% line coverage (31/775).
  • Low coverage: services/sync-api/src/user-queue.ts services/sync-api/src/user-queue.ts:1 — 2.0% line coverage (1/51).
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×6
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:77 — `strip_tags` is public and takes `value: Any` from its caller, and it calls itself at line 77 (`strip_tags`) with a piece of `value` (and at line 79) — and nowhere in `strip_tags` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `strip_tags` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap services/sync-api/src/canonical-content.ts:89 — `canonicalJson` is exported, takes a document from its caller (line 71) and hands it to `normalizeJson`, which calls itself at line 89 (`normalizeJson`) with a piece of `value` (and at line 97) — and nowhere in `normalizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `normalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap src/services/sync/CanonicalContent.ts:92 — `canonicalJson` is exported, takes a document from its caller (line 74) and hands it to `normalizeJson`, which calls itself at line 92 (`normalizeJson`) with a piece of `value` (and at line 102) — and nowhere in `normalizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `normalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap src/services/work-view/review-store.ts:16 — `contentFingerprint` is exported, takes a document from its caller (line 23) and hands it to `canonical`, which calls itself at line 16 (`canonical`) with a piece of `value` (and at line 18) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap src/storage/postgres/utils.ts:95 — `canonicalJson` is exported, takes a document from its caller (line 82) and hands it to `sortJson`, which calls itself at line 95 (`sortJson`) with a piece of `value` (and at line 102) — and nowhere in `sortJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sortJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap workers/sync-hub/src/canonical-content.ts:89 — `canonicalJson` is exported, takes a document from its caller (line 71) and hands it to `normalizeJson`, which calls itself at line 89 (`normalizeJson`) with a piece of `value` (and at line 97) — and nowhere in `normalizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `normalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D1 · Cyclomatic Complexity · mistakes.run (cyclomatic 159) · ×5
  • mistakes.run (cyclomatic 159) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cyclomatic complexity 159 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.run (cyclomatic 159) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cyclomatic complexity 159 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.run (cyclomatic 159) cowork/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cyclomatic complexity 159 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.run (cyclomatic 159) openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cyclomatic complexity 159 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.run (cyclomatic 159) plugin/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cyclomatic complexity 159 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rollup.build (cyclomatic 88) · ×5
  • rollup.build (cyclomatic 88) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rollup.build (cyclomatic 88) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rollup.build (cyclomatic 88) cowork/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rollup.build (cyclomatic 88) openclaw/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rollup.build (cyclomatic 88) plugin/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render.details (cyclomatic 69) · ×5
  • render.details (cyclomatic 69) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.details (cyclomatic 69) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.details (cyclomatic 69) cowork/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.details (cyclomatic 69) openclaw/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.details (cyclomatic 69) plugin/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · wins.build (cyclomatic 60) · ×5
  • wins.build (cyclomatic 60) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.build (cyclomatic 60) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.build (cyclomatic 60) cowork/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.build (cyclomatic 60) openclaw/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.build (cyclomatic 60) plugin/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior.scan (cyclomatic 45) · ×5
  • behavior.scan (cyclomatic 45) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.scan (cyclomatic 45) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.scan (cyclomatic 45) cowork/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.scan (cyclomatic 45) openclaw/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.scan (cyclomatic 45) plugin/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rollup.aggregate (cyclomatic 34) · ×5
  • rollup.aggregate (cyclomatic 34) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rollup.aggregate (cyclomatic 34) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rollup.aggregate (cyclomatic 34) cowork/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rollup.aggregate (cyclomatic 34) openclaw/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rollup.aggregate (cyclomatic 34) plugin/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · evidence.load_evidence (cyclomatic 32) · ×5
  • evidence.load_evidence (cyclomatic 32) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • evidence.load_evidence (cyclomatic 32) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • evidence.load_evidence (cyclomatic 32) cowork/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • evidence.load_evidence (cyclomatic 32) openclaw/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • evidence.load_evidence (cyclomatic 32) plugin/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · patterns.detect_p1 (cyclomatic 30) · ×5
  • patterns.detect_p1 (cyclomatic 30) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p1 (cyclomatic 30) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p1 (cyclomatic 30) cowork/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p1 (cyclomatic 30) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p1 (cyclomatic 30) plugin/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · wins.scan_transcripts (cyclomatic 29) · ×5
  • wins.scan_transcripts (cyclomatic 29) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.scan_transcripts (cyclomatic 29) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.scan_transcripts (cyclomatic 29) cowork/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.scan_transcripts (cyclomatic 29) openclaw/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.scan_transcripts (cyclomatic 29) plugin/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · transcripts.collect_claude (cyclomatic 25) · ×5
  • transcripts.collect_claude (cyclomatic 25) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_claude (cyclomatic 25) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_claude (cyclomatic 25) cowork/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_claude (cyclomatic 25) openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_claude (cyclomatic 25) plugin/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · patterns.detect_p7 (cyclomatic 24) · ×5
  • patterns.detect_p7 (cyclomatic 24) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p7 (cyclomatic 24) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p7 (cyclomatic 24) cowork/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p7 (cyclomatic 24) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p7 (cyclomatic 24) plugin/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · patterns.detect_s1 (cyclomatic 24) · ×5
  • patterns.detect_s1 (cyclomatic 24) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s1 (cyclomatic 24) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s1 (cyclomatic 24) cowork/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s1 (cyclomatic 24) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s1 (cyclomatic 24) plugin/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render.day_chart (cyclomatic 23) · ×5
  • render.day_chart (cyclomatic 23) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.day_chart (cyclomatic 23) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.day_chart (cyclomatic 23) cowork/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.day_chart (cyclomatic 23) openclaw/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.day_chart (cyclomatic 23) plugin/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render.wins_mistakes (cyclomatic 22) · ×5
  • render.wins_mistakes (cyclomatic 22) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.wins_mistakes (cyclomatic 22) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.wins_mistakes (cyclomatic 22) cowork/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.wins_mistakes (cyclomatic 22) openclaw/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.wins_mistakes (cyclomatic 22) plugin/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · labels.apply_review (cyclomatic 21) · ×5
  • labels.apply_review (cyclomatic 21) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • labels.apply_review (cyclomatic 21) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • labels.apply_review (cyclomatic 21) cowork/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • labels.apply_review (cyclomatic 21) openclaw/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • labels.apply_review (cyclomatic 21) plugin/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render.behavior_strip (cyclomatic 19) · ×5
  • render.behavior_strip (cyclomatic 19) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.behavior_strip (cyclomatic 19) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.behavior_strip (cyclomatic 19) cowork/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.behavior_strip (cyclomatic 19) openclaw/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.behavior_strip (cyclomatic 19) plugin/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior.failure_spans (cyclomatic 18) · ×5
  • behavior.failure_spans (cyclomatic 18) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.failure_spans (cyclomatic 18) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.failure_spans (cyclomatic 18) cowork/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.failure_spans (cyclomatic 18) openclaw/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • behavior.failure_spans (cyclomatic 18) plugin/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mistakes.classify_pass (cyclomatic 18) · ×5
  • mistakes.classify_pass (cyclomatic 18) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.classify_pass (cyclomatic 18) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.classify_pass (cyclomatic 18) cowork/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.classify_pass (cyclomatic 18) openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mistakes.classify_pass (cyclomatic 18) plugin/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · patterns.detect_s2 (cyclomatic 18) · ×5
  • patterns.detect_s2 (cyclomatic 18) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s2 (cyclomatic 18) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s2 (cyclomatic 18) cowork/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s2 (cyclomatic 18) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_s2 (cyclomatic 18) plugin/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render.timelines (cyclomatic 18) · ×5
  • render.timelines (cyclomatic 18) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.timelines (cyclomatic 18) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.timelines (cyclomatic 18) cowork/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.timelines (cyclomatic 18) openclaw/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.timelines (cyclomatic 18) plugin/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render.ring (cyclomatic 18) · ×5
  • render.ring (cyclomatic 18) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.ring (cyclomatic 18) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.ring (cyclomatic 18) cowork/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.ring (cyclomatic 18) openclaw/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.ring (cyclomatic 18) plugin/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · render.outcomes (cyclomatic 18) · ×5
  • render.outcomes (cyclomatic 18) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.outcomes (cyclomatic 18) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.outcomes (cyclomatic 18) cowork/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.outcomes (cyclomatic 18) openclaw/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • render.outcomes (cyclomatic 18) plugin/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · wins.attribute (cyclomatic 18) · ×5
  • wins.attribute (cyclomatic 18) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.attribute (cyclomatic 18) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.attribute (cyclomatic 18) cowork/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.attribute (cyclomatic 18) openclaw/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wins.attribute (cyclomatic 18) plugin/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · patterns.detect_p9 (cyclomatic 17) · ×5
  • patterns.detect_p9 (cyclomatic 17) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p9 (cyclomatic 17) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p9 (cyclomatic 17) cowork/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p9 (cyclomatic 17) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • patterns.detect_p9 (cyclomatic 17) plugin/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render.hero (cyclomatic 17) · ×5
  • render.hero (cyclomatic 17) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.hero (cyclomatic 17) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.hero (cyclomatic 17) cowork/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.hero (cyclomatic 17) openclaw/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • render.hero (cyclomatic 17) plugin/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · transcripts.collect_codex (cyclomatic 17) · ×5
  • transcripts.collect_codex (cyclomatic 17) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_codex (cyclomatic 17) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_codex (cyclomatic 17) cowork/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_codex (cyclomatic 17) openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • transcripts.collect_codex (cyclomatic 17) plugin/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rollup.run_rollup (cyclomatic 16) · ×5
  • rollup.run_rollup (cyclomatic 16) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rollup.run_rollup (cyclomatic 16) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rollup.run_rollup (cyclomatic 16) cowork/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rollup.run_rollup (cyclomatic 16) openclaw/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rollup.run_rollup (cyclomatic 16) plugin/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · sample.write (cyclomatic 16) · ×5
  • sample.write (cyclomatic 16) claude-mem-cursor/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • sample.write (cyclomatic 16) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • sample.write (cyclomatic 16) cowork/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • sample.write (cyclomatic 16) openclaw/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • sample.write (cyclomatic 16) plugin/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · mistakes.run (cognitive 262) · ×5
  • mistakes.run (cognitive 262) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cognitive complexity 262 (threshold 15). Drivers by points: if/else 64 (123 pts), ternaries 30 (56 pts), loops 32 (50 pts), boolean chains 33 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.run (cognitive 262) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cognitive complexity 262 (threshold 15). Drivers by points: if/else 64 (123 pts), ternaries 30 (56 pts), loops 32 (50 pts), boolean chains 33 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.run (cognitive 262) cowork/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cognitive complexity 262 (threshold 15). Drivers by points: if/else 64 (123 pts), ternaries 30 (56 pts), loops 32 (50 pts), boolean chains 33 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.run (cognitive 262) openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cognitive complexity 262 (threshold 15). Drivers by points: if/else 64 (123 pts), ternaries 30 (56 pts), loops 32 (50 pts), boolean chains 33 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.run (cognitive 262) plugin/skills/agent-cost-report/scripts/acr/mistakes.py:98 — mistakes.run has cognitive complexity 262 (threshold 15). Drivers by points: if/else 64 (123 pts), ternaries 30 (56 pts), loops 32 (50 pts), boolean chains 33 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rollup.build (cognitive 126) · ×5
  • rollup.build (cognitive 126) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cognitive complexity 126 (threshold 15). Drivers by points: ternaries 23 (47 pts), if/else 23 (32 pts), loops 19 (25 pts), boolean chains 22 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.build (cognitive 126) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cognitive complexity 126 (threshold 15). Drivers by points: ternaries 23 (47 pts), if/else 23 (32 pts), loops 19 (25 pts), boolean chains 22 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.build (cognitive 126) cowork/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cognitive complexity 126 (threshold 15). Drivers by points: ternaries 23 (47 pts), if/else 23 (32 pts), loops 19 (25 pts), boolean chains 22 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.build (cognitive 126) openclaw/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cognitive complexity 126 (threshold 15). Drivers by points: ternaries 23 (47 pts), if/else 23 (32 pts), loops 19 (25 pts), boolean chains 22 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.build (cognitive 126) plugin/skills/agent-cost-report/scripts/acr/rollup.py:58 — rollup.build has cognitive complexity 126 (threshold 15). Drivers by points: ternaries 23 (47 pts), if/else 23 (32 pts), loops 19 (25 pts), boolean chains 22 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior.scan (cognitive 98) · ×5
  • behavior.scan (cognitive 98) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cognitive complexity 98 (threshold 15). Drivers by points: if/else 14 (45 pts), boolean chains 18, ternaries 4 (18 pts), loops 4 (11 pts), error handling 2 (6 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.scan (cognitive 98) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cognitive complexity 98 (threshold 15). Drivers by points: if/else 14 (45 pts), boolean chains 18, ternaries 4 (18 pts), loops 4 (11 pts), error handling 2 (6 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.scan (cognitive 98) cowork/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cognitive complexity 98 (threshold 15). Drivers by points: if/else 14 (45 pts), boolean chains 18, ternaries 4 (18 pts), loops 4 (11 pts), error handling 2 (6 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.scan (cognitive 98) openclaw/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cognitive complexity 98 (threshold 15). Drivers by points: if/else 14 (45 pts), boolean chains 18, ternaries 4 (18 pts), loops 4 (11 pts), error handling 2 (6 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.scan (cognitive 98) plugin/skills/agent-cost-report/scripts/acr/behavior.py:116 — behavior.scan has cognitive complexity 98 (threshold 15). Drivers by points: if/else 14 (45 pts), boolean chains 18, ternaries 4 (18 pts), loops 4 (11 pts), error handling 2 (6 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wins.build (cognitive 91) · ×5
  • wins.build (cognitive 91) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cognitive complexity 91 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 22, loops 9 (18 pts), ternaries 8 (10 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.build (cognitive 91) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cognitive complexity 91 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 22, loops 9 (18 pts), ternaries 8 (10 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.build (cognitive 91) cowork/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cognitive complexity 91 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 22, loops 9 (18 pts), ternaries 8 (10 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.build (cognitive 91) openclaw/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cognitive complexity 91 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 22, loops 9 (18 pts), ternaries 8 (10 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.build (cognitive 91) plugin/skills/agent-cost-report/scripts/acr/wins.py:234 — wins.build has cognitive complexity 91 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 22, loops 9 (18 pts), ternaries 8 (10 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.details (cognitive 89) · ×5
  • render.details (cognitive 89) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 22 (36 pts), boolean chains 34, if/else 10 (15 pts), loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.details (cognitive 89) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 22 (36 pts), boolean chains 34, if/else 10 (15 pts), loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.details (cognitive 89) cowork/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 22 (36 pts), boolean chains 34, if/else 10 (15 pts), loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.details (cognitive 89) openclaw/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 22 (36 pts), boolean chains 34, if/else 10 (15 pts), loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.details (cognitive 89) plugin/skills/agent-cost-report/scripts/acr/render.py:393 — render.details has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 22 (36 pts), boolean chains 34, if/else 10 (15 pts), loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wins.scan_transcripts (cognitive 68) · ×5
  • wins.scan_transcripts (cognitive 68) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 9 (40 pts), boolean chains 12, loops 4 (11 pts), error handling 2 (5 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.scan_transcripts (cognitive 68) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 9 (40 pts), boolean chains 12, loops 4 (11 pts), error handling 2 (5 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.scan_transcripts (cognitive 68) cowork/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 9 (40 pts), boolean chains 12, loops 4 (11 pts), error handling 2 (5 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.scan_transcripts (cognitive 68) openclaw/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 9 (40 pts), boolean chains 12, loops 4 (11 pts), error handling 2 (5 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.scan_transcripts (cognitive 68) plugin/skills/agent-cost-report/scripts/acr/wins.py:80 — wins.scan_transcripts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 9 (40 pts), boolean chains 12, loops 4 (11 pts), error handling 2 (5 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · patterns.detect_p1 (cognitive 47) · ×5
  • patterns.detect_p1 (cognitive 47) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 11, ternaries 4 (8 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p1 (cognitive 47) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 11, ternaries 4 (8 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p1 (cognitive 47) cowork/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 11, ternaries 4 (8 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p1 (cognitive 47) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 11, ternaries 4 (8 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p1 (cognitive 47) plugin/skills/agent-cost-report/scripts/acr/patterns.py:157 — patterns.detect_p1 has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 11, ternaries 4 (8 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evidence.load_evidence (cognitive 46) · ×5
  • evidence.load_evidence (cognitive 46) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 12, loops 5, ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • evidence.load_evidence (cognitive 46) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 12, loops 5, ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • evidence.load_evidence (cognitive 46) cowork/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 12, loops 5, ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • evidence.load_evidence (cognitive 46) openclaw/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 12, loops 5, ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • evidence.load_evidence (cognitive 46) plugin/skills/agent-cost-report/scripts/acr/evidence.py:87 — evidence.load_evidence has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 12, loops 5, ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · patterns.detect_s1 (cognitive 46) · ×5
  • patterns.detect_s1 (cognitive 46) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 6 (9 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s1 (cognitive 46) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 6 (9 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s1 (cognitive 46) cowork/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 6 (9 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s1 (cognitive 46) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 6 (9 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s1 (cognitive 46) plugin/skills/agent-cost-report/scripts/acr/patterns.py:305 — patterns.detect_s1 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 6 (9 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.day_chart (cognitive 41) · ×5
  • render.day_chart (cognitive 41) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 6 (12 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.day_chart (cognitive 41) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 6 (12 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.day_chart (cognitive 41) cowork/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 6 (12 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.day_chart (cognitive 41) openclaw/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 6 (12 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.day_chart (cognitive 41) plugin/skills/agent-cost-report/scripts/acr/render.py:281 — render.day_chart has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 6 (12 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transcripts.collect_claude (cognitive 41) · ×5
  • transcripts.collect_claude (cognitive 41) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 13, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_claude (cognitive 41) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 13, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_claude (cognitive 41) cowork/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 13, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_claude (cognitive 41) openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 13, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_claude (cognitive 41) plugin/skills/agent-cost-report/scripts/acr/transcripts.py:43 — transcripts.collect_claude has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 13, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · patterns.detect_p7 (cognitive 40) · ×5
  • patterns.detect_p7 (cognitive 40) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 10, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p7 (cognitive 40) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 10, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p7 (cognitive 40) cowork/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 10, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p7 (cognitive 40) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 10, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p7 (cognitive 40) plugin/skills/agent-cost-report/scripts/acr/patterns.py:230 — patterns.detect_p7 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 10, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rollup.aggregate (cognitive 40) · ×5
  • rollup.aggregate (cognitive 40) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 6 (7 pts), boolean chains 3, ternaries 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • rollup.aggregate (cognitive 40) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 6 (7 pts), boolean chains 3, ternaries 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • rollup.aggregate (cognitive 40) cowork/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 6 (7 pts), boolean chains 3, ternaries 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • rollup.aggregate (cognitive 40) openclaw/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 6 (7 pts), boolean chains 3, ternaries 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • rollup.aggregate (cognitive 40) plugin/skills/agent-cost-report/scripts/acr/rollup.py:231 — rollup.aggregate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 6 (7 pts), boolean chains 3, ternaries 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · labels.apply_review (cognitive 38) · ×5
  • labels.apply_review (cognitive 38) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • labels.apply_review (cognitive 38) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • labels.apply_review (cognitive 38) cowork/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • labels.apply_review (cognitive 38) openclaw/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • labels.apply_review (cognitive 38) plugin/skills/agent-cost-report/scripts/acr/labels.py:81 — labels.apply_review has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior.failure_spans (cognitive 34) · ×5
  • behavior.failure_spans (cognitive 34) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.failure_spans (cognitive 34) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.failure_spans (cognitive 34) cowork/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.failure_spans (cognitive 34) openclaw/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • behavior.failure_spans (cognitive 34) plugin/skills/agent-cost-report/scripts/acr/behavior.py:294 — behavior.failure_spans has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wins.attribute (cognitive 33) · ×5
  • wins.attribute (cognitive 33) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cognitive complexity 33 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 5 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.attribute (cognitive 33) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cognitive complexity 33 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 5 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.attribute (cognitive 33) cowork/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cognitive complexity 33 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 5 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.attribute (cognitive 33) openclaw/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cognitive complexity 33 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 5 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.attribute (cognitive 33) plugin/skills/agent-cost-report/scripts/acr/wins.py:319 — wins.attribute has cognitive complexity 33 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 5 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · patterns.detect_s2 (cognitive 32) · ×5
  • patterns.detect_s2 (cognitive 32) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s2 (cognitive 32) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s2 (cognitive 32) cowork/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s2 (cognitive 32) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_s2 (cognitive 32) plugin/skills/agent-cost-report/scripts/acr/patterns.py:341 — patterns.detect_s2 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.wins_mistakes (cognitive 31) · ×5
  • render.wins_mistakes (cognitive 31) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 7 (8 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.wins_mistakes (cognitive 31) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 7 (8 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.wins_mistakes (cognitive 31) cowork/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 7 (8 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.wins_mistakes (cognitive 31) openclaw/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 7 (8 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.wins_mistakes (cognitive 31) plugin/skills/agent-cost-report/scripts/acr/render.py:159 — render.wins_mistakes has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 7 (8 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wins.classify_command (cognitive 31) · ×5
  • wins.classify_command (cognitive 31) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:46 — wins.classify_command has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (13 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.classify_command (cognitive 31) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:46 — wins.classify_command has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (13 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.classify_command (cognitive 31) cowork/skills/agent-cost-report/scripts/acr/wins.py:46 — wins.classify_command has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (13 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.classify_command (cognitive 31) openclaw/skills/agent-cost-report/scripts/acr/wins.py:46 — wins.classify_command has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (13 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wins.classify_command (cognitive 31) plugin/skills/agent-cost-report/scripts/acr/wins.py:46 — wins.classify_command has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (13 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · patterns.detect_p9 (cognitive 29) · ×5
  • patterns.detect_p9 (cognitive 29) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p9 (cognitive 29) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p9 (cognitive 29) cowork/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p9 (cognitive 29) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p9 (cognitive 29) plugin/skills/agent-cost-report/scripts/acr/patterns.py:267 — patterns.detect_p9 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.behavior_strip (cognitive 29) · ×5
  • render.behavior_strip (cognitive 29) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 5 (8 pts), boolean chains 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.behavior_strip (cognitive 29) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 5 (8 pts), boolean chains 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.behavior_strip (cognitive 29) cowork/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 5 (8 pts), boolean chains 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.behavior_strip (cognitive 29) openclaw/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 5 (8 pts), boolean chains 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.behavior_strip (cognitive 29) plugin/skills/agent-cost-report/scripts/acr/render.py:326 — render.behavior_strip has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 5 (8 pts), boolean chains 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.timelines (cognitive 28) · ×5
  • render.timelines (cognitive 28) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (8 pts), boolean chains 7, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.timelines (cognitive 28) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (8 pts), boolean chains 7, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.timelines (cognitive 28) cowork/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (8 pts), boolean chains 7, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.timelines (cognitive 28) openclaw/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (8 pts), boolean chains 7, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.timelines (cognitive 28) plugin/skills/agent-cost-report/scripts/acr/render.py:188 — render.timelines has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (8 pts), boolean chains 7, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.outcomes (cognitive 28) · ×5
  • render.outcomes (cognitive 28) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.outcomes (cognitive 28) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.outcomes (cognitive 28) cowork/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.outcomes (cognitive 28) openclaw/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.outcomes (cognitive 28) plugin/skills/agent-cost-report/scripts/acr/render.py:346 — render.outcomes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transcripts.collect_codex (cognitive 28) · ×5
  • transcripts.collect_codex (cognitive 28) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_codex (cognitive 28) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_codex (cognitive 28) cowork/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_codex (cognitive 28) openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • transcripts.collect_codex (cognitive 28) plugin/skills/agent-cost-report/scripts/acr/transcripts.py:85 — transcripts.collect_codex has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mistakes.classify_pass (cognitive 27) · ×5
  • mistakes.classify_pass (cognitive 27) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 8, ternaries 1 (3 pts), loops 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.classify_pass (cognitive 27) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 8, ternaries 1 (3 pts), loops 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.classify_pass (cognitive 27) cowork/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 8, ternaries 1 (3 pts), loops 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.classify_pass (cognitive 27) openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 8, ternaries 1 (3 pts), loops 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mistakes.classify_pass (cognitive 27) plugin/skills/agent-cost-report/scripts/acr/mistakes.py:21 — mistakes.classify_pass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 8, ternaries 1 (3 pts), loops 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · patterns.detect_p11 (cognitive 26) · ×5
  • patterns.detect_p11 (cognitive 26) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:283 — patterns.detect_p11 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p11 (cognitive 26) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:283 — patterns.detect_p11 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p11 (cognitive 26) cowork/skills/agent-cost-report/scripts/acr/patterns.py:283 — patterns.detect_p11 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p11 (cognitive 26) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:283 — patterns.detect_p11 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p11 (cognitive 26) plugin/skills/agent-cost-report/scripts/acr/patterns.py:283 — patterns.detect_p11 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · patterns.detect_p6 (cognitive 21) · ×5
  • patterns.detect_p6 (cognitive 21) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:214 — patterns.detect_p6 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p6 (cognitive 21) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:214 — patterns.detect_p6 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p6 (cognitive 21) cowork/skills/agent-cost-report/scripts/acr/patterns.py:214 — patterns.detect_p6 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p6 (cognitive 21) openclaw/skills/agent-cost-report/scripts/acr/patterns.py:214 — patterns.detect_p6 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • patterns.detect_p6 (cognitive 21) plugin/skills/agent-cost-report/scripts/acr/patterns.py:214 — patterns.detect_p6 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.hero (cognitive 21) · ×5
  • render.hero (cognitive 21) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.hero (cognitive 21) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.hero (cognitive 21) cowork/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.hero (cognitive 21) openclaw/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.hero (cognitive 21) plugin/skills/agent-cost-report/scripts/acr/render.py:125 — render.hero has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.ring (cognitive 21) · ×5
  • render.ring (cognitive 21) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • render.ring (cognitive 21) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • render.ring (cognitive 21) cowork/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • render.ring (cognitive 21) openclaw/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • render.ring (cognitive 21) plugin/skills/agent-cost-report/scripts/acr/render.py:305 — render.ring has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · sample.write (cognitive 19) · ×5
  • sample.write (cognitive 19) claude-mem-cursor/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • sample.write (cognitive 19) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • sample.write (cognitive 19) cowork/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • sample.write (cognitive 19) openclaw/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • sample.write (cognitive 19) plugin/skills/agent-cost-report/scripts/acr/sample.py:17 — sample.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · classify.run (cognitive 16) · ×5
  • classify.run (cognitive 16) claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:56 — classify.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), loops 3 (5 pts), ternaries 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • classify.run (cognitive 16) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/classify.py:56 — classify.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), loops 3 (5 pts), ternaries 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • classify.run (cognitive 16) cowork/skills/agent-cost-report/scripts/acr/classify.py:56 — classify.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), loops 3 (5 pts), ternaries 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • classify.run (cognitive 16) openclaw/skills/agent-cost-report/scripts/acr/classify.py:56 — classify.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), loops 3 (5 pts), ternaries 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • classify.run (cognitive 16) plugin/skills/agent-cost-report/scripts/acr/classify.py:56 — classify.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), loops 3 (5 pts), ternaries 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · costs.extrapolation (cognitive 16) · ×5
  • costs.extrapolation (cognitive 16) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:101 — costs.extrapolation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • costs.extrapolation (cognitive 16) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:101 — costs.extrapolation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • costs.extrapolation (cognitive 16) cowork/skills/agent-cost-report/scripts/acr/costs.py:101 — costs.extrapolation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • costs.extrapolation (cognitive 16) openclaw/skills/agent-cost-report/scripts/acr/costs.py:101 — costs.extrapolation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • costs.extrapolation (cognitive 16) plugin/skills/agent-cost-report/scripts/acr/costs.py:101 — costs.extrapolation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · render.ribbon (cognitive 16) · ×5
  • render.ribbon (cognitive 16) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:219 — render.ribbon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.ribbon (cognitive 16) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:219 — render.ribbon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.ribbon (cognitive 16) cowork/skills/agent-cost-report/scripts/acr/render.py:219 — render.ribbon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.ribbon (cognitive 16) openclaw/skills/agent-cost-report/scripts/acr/render.py:219 — render.ribbon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • render.ribbon (cognitive 16) plugin/skills/agent-cost-report/scripts/acr/render.py:219 — render.ribbon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rollup.run_rollup (cognitive 16) · ×5
  • rollup.run_rollup (cognitive 16) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.run_rollup (cognitive 16) claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.run_rollup (cognitive 16) cowork/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.run_rollup (cognitive 16) openclaw/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rollup.run_rollup (cognitive 16) plugin/skills/agent-cost-report/scripts/acr/rollup.py:320 — rollup.run_rollup has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · ClassTooLong · ×5
  • ClassTooLong: SearchManager src/services/worker/SearchManager.ts:41 — ClassTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 399 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SessionRoutes REDACTED:68 — ClassTooLong — 643 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 243 over it, 1.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WorkerService REDACTED:250 — ClassTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 190 over it, 1.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ContextSettingsModal src/ui/viewer/components/ContextSettingsModal.tsx:1 — ClassTooLong — 574 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 174 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TranscriptEventProcessor src/services/transcripts/processor.ts:116 — ClassTooLong — 431 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 31 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Near-duplicate member family (5 members, 15 shared lines) · ×5
  • Near-duplicate member family (5 members, 15 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:30 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:30-46 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:30-46 | cowork/skills/agent-cost-report/scripts/acr/measure.py:30-46 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:30-46 | plugin/skills/agent-cost-report/scripts/acr/measure.py:30-46 — These 5 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 15 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:22 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:22-39 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:22-39 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:22-39 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:22-39 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:22-39 — These 5 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 15 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/sample.py:18 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/sample.py:18-45 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/sample.py:18-45 | cowork/skills/agent-cost-report/scripts/acr/sample.py:18-45 | openclaw/skills/agent-cost-report/scripts/acr/sample.py:18-45 | plugin/skills/agent-cost-report/scripts/acr/sample.py:18-45 — These 5 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 15 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:86 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:86-111 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:86-111 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:86-111 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:86-111 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:86-111 — These 5 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 15 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:81 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:81-108 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:81-108 | cowork/skills/agent-cost-report/scripts/acr/wins.py:81-108 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:81-108 | plugin/skills/agent-cost-report/scripts/acr/wins.py:81-108 — These 5 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 13 shared lines) · ×4
  • Near-duplicate member family (5 members, 13 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:42 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:42-55 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:42-55 | cowork/skills/agent-cost-report/scripts/acr/prices.py:42-55 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:42-55 | plugin/skills/agent-cost-report/scripts/acr/prices.py:42-55 — These 5 members are variants of one another: a block of 13 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 13 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:160 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:160-185 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:160-185 | cowork/skills/agent-cost-report/scripts/acr/render.py:160-185 | openclaw/skills/agent-cost-report/scripts/acr/render.py:160-185 | plugin/skills/agent-cost-report/scripts/acr/render.py:160-185 — These 5 members are variants of one another: a block of 13 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 13 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:189 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:189-215 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:189-215 | cowork/skills/agent-cost-report/scripts/acr/render.py:189-215 | openclaw/skills/agent-cost-report/scripts/acr/render.py:189-215 | plugin/skills/agent-cost-report/scripts/acr/render.py:189-215 — These 5 members are variants of one another: a block of 13 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 13 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:205 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:205-218 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:205-218 | cowork/skills/agent-cost-report/scripts/acr/wins.py:205-218 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:205-218 | plugin/skills/agent-cost-report/scripts/acr/wins.py:205-218 — These 5 members are variants of one another: a block of 13 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 10 shared lines) · ×4
  • Near-duplicate member family (5 members, 10 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:74 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:74-89 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:74-89 | cowork/skills/agent-cost-report/scripts/acr/costs.py:74-89 | openclaw/skills/agent-cost-report/scripts/acr/costs.py:74-89 | plugin/skills/agent-cost-report/scripts/acr/costs.py:74-89 — These 5 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 10 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:23 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:23-38 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:23-38 | cowork/skills/agent-cost-report/scripts/acr/prices.py:23-38 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:23-38 | plugin/skills/agent-cost-report/scripts/acr/prices.py:23-38 — These 5 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 10 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:282 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:282-301 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:282-301 | cowork/skills/agent-cost-report/scripts/acr/render.py:282-301 | openclaw/skills/agent-cost-report/scripts/acr/render.py:282-301 | plugin/skills/agent-cost-report/scripts/acr/render.py:282-301 — These 5 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 10 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:306 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:306-323 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:306-323 | cowork/skills/agent-cost-report/scripts/acr/render.py:306-323 | openclaw/skills/agent-cost-report/scripts/acr/render.py:306-323 | plugin/skills/agent-cost-report/scripts/acr/render.py:306-323 — These 5 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×4
  • Duplicated block (15 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:185 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:185-199 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:185-199 | cowork/skills/agent-cost-report/scripts/acr.py:185-199 | openclaw/skills/agent-cost-report/scripts/acr.py:185-199 | plugin/skills/agent-cost-report/scripts/acr.py:185-199 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:96 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:96-110 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:96-110 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:96-110 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:96-110 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:96-110 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:75 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:75-89 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:75-89 | cowork/skills/agent-cost-report/scripts/acr/measure.py:75-89 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:75-89 | plugin/skills/agent-cost-report/scripts/acr/measure.py:75-89 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:81 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:81-95 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:81-95 | cowork/skills/agent-cost-report/scripts/acr/wins.py:81-95 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:81-95 | plugin/skills/agent-cost-report/scripts/acr/wins.py:81-95 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×4
  • Duplicated block (14 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:82 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:82-95 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:82-95 | cowork/skills/agent-cost-report/scripts/acr/labels.py:82-95 | openclaw/skills/agent-cost-report/scripts/acr/labels.py:82-95 | plugin/skills/agent-cost-report/scripts/acr/labels.py:82-95 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:51 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:51-64 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:51-64 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:51-64 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:51-64 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:51-64 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:225 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:225-238 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:225-238 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:225-238 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:225-238 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:225-238 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:300 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:300-313 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:300-313 | cowork/skills/agent-cost-report/scripts/acr/wins.py:300-313 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:300-313 | plugin/skills/agent-cost-report/scripts/acr/wins.py:300-313 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×4
  • Duplicated block (12 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:173 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:173-184 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:173-184 | cowork/skills/agent-cost-report/scripts/acr.py:173-184 | openclaw/skills/agent-cost-report/scripts/acr.py:173-184 | plugin/skills/agent-cost-report/scripts/acr.py:173-184 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:201 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:201-212 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:201-212 | cowork/skills/agent-cost-report/scripts/acr.py:201-212 | openclaw/skills/agent-cost-report/scripts/acr.py:201-212 | plugin/skills/agent-cost-report/scripts/acr.py:201-212 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:108 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:108-119 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py:108-119 | cowork/skills/agent-cost-report/scripts/acr/costs.py:108-119 | openclaw/skills/agent-cost-report/scripts/acr/costs.py:108-119 | plugin/skills/agent-cost-report/scripts/acr/costs.py:108-119 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/costs.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/costs.py:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:343 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:343-354 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:343-354 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:343-354 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:343-354 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:343-354 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D30 · Dependency Vulnerabilities · Medium CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 14 shared lines) · ×3
  • Near-duplicate member family (5 members, 14 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:82 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:82-114 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:82-114 | cowork/skills/agent-cost-report/scripts/acr/labels.py:82-114 | openclaw/skills/agent-cost-report/scripts/acr/labels.py:82-114 | plugin/skills/agent-cost-report/scripts/acr/labels.py:82-114 — These 5 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 14 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:54 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/measure.py:54-71 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/measure.py:54-71 | cowork/skills/agent-cost-report/scripts/acr/measure.py:54-71 | openclaw/skills/agent-cost-report/scripts/acr/measure.py:54-71 | plugin/skills/agent-cost-report/scripts/acr/measure.py:54-71 — These 5 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 14 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:47 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:47-63 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:47-63 | cowork/skills/agent-cost-report/scripts/acr/wins.py:47-63 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:47-63 | plugin/skills/agent-cost-report/scripts/acr/wins.py:47-63 — These 5 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×3
  • Duplicated block (26 lines × 2 locations) REDACTED:300 — REDACTED:300 · workers/sync-hub/src/index.ts:623 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (26 lines × 2 locations) services/sync-api/src/projection.ts:118 — services/sync-api/src/projection.ts:118 · workers/sync-hub/src/index.ts:773 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (26 lines × 2 locations) src/ui/my-work/src/components/ai-elements/commit.tsx:246 — src/ui/my-work/src/components/ai-elements/commit.tsx:246 · src/ui/my-work/src/components/ai-elements/terminal.tsx:132 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
AC1 · Text alternatives · <canvas> without a text alternative · ×2
  • <canvas> without a text alternative plugin/ui/tv.html:133 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/ui/tv.html:133 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure · Page without a main landmark · ×2
  • Page without a main landmark plugin/ui/tv.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/ui/tv.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Empty <h1> heading · ×2
  • Empty <h1> heading plugin/ui/tv.html:122 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
  • Empty <h1> heading src/ui/tv.html:122 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×2
  • Modal dialog does not manage focus src/ui/viewer/components/ContextSettingsModal.tsx:206 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus src/ui/viewer/components/WelcomeCard.tsx:181 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D1 · Cyclomatic Complexity · buildAgentView · ×2
  • buildAgentView::getGroup (cyclomatic 23) src/services/work-view/agent-view.mjs:238 — buildAgentView::getGroup has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buildAgentView::metadataFor (cyclomatic 20) src/services/work-view/agent-view.mjs:183 — buildAgentView::metadataFor has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · canonical-content.validateBody (cyclomatic 22) · ×2
  • canonical-content.validateBody (cyclomatic 22) services/sync-api/src/canonical-content.ts:232 — canonical-content.validateBody has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • canonical-content.validateBody (cyclomatic 22) workers/sync-hub/src/canonical-content.ts:232 — canonical-content.validateBody has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · canonical-content.validatePayload (cyclomatic 22) · ×2
  • canonical-content.validatePayload (cyclomatic 22) services/sync-api/src/canonical-content.ts:279 — canonical-content.validatePayload has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • canonical-content.validatePayload (cyclomatic 22) workers/sync-hub/src/canonical-content.ts:279 — canonical-content.validatePayload has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · canonical-content.validateMutation (cyclomatic 22) · ×2
  • canonical-content.validateMutation (cyclomatic 22) services/sync-api/src/canonical-content.ts:343 — canonical-content.validateMutation has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • canonical-content.validateMutation (cyclomatic 22) workers/sync-hub/src/canonical-content.ts:343 — canonical-content.validateMutation has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · canonical-content.parseCanonicalOperation (cyclomatic 18) · ×2
  • canonical-content.parseCanonicalOperation (cyclomatic 18) services/sync-api/src/canonical-content.ts:171 — canonical-content.parseCanonicalOperation has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • canonical-content.parseCanonicalOperation (cyclomatic 18) workers/sync-hub/src/canonical-content.ts:171 — canonical-content.parseCanonicalOperation has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · canonical-content.normalizeJson (cyclomatic 16) · ×2
  • canonical-content.normalizeJson (cyclomatic 16) services/sync-api/src/canonical-content.ts:75 — canonical-content.normalizeJson has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • canonical-content.normalizeJson (cyclomatic 16) workers/sync-hub/src/canonical-content.ts:75 — canonical-content.normalizeJson has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.handleRepairDrain (cyclomatic 16) · ×2
  • index.handleRepairDrain (cyclomatic 16) REDACTED:327 — index.handleRepairDrain has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • index.handleRepairDrain (cyclomatic 16) workers/sync-hub/src/index.ts:1001 — index.handleRepairDrain has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D17 · Explicit Debt · TodoComment · ×2
  • TodoComment REDACTED:5 — // TODO(#2233): migrate to Anthropic tool-use API for deterministic JSON output. This text-XML path is the bridge.
  • TodoComment REDACTED:283 — // TODO(server-beta config scope): source tenant-scoped settings once — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · canonical-content.validatePayload (cognitive 36) · ×2
  • canonical-content.validatePayload (cognitive 36) services/sync-api/src/canonical-content.ts:279 — canonical-content.validatePayload has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • canonical-content.validatePayload (cognitive 36) workers/sync-hub/src/canonical-content.ts:279 — canonical-content.validatePayload has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buildAgentView · ×2
  • buildAgentView::getGroup (cognitive 29) src/services/work-view/agent-view.mjs:238 — buildAgentView::getGroup has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 10 (18 pts), other 7, boolean chains 2, if/else 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buildAgentView::metadataFor (cognitive 26) src/services/work-view/agent-view.mjs:183 — buildAgentView::metadataFor has cognitive complexity 26 (threshold 15). Drivers by points: other 8, ternaries 3 (7 pts), error handling 1 (3 pts), if/else 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · canonical-content.validateMutation (cognitive 27) · ×2
  • canonical-content.validateMutation (cognitive 27) services/sync-api/src/canonical-content.ts:343 — canonical-content.validateMutation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • canonical-content.validateMutation (cognitive 27) workers/sync-hub/src/canonical-content.ts:343 — canonical-content.validateMutation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · canonical-content.validateBody (cognitive 26) · ×2
  • canonical-content.validateBody (cognitive 26) services/sync-api/src/canonical-content.ts:232 — canonical-content.validateBody has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • canonical-content.validateBody (cognitive 26) workers/sync-hub/src/canonical-content.ts:232 — canonical-content.validateBody has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · canonical-content.normalizeJson (cognitive 18) · ×2
  • canonical-content.normalizeJson (cognitive 18) services/sync-api/src/canonical-content.ts:75 — canonical-content.normalizeJson has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • canonical-content.normalizeJson (cognitive 18) workers/sync-hub/src/canonical-content.ts:75 — canonical-content.normalizeJson has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tv.html.wrap (cognitive 16) · ×2
  • tv.html.wrap (cognitive 16) plugin/ui/tv.html:374 — tv.html.wrap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tv.html.wrap (cognitive 16) src/ui/tv.html:374 — tv.html.wrap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buildHumanRequests · ×2
  • buildHumanRequests::requestFor (cognitive 16) src/services/work-view/request-projection.mjs:173 — buildHumanRequests::requestFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, other 3, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • buildHumanRequests::collect (cognitive 16) src/services/work-view/request-projection.mjs:315 — buildHumanRequests::collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (6 pts), other 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 17 shared lines) · ×2
  • Near-duplicate member family (5 members, 17 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:295 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:295-313 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:295-313 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:295-313 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:295-313 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:295-313 — These 5 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 17 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:528 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:528-553 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:528-553 | cowork/skills/agent-cost-report/scripts/acr/render.py:528-553 | openclaw/skills/agent-cost-report/scripts/acr/render.py:528-553 | plugin/skills/agent-cost-report/scripts/acr/render.py:528-553 — These 5 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 16 shared lines) · ×2
  • Near-duplicate member family (5 members, 16 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:26 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:26-48 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py:26-48 | cowork/skills/agent-cost-report/scripts/acr/devices.py:26-48 | openclaw/skills/agent-cost-report/scripts/acr/devices.py:26-48 | plugin/skills/agent-cost-report/scripts/acr/devices.py:26-48 — These 5 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 16 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:231 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:231-253 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:231-253 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:231-253 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:231-253 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:231-253 — These 5 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 12 shared lines) · ×2
  • Near-duplicate member family (5 members, 12 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:394 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:394-465 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:394-465 | cowork/skills/agent-cost-report/scripts/acr/render.py:394-465 | openclaw/skills/agent-cost-report/scripts/acr/render.py:394-465 | plugin/skills/agent-cost-report/scripts/acr/render.py:394-465 — These 5 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 12 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:321 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:321-355 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:321-355 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:321-355 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:321-355 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:321-355 — These 5 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 11 shared lines) · ×2
  • Near-duplicate member family (5 members, 11 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:284 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:284-298 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:284-298 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:284-298 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:284-298 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:284-298 — These 5 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 11 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:87 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/prices.py:87-102 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/prices.py:87-102 | cowork/skills/agent-cost-report/scripts/acr/prices.py:87-102 | openclaw/skills/agent-cost-report/scripts/acr/prices.py:87-102 | plugin/skills/agent-cost-report/scripts/acr/prices.py:87-102 — These 5 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 9 shared lines) · ×2
  • Near-duplicate member family (5 members, 9 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:126 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:126-144 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:126-144 | cowork/skills/agent-cost-report/scripts/acr/render.py:126-144 | openclaw/skills/agent-cost-report/scripts/acr/render.py:126-144 | plugin/skills/agent-cost-report/scripts/acr/render.py:126-144 — These 5 members are variants of one another: a block of 9 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 9 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:347 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:347-366 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:347-366 | cowork/skills/agent-cost-report/scripts/acr/render.py:347-366 | openclaw/skills/agent-cost-report/scripts/acr/render.py:347-366 | plugin/skills/agent-cost-report/scripts/acr/render.py:347-366 — These 5 members are variants of one another: a block of 9 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 7 shared lines) · ×2
  • Near-duplicate member family (5 members, 7 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:225 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:225-238 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:225-238 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:225-238 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:225-238 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:225-238 — These 5 members are variants of one another: a block of 7 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 7 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:149 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:149-168 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:149-168 | cowork/skills/agent-cost-report/scripts/acr/wins.py:149-168 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:149-168 | plugin/skills/agent-cost-report/scripts/acr/wins.py:149-168 — These 5 members are variants of one another: a block of 7 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 6 shared lines) · ×2
  • Near-duplicate member family (5 members, 6 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:249 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:249-262 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:249-262 | cowork/skills/agent-cost-report/scripts/acr/render.py:249-262 | openclaw/skills/agent-cost-report/scripts/acr/render.py:249-262 | plugin/skills/agent-cost-report/scripts/acr/render.py:249-262 — These 5 members are variants of one another: a block of 6 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 6 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:222 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:222-231 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:222-231 | cowork/skills/agent-cost-report/scripts/acr/wins.py:222-231 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:222-231 | plugin/skills/agent-cost-report/scripts/acr/wins.py:222-231 — These 5 members are variants of one another: a block of 6 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 5 shared lines) · ×2
  • Near-duplicate member family (5 members, 5 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:57 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/classify.py:57-83 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/classify.py:57-83 | cowork/skills/agent-cost-report/scripts/acr/classify.py:57-83 | openclaw/skills/agent-cost-report/scripts/acr/classify.py:57-83 | plugin/skills/agent-cost-report/scripts/acr/classify.py:57-83 — These 5 members are variants of one another: a block of 5 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Near-duplicate member family (5 members, 5 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:61 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/devices.py:61-84 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/devices.py:61-84 | cowork/skills/agent-cost-report/scripts/acr/devices.py:61-84 | openclaw/skills/agent-cost-report/scripts/acr/devices.py:61-84 | plugin/skills/agent-cost-report/scripts/acr/devices.py:61-84 — These 5 members are variants of one another: a block of 5 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (19 lines × 5) · ×2
  • Duplicated block (19 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:44 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:44-62 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:44-62 | cowork/skills/agent-cost-report/scripts/acr.py:44-62 | openclaw/skills/agent-cost-report/scripts/acr.py:44-62 | plugin/skills/agent-cost-report/scripts/acr.py:44-62 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:566 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:566-584 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py:566-584 | cowork/skills/agent-cost-report/scripts/acr/render.py:566-584 | openclaw/skills/agent-cost-report/scripts/acr/render.py:566-584 | plugin/skills/agent-cost-report/scripts/acr/render.py:566-584 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/render.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/render.py:566` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×2
  • Duplicated block (13 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:55 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:55-67 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:55-67 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:152 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:152-164 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:152-164 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:152-164 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:152-164 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:152-164 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×2
  • Duplicated block (11 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:268 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:268-278 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:268-278 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:268-278 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:268-278 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:268-278 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:244 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:244-254 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:244-254 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:244-254 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:244-254 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:244-254 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
IC1 · Incompleteness & stubs · Guard cannot change the result · ×2
  • Guard cannot change the result — returns what the code already falls through to src/services/integrations/GrokBotInstaller.ts:121 — The guard above `return cwd;` also returns `cwd`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to REDACTED:2098 — The guard above `return false;` also returns `false`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
R10 · Code Duplication · Duplicated block (44 lines × 2 locations) · ×2
  • Duplicated block (44 lines × 2 locations) scripts/sync-matrix-e2e-supabase.ts:342 — scripts/sync-matrix-e2e-supabase.ts:342 · REDACTED:437 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (44 lines × 2 locations) REDACTED:190 — REDACTED:190 · workers/sync-hub/src/index.ts:485 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (34 lines × 2 locations) · ×2
  • Duplicated block (34 lines × 2 locations) services/sync-api/src/projection-protocol.ts:2 — services/sync-api/src/projection-protocol.ts:2 · workers/sync-hub/src/projection-protocol.ts:2 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (34 lines × 2 locations) src/server/generation/providers/ClaudeObservationProvider.ts:91 — src/server/generation/providers/ClaudeObservationProvider.ts:91 · src/server/generation/providers/OpenRouterObservationProvider.ts:186 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×2
  • Duplicated block (31 lines × 2 locations) services/sync-api/src/projection.ts:147 — services/sync-api/src/projection.ts:147 · workers/sync-hub/src/index.ts:805 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (31 lines × 2 locations) src/ui/my-work/src/components/ui/empty.tsx:33 — src/ui/my-work/src/components/ui/empty.tsx:33 · src/ui/my-work/src/components/ui/item.tsx:86 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
AC2 · Forms & labels · <fieldset> without a <legend> · ×1
  • <fieldset> without a <legend> src/ui/viewer/components/ContextSettingsModal.tsx:268 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 78 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · ServerV1PostgresRoutes.setupRoutes (cyclomatic 136) · ×1
  • ServerV1PostgresRoutes.setupRoutes (cyclomatic 136) src/server/routes/v1/ServerV1PostgresRoutes.ts:161 — ServerV1PostgresRoutes.setupRoutes has cyclomatic complexity 136 (threshold 15). Most of this is not in the body itself: 5 of the 136 points are its own statements and the rest belongs to 33 function literals inside it that branch (lines 259, 337, 749, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · parser.buildSymbols (cyclomatic 120) · ×1
  • parser.buildSymbols (cyclomatic 120) REDACTED:703 — parser.buildSymbols has cyclomatic complexity 120 (threshold 15). Of this number, 101 points are the body's own statements and 19 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · buildHumanRequests (cyclomatic 114) · ×1
  • buildHumanRequests (cyclomatic 114) src/services/work-view/request-projection.mjs:97 — buildHumanRequests has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install.runInstallCommandInner (cyclomatic 101) · ×1
  • install.runInstallCommandInner (cyclomatic 101) REDACTED:2653 — install.runInstallCommandInner has cyclomatic complexity 101 (threshold 15). Of this number, 90 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeProvider.startSession (cyclomatic 101) · ×1
  • ClaudeProvider.startSession (cyclomatic 101) src/services/worker/ClaudeProvider.ts:372 — ClaudeProvider.startSession has cyclomatic complexity 101 (threshold 15). Of this number, 98 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.claudeMemPlugin (cyclomatic 100) · ×1
  • index.claudeMemPlugin (cyclomatic 100) REDACTED:630 — index.claudeMemPlugin has cyclomatic complexity 100 (threshold 15). Most of this is not in the body itself: 6 of the 100 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 807, a function literal at line 1043, getContextForPrompt, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · worker-service.main (cyclomatic 94) · ×1
  • worker-service.main (cyclomatic 94) REDACTED:1475 — worker-service.main has cyclomatic complexity 94 (threshold 15). Of this number, 89 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsRoutes.validateSettings (cyclomatic 80) · ×1
  • SettingsRoutes.validateSettings (cyclomatic 80) REDACTED:354 — SettingsRoutes.validateSettings has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeneratorRunner.startGeneratorWithProvider (cyclomatic 77) · ×1
  • GeneratorRunner.startGeneratorWithProvider (cyclomatic 77) src/services/worker/session/GeneratorRunner.ts:135 — GeneratorRunner.startGeneratorWithProvider has cyclomatic complexity 77 (threshold 15). Of this number, 31 points are the body's own statements and 46 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LogsModal.LogsDrawer (cyclomatic 68) · ×1
  • LogsModal.LogsDrawer (cyclomatic 68) src/ui/viewer/components/LogsModal.tsx:73 — LogsModal.LogsDrawer has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 12 of the 68 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 160, a function literal at line 135, a function literal at line 110, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · buildAgentView (cyclomatic 67) · ×1
  • buildAgentView (cyclomatic 67) src/services/work-view/agent-view.mjs:158 — buildAgentView has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResponseProcessor.processAgentResponse (cyclomatic 62) · ×1
  • ResponseProcessor.processAgentResponse (cyclomatic 62) src/services/worker/agents/ResponseProcessor.ts:419 — ResponseProcessor.processAgentResponse has cyclomatic complexity 62 (threshold 15). Of this number, 60 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchManager.search (cyclomatic 62) · ×1
  • SearchManager.search (cyclomatic 62) src/services/worker/SearchManager.ts:442 — SearchManager.search has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.claudeMemPi (cyclomatic 59) · ×1
  • index.claudeMemPi (cyclomatic 59) src/integrations/pi-extension/index.ts:81 — index.claudeMemPi has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 15 function items inside it that branch (a function literal at line 170, a function literal at line 153, a function literal at line 135, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · OpenRouterProvider.classifyOpenRouterError (cyclomatic 58) · ×1
  • OpenRouterProvider.classifyOpenRouterError (cyclomatic 58) src/services/worker/OpenRouterProvider.ts:166 — OpenRouterProvider.classifyOpenRouterError has cyclomatic complexity 58 (threshold 15). Of this number, 56 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContextSettingsModal.ContextSettingsModal (cyclomatic 56) · ×1
  • ContextSettingsModal.ContextSettingsModal (cyclomatic 56) src/ui/viewer/components/ContextSettingsModal.tsx:144 — ContextSettingsModal.ContextSettingsModal has cyclomatic complexity 56 (threshold 15). Of this number, 48 points are the body's own statements and 8 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · to-work-model.toRequest (cyclomatic 54) · ×1
  • to-work-model.toRequest (cyclomatic 54) src/ui/my-work/src/live/to-work-model.ts:137 — to-work-model.toRequest has cyclomatic complexity 54 (threshold 15). Of this number, 44 points are the body's own statements and 10 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · shared.ingestObservation (cyclomatic 53) · ×1
  • shared.ingestObservation (cyclomatic 53) REDACTED:149 — shared.ingestObservation has cyclomatic complexity 53 (threshold 15). Of this number, 52 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · App.App (cyclomatic 53) · ×1
  • App.App (cyclomatic 53) src/ui/viewer/App.tsx:54 — App.App has cyclomatic complexity 53 (threshold 15). Of this number, 16 points are the body's own statements and 37 belong to 15 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · index.main (cyclomatic 51) · ×1
  • index.main (cyclomatic 51) src/npx-cli/index.ts:144 — index.main has cyclomatic complexity 51 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · buffer.computeSessionCompressedRollup (cyclomatic 51) · ×1
  • buffer.computeSessionCompressedRollup (cyclomatic 51) src/services/telemetry/buffer.ts:135 — buffer.computeSessionCompressedRollup has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · field-optimizer.compactEditOutput (cyclomatic 48) · ×1
  • field-optimizer.compactEditOutput (cyclomatic 48) src/services/worker/field-optimizer.ts:219 — field-optimizer.compactEditOutput has cyclomatic complexity 48 (threshold 15). Of this number, 44 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · runCli (cyclomatic 48) · ×1
  • runCli (cyclomatic 48) src/services/work-view/request-groups.mjs:575 — runCli has cyclomatic complexity 48 (threshold 15). Of this number, 38 points are the body's own statements and 10 belong to 32 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp-text-format.formatMcpPayload (cyclomatic 47) · ×1
  • mcp-text-format.formatMcpPayload (cyclomatic 47) src/servers/mcp-text-format.ts:107 — mcp-text-format.formatMcpPayload has cyclomatic complexity 47 (threshold 15). Of this number, 34 points are the body's own statements and 13 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenRouterProvider.resolveOpenRouterConfig (cyclomatic 47) · ×1
  • OpenRouterProvider.resolveOpenRouterConfig (cyclomatic 47) src/services/worker/OpenRouterProvider.ts:694 — OpenRouterProvider.resolveOpenRouterConfig has cyclomatic complexity 47 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · applyGroupDecisions (cyclomatic 46) · ×1
  • applyGroupDecisions (cyclomatic 46) src/services/work-view/request-groups.mjs:201 — applyGroupDecisions has cyclomatic complexity 46 (threshold 15). Of this number, 43 points are the body's own statements and 3 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · worker-utils.ensureWorkerRunning (cyclomatic 45) · ×1
  • worker-utils.ensureWorkerRunning (cyclomatic 45) REDACTED:1242 — worker-utils.ensureWorkerRunning has cyclomatic complexity 45 (threshold 15). Of this number, 43 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · teambrain.parseTeamBrainBoard (cyclomatic 45) · ×1
  • teambrain.parseTeamBrainBoard (cyclomatic 45) src/shared/teambrain.ts:406 — teambrain.parseTeamBrainBoard has cyclomatic complexity 45 (threshold 15). Of this number, 35 points are the body's own statements and 10 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · field-utils.matchesRule (cyclomatic 45) · ×1
  • field-utils.matchesRule (cyclomatic 45) REDACTED:116 — field-utils.matchesRule has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchManager.timeline (cyclomatic 45) · ×1
  • SearchManager.timeline (cyclomatic 45) src/services/worker/SearchManager.ts:792 — SearchManager.timeline has cyclomatic complexity 45 (threshold 15). Of this number, 39 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · refresh-task.buildRefreshTask.run (cyclomatic 44) · ×1
  • refresh-task.buildRefreshTask.run (cyclomatic 44) src/services/work-view/refresh-task.ts:110 — refresh-task.buildRefreshTask.run has cyclomatic complexity 44 (threshold 15). Of this number, 19 points are the body's own statements and 25 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install.promptProvider (cyclomatic 43) · ×1
  • install.promptProvider (cyclomatic 43) REDACTED:1175 — install.promptProvider has cyclomatic complexity 43 (threshold 15). Of this number, 39 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · my-rules.MyRules (cyclomatic 43) · ×1
  • my-rules.MyRules (cyclomatic 43) src/ui/my-work/src/pages/my-rules.tsx:634 — my-rules.MyRules has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 15 of the 43 points are its own statements and the rest belongs to 9 function items inside it that branch (saveDraft, undoLast, save, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · reduceWorkState (cyclomatic 43) · ×1
  • reduceWorkState (cyclomatic 43) src/services/work-view/data-source.mjs:21 — reduceWorkState has cyclomatic complexity 43 (threshold 15). Of this number, 30 points are the body's own statements and 13 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeProvider.classifyClaudeError (cyclomatic 42) · ×1
  • ClaudeProvider.classifyClaudeError (cyclomatic 42) src/services/worker/ClaudeProvider.ts:138 — ClaudeProvider.classifyClaudeError has cyclomatic complexity 42 (threshold 15). Of this number, 38 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · install.makeIDETask (cyclomatic 41) · ×1
  • install.makeIDETask (cyclomatic 41) REDACTED:291 — install.makeIDETask has cyclomatic complexity 41 (threshold 15). Of this number, 19 points are the body's own statements and 22 belong to 15 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorktreeAdoption.adoptMergedWorktrees (cyclomatic 41) · ×1
  • WorktreeAdoption.adoptMergedWorktrees (cyclomatic 41) src/services/infrastructure/WorktreeAdoption.ts:492 — WorktreeAdoption.adoptMergedWorktrees has cyclomatic complexity 41 (threshold 15). Of this number, 30 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsDefaultsManager.loadFromFile (cyclomatic 40) · ×1
  • SettingsDefaultsManager.loadFromFile (cyclomatic 40) src/shared/SettingsDefaultsManager.ts:733 — SettingsDefaultsManager.loadFromFile has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude-md-utils.updateFolderClaudeMdFiles (cyclomatic 40) · ×1
  • claude-md-utils.updateFolderClaudeMdFiles (cyclomatic 40) src/utils/claude-md-utils.ts:236 — claude-md-utils.updateFolderClaudeMdFiles has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · T3CodeInstaller.discoverT3CodeProviders (cyclomatic 40) · ×1
  • T3CodeInstaller.discoverT3CodeProviders (cyclomatic 40) REDACTED:80 — T3CodeInstaller.discoverT3CodeProviders has cyclomatic complexity 40 (threshold 15). Of this number, 39 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CcsAlignRulesWalker.walkRules (cyclomatic 40) · ×1
  • CcsAlignRulesWalker.walkRules (cyclomatic 40) src/services/integrations/CcsAlignRulesWalker.ts:447 — CcsAlignRulesWalker.walkRules has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TranscriptWatcher.startTailer (cyclomatic 40) · ×1
  • TranscriptWatcher.startTailer (cyclomatic 40) src/services/transcripts/watcher.ts:932 — TranscriptWatcher.startTailer has cyclomatic complexity 40 (threshold 15). Of this number, 27 points are the body's own statements and 13 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · validateProgress (cyclomatic 40) · ×1
  • validateProgress (cyclomatic 40) src/services/work-view/request-groups.mjs:297 — validateProgress has cyclomatic complexity 40 (threshold 15). Of this number, 32 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · run (cyclomatic 40) · ×1
  • run (cyclomatic 40) REDACTED:78 — run has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.startSyncApi (cyclomatic 39) · ×1
  • index.startSyncApi (cyclomatic 39) REDACTED:381 — index.startSyncApi has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · worker-spawner.ensureWorkerStarted (cyclomatic 39) · ×1
  • worker-spawner.ensureWorkerStarted (cyclomatic 39) src/services/worker-spawner.ts:179 — worker-spawner.ensureWorkerStarted has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenRouterProvider.queryOpenRouterMultiTurn (cyclomatic 39) · ×1
  • OpenRouterProvider.queryOpenRouterMultiTurn (cyclomatic 39) src/services/worker/OpenRouterProvider.ts:954 — OpenRouterProvider.queryOpenRouterMultiTurn has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenAICompatProvider.classifyOpenAICompatError (cyclomatic 39) · ×1
  • OpenAICompatProvider.classifyOpenAICompatError (cyclomatic 39) src/services/worker/OpenAICompatProvider.ts:250 — OpenAICompatProvider.classifyOpenAICompatError has cyclomatic complexity 39 (threshold 15). Of this number, 37 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · streamed-chat-completion.assembleStream (cyclomatic 38) · ×1
  • streamed-chat-completion.assembleStream (cyclomatic 38) src/services/worker/streamed-chat-completion.ts:360 — streamed-chat-completion.assembleStream has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · backfill.collectDailyRollups (cyclomatic 37) · ×1
  • backfill.collectDailyRollups (cyclomatic 37) src/services/telemetry/backfill.ts:189 — backfill.collectDailyRollups has cyclomatic complexity 37 (threshold 15). Of this number, 20 points are the body's own statements and 17 belong to 7 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · projection.drainProjection (cyclomatic 36) · ×1
  • projection.drainProjection (cyclomatic 36) services/sync-api/src/projection.ts:103 — projection.drainProjection has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · save-error.describeSaveFailure (cyclomatic 36) · ×1
  • save-error.describeSaveFailure (cyclomatic 36) REDACTED:94 — save-error.describeSaveFailure has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.drainProjection (cyclomatic 36) · ×1
  • index.drainProjection (cyclomatic 36) workers/sync-hub/src/index.ts:758 — index.drainProjection has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · eval-read-gate.analyzeReadGateTrace (cyclomatic 34) · ×1
  • eval-read-gate.analyzeReadGateTrace (cyclomatic 34) REDACTED:245 — eval-read-gate.analyzeReadGateTrace has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TranscriptEventProcessor.handleEvent (cyclomatic 34) · ×1
  • TranscriptEventProcessor.handleEvent (cyclomatic 34) src/services/transcripts/processor.ts:268 — TranscriptEventProcessor.handleEvent has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · save_goals.main (cyclomatic 34) · ×1
  • save_goals.main (cyclomatic 34) plugin/skills/owner-goals/scripts/save_goals.py:163 — save_goals.main has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · smoke-clean-room.checkPackageCompleteness (cyclomatic 33) · ×1
  • smoke-clean-room.checkPackageCompleteness (cyclomatic 33) scripts/smoke-clean-room.cjs:185 — smoke-clean-room.checkPackageCompleteness has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · advisor-transcript.extractAdvisorCallsFromJsonl (cyclomatic 33) · ×1
  • advisor-transcript.extractAdvisorCallsFromJsonl (cyclomatic 33) src/shared/advisor-transcript.ts:135 — advisor-transcript.extractAdvisorCallsFromJsonl has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerV1Routes.setupRoutes (cyclomatic 33) · ×1
  • ServerV1Routes.setupRoutes (cyclomatic 33) REDACTED:62 — ServerV1Routes.setupRoutes has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 18 function literals inside it that branch (lines 215, 106, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · build-hooks.buildHooks (cyclomatic 32) · ×1
  • build-hooks.buildHooks (cyclomatic 32) scripts/build-hooks.js:442 — build-hooks.buildHooks has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · v2.setupV2 (cyclomatic 32) · ×1
  • v2.setupV2 (cyclomatic 32) src/integrations/opencode-plugin/v2.ts:228 — v2.setupV2 has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 8 function items inside it that branch (onBusEvent, trackSession, a function literal at line 283, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · buildRules (cyclomatic 32) · ×1
  • buildRules (cyclomatic 32) src/services/work-view/my-rules.mjs:67 — buildRules has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · memory-search.memorySearchLookup (cyclomatic 31) · ×1
  • memory-search.memorySearchLookup (cyclomatic 31) src/cli/handlers/memory-search.ts:100 — memory-search.memorySearchLookup has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · prompts.stripImagePayloads (cyclomatic 31) · ×1
  • prompts.stripImagePayloads (cyclomatic 31) src/sdk/prompts.ts:248 — prompts.stripImagePayloads has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeminiObservationProvider.categorizeGeminiBadRequest (cyclomatic 31) · ×1
  • GeminiObservationProvider.categorizeGeminiBadRequest (cyclomatic 31) src/server/generation/providers/GeminiObservationProvider.ts:48 — GeminiObservationProvider.categorizeGeminiBadRequest has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · GeminiProvider.categorizeGeminiBadRequest (cyclomatic 31) · ×1
  • GeminiProvider.categorizeGeminiBadRequest (cyclomatic 31) src/services/worker/GeminiProvider.ts:198 — GeminiProvider.categorizeGeminiBadRequest has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · readCandidates (cyclomatic 31) · ×1
  • readCandidates (cyclomatic 31) src/services/work-view/request-groups.mjs:50 — readCandidates has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to 11 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · uninstall.runUninstallCommand (cyclomatic 30) · ×1
  • uninstall.runUninstallCommand (cyclomatic 30) src/npx-cli/commands/uninstall.ts:254 — uninstall.runUninstallCommand has cyclomatic complexity 30 (threshold 15). Of this number, 23 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchManager.getRecentContext (cyclomatic 30) · ×1
  • SearchManager.getRecentContext (cyclomatic 30) src/services/worker/SearchManager.ts:1063 — SearchManager.getRecentContext has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkerService.initializeBackground (cyclomatic 30) · ×1
  • WorkerService.initializeBackground (cyclomatic 30) REDACTED:718 — WorkerService.initializeBackground has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kill-process-tree.killProcessTree (cyclomatic 29) · ×1
  • kill-process-tree.killProcessTree (cyclomatic 29) src/shared/kill-process-tree.ts:141 — kill-process-tree.killProcessTree has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · port-reclaim.reclaimGhostListeningPort (cyclomatic 29) · ×1
  • port-reclaim.reclaimGhostListeningPort (cyclomatic 29) REDACTED:725 — port-reclaim.reclaimGhostListeningPort has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CloudSync.drainMutations (cyclomatic 29) · ×1
  • CloudSync.drainMutations (cyclomatic 29) src/services/sync/CloudSync.ts:1228 — CloudSync.drainMutations has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaMcpManager.callToolUnqueued (cyclomatic 29) · ×1
  • ChromaMcpManager.callToolUnqueued (cyclomatic 29) REDACTED:1419 — ChromaMcpManager.callToolUnqueued has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SyncApply.applyOps (cyclomatic 29) · ×1
  • SyncApply.applyOps (cyclomatic 29) src/services/sync/SyncApply.ts:492 — SyncApply.applyOps has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 521, 555, 619). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Server.setupCoreRoutes (cyclomatic 29) · ×1
  • Server.setupCoreRoutes (cyclomatic 29) REDACTED:440 — Server.setupCoreRoutes has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 488, 441, 532, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · error-classification.classifyHttpProviderError (cyclomatic 29) · ×1
  • error-classification.classifyHttpProviderError (cyclomatic 29) src/server/generation/providers/shared/error-classification.ts:111 — error-classification.classifyHttpProviderError has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · parser.unfoldSymbol (cyclomatic 29) · ×1
  • parser.unfoldSymbol (cyclomatic 29) REDACTED:1346 — parser.unfoldSymbol has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · productsFromFields (cyclomatic 29) · ×1
  • productsFromFields (cyclomatic 29) src/services/work-view/work-product.mjs:259 — productsFromFields has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mergeProducts (cyclomatic 29) · ×1
  • mergeProducts (cyclomatic 29) src/services/work-view/work-product.mjs:288 — mergeProducts has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · read (cyclomatic 29) · ×1
  • read (cyclomatic 29) src/services/work-view/data-source.mjs:199 — read has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body's own statements and 8 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hook-spool.parseHookSpoolEntry (cyclomatic 28) · ×1
  • hook-spool.parseHookSpoolEntry (cyclomatic 28) src/shared/hook-spool.ts:225 — hook-spool.parseHookSpoolEntry has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · retry.withRetry (cyclomatic 28) · ×1
  • retry.withRetry (cyclomatic 28) src/services/worker/retry.ts:241 — retry.withRetry has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenAICompatProvider.queryChatCompletions (cyclomatic 28) · ×1
  • OpenAICompatProvider.queryChatCompletions (cyclomatic 28) src/services/worker/OpenAICompatProvider.ts:622 — OpenAICompatProvider.queryChatCompletions has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useContextPreview.useContextPreview (cyclomatic 28) · ×1
  • useContextPreview.useContextPreview (cyclomatic 28) src/ui/viewer/hooks/useContextPreview.ts:28 — useContextPreview.useContextPreview has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 38, 92, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · bun-runner.findBun (cyclomatic 27) · ×1
  • bun-runner.findBun (cyclomatic 27) plugin/scripts/bun-runner.js:23 — bun-runner.findBun has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HookSpool.drain (cyclomatic 27) · ×1
  • HookSpool.drain (cyclomatic 27) src/shared/hook-spool.ts:383 — HookSpool.drain has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · doctor.isChromaCrashState (cyclomatic 27) · ×1
  • doctor.isChromaCrashState (cyclomatic 27) REDACTED:94 — doctor.isChromaCrashState has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · doctor.runDoctorCommand (cyclomatic 27) · ×1
  • doctor.runDoctorCommand (cyclomatic 27) REDACTED:430 — doctor.runDoctorCommand has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · owned-file-install.replaceOwnedFiles (cyclomatic 27) · ×1
  • owned-file-install.replaceOwnedFiles (cyclomatic 27) src/shared/owned-file-install.ts:21 — owned-file-install.replaceOwnedFiles has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeminiProvider.classifyGeminiError (cyclomatic 27) · ×1
  • GeminiProvider.classifyGeminiError (cyclomatic 27) src/services/worker/GeminiProvider.ts:46 — GeminiProvider.classifyGeminiError has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · search.searchCodebase · ×1
  • search.searchCodebase::checkSymbols (cyclomatic 27) src/services/smart-file-read/search.ts:185 — search.searchCodebase::checkSymbols has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ObservationCard.ObservationCard (cyclomatic 27) · ×1
  • ObservationCard.ObservationCard (cyclomatic 27) src/ui/viewer/components/ObservationCard.tsx:32 — ObservationCard.ObservationCard has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · build-hooks.verifyShellTemplateCanonical (cyclomatic 26) · ×1
  • build-hooks.verifyShellTemplateCanonical (cyclomatic 26) scripts/build-hooks.js:325 — build-hooks.verifyShellTemplateCanonical has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sse-reader.readSseEvents (cyclomatic 26) · ×1
  • sse-reader.readSseEvents (cyclomatic 26) src/shared/sse-reader.ts:86 — sse-reader.readSseEvents has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · strip-comments.processFile (cyclomatic 26) · ×1
  • strip-comments.processFile (cyclomatic 26) scripts/strip-comments.ts:331 — strip-comments.processFile has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChromaSync.queryChroma (cyclomatic 26) · ×1
  • ChromaSync.queryChroma (cyclomatic 26) src/services/sync/ChromaSync.ts:1874 — ChromaSync.queryChroma has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tools.projectFullItem (cyclomatic 26) · ×1
  • tools.projectFullItem (cyclomatic 26) src/integrations/dsh-plugin/tools.ts:87 — tools.projectFullItem has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tools.formatFullOutput (cyclomatic 26) · ×1
  • tools.formatFullOutput (cyclomatic 26) src/integrations/dsh-plugin/tools.ts:405 — tools.formatFullOutput has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 409). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · install.waitForInstallerPairing (cyclomatic 26) · ×1
  • install.waitForInstallerPairing (cyclomatic 26) REDACTED:1903 — install.waitForInstallerPairing has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionManager.initializeSession (cyclomatic 26) · ×1
  • SessionManager.initializeSession (cyclomatic 26) src/services/worker/SessionManager.ts:252 — SessionManager.initializeSession has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeminiProvider.queryGeminiMultiTurn (cyclomatic 26) · ×1
  • GeminiProvider.queryGeminiMultiTurn (cyclomatic 26) src/services/worker/GeminiProvider.ts:453 — GeminiProvider.queryGeminiMultiTurn has cyclomatic complexity 26 (threshold 15). Of this number, 19 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerService.runServerServiceCli (cyclomatic 26) · ×1
  • ServerService.runServerServiceCli (cyclomatic 26) REDACTED:300 — ServerService.runServerServiceCli has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenRouterProvider.buildOpenRouterRequestBody (cyclomatic 26) · ×1
  • OpenRouterProvider.buildOpenRouterRequestBody (cyclomatic 26) src/services/worker/OpenRouterProvider.ts:576 — OpenRouterProvider.buildOpenRouterRequestBody has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · WorkViewRoutes.saveRule (cyclomatic 26) · ×1
  • WorkViewRoutes.saveRule (cyclomatic 26) REDACTED:312 — WorkViewRoutes.saveRule has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SessionRoutes.ensureGeneratorRunningLocked (cyclomatic 26) · ×1
  • SessionRoutes.ensureGeneratorRunningLocked (cyclomatic 26) REDACTED:245 — SessionRoutes.ensureGeneratorRunningLocked has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · deriveSessionProjects (cyclomatic 26) · ×1
  • deriveSessionProjects (cyclomatic 26) src/services/work-view/session-project.mjs:139 — deriveSessionProjects has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 belong to 10 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaSync.backfillKind (cyclomatic 25) · ×1
  • ChromaSync.backfillKind (cyclomatic 25) src/services/sync/ChromaSync.ts:1440 — ChromaSync.backfillKind has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaSync.buildClientSidePredicate (cyclomatic 25) · ×1
  • ChromaSync.buildClientSidePredicate (cyclomatic 25) src/services/sync/ChromaSync.ts:234 — ChromaSync.buildClientSidePredicate has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · memory-search.bashSearchPattern (cyclomatic 25) · ×1
  • memory-search.bashSearchPattern (cyclomatic 25) src/cli/handlers/memory-search.ts:54 — memory-search.bashSearchPattern has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install.parseInstallerOAuthStartBody (cyclomatic 25) · ×1
  • install.parseInstallerOAuthStartBody (cyclomatic 25) REDACTED:1563 — install.parseInstallerOAuthStartBody has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SearchManager.renderTimeline (cyclomatic 25) · ×1
  • SearchManager.renderTimeline (cyclomatic 25) src/services/worker/SearchManager.ts:189 — SearchManager.renderTimeline has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · zstd-frames.scanZstdFramesInFile (cyclomatic 25) · ×1
  • zstd-frames.scanZstdFramesInFile (cyclomatic 25) src/services/transcripts/zstd-frames.ts:62 — zstd-frames.scanZstdFramesInFile has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · my-work.MyWork (cyclomatic 25) · ×1
  • my-work.MyWork (cyclomatic 25) src/ui/my-work/src/pages/my-work.tsx:333 — my-work.MyWork has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · export_owner_prompts.read_owner_typed_prompts (cyclomatic 25) · ×1
  • export_owner_prompts.read_owner_typed_prompts (cyclomatic 25) plugin/skills/owner-goals/scripts/export_owner_prompts.py:98 — export_owner_prompts.read_owner_typed_prompts has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install.verifyReceipt (cyclomatic 24) · ×1
  • install.verifyReceipt (cyclomatic 24) ods/install.mjs:85 — install.verifyReceipt has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install.install (cyclomatic 24) · ×1
  • install.install (cyclomatic 24) ods/install.mjs:113 — install.install has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude-mem.claudeMemBridge (cyclomatic 24) · ×1
  • claude-mem.claudeMemBridge (cyclomatic 24) REDACTED:255 — claude-mem.claudeMemBridge has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 355, switchSession, a function literal at line 319, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · grok-bot-session-inject.refreshAgent (cyclomatic 24) · ×1
  • grok-bot-session-inject.refreshAgent (cyclomatic 24) scripts/grok-bot-session-inject.mjs:739 — grok-bot-session-inject.refreshAgent has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · port-reclaim.reclaimWedgedOwnedWorker (cyclomatic 24) · ×1
  • port-reclaim.reclaimWedgedOwnedWorker (cyclomatic 24) REDACTED:561 — port-reclaim.reclaimWedgedOwnedWorker has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.translateToLanguage (cyclomatic 24) · ×1
  • index.translateToLanguage (cyclomatic 24) scripts/translate-readme/index.ts:107 — index.translateToLanguage has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.translateReadme (cyclomatic 24) · ×1
  • index.translateReadme (cyclomatic 24) scripts/translate-readme/index.ts:244 — index.translateReadme has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 5 function items inside it that branch (translateLang, runWithConcurrency, a function literal at line 345, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · install.validateNonInteractiveProvider (cyclomatic 24) · ×1
  • install.validateNonInteractiveProvider (cyclomatic 24) REDACTED:2473 — install.validateNonInteractiveProvider has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchManager.hybridSemanticHydrate (cyclomatic 24) · ×1
  • SearchManager.hybridSemanticHydrate (cyclomatic 24) src/services/worker/SearchManager.ts:116 — SearchManager.hybridSemanticHydrate has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · export_owner_prompts.read_agent_authored_text (cyclomatic 24) · ×1
  • export_owner_prompts.read_agent_authored_text (cyclomatic 24) plugin/skills/owner-goals/scripts/export_owner_prompts.py:156 — export_owner_prompts.read_agent_authored_text has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · observe (cyclomatic 24) · ×1
  • observe (cyclomatic 24) src/services/work-view/human-copy-worker.mjs:74 — observe has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 77, 84, 85). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ProcessRegistry.reapSession (cyclomatic 23) · ×1
  • ProcessRegistry.reapSession (cyclomatic 23) src/supervisor/process-registry.ts:349 — ProcessRegistry.reapSession has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaMcpManager.connectInternal (cyclomatic 23) · ×1
  • ChromaMcpManager.connectInternal (cyclomatic 23) REDACTED:372 — ChromaMcpManager.connectInternal has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaMcpManager.acquireChromaWriterLock (cyclomatic 23) · ×1
  • ChromaMcpManager.acquireChromaWriterLock (cyclomatic 23) REDACTED:707 — ChromaMcpManager.acquireChromaWriterLock has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaMcpManager.prewarmChromaMcp (cyclomatic 23) · ×1
  • ChromaMcpManager.prewarmChromaMcp (cyclomatic 23) REDACTED:1222 — ChromaMcpManager.prewarmChromaMcp has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install-launcher.ensureLauncherOnPath (cyclomatic 23) · ×1
  • install-launcher.ensureLauncherOnPath (cyclomatic 23) src/launcher/install-launcher.ts:658 — install-launcher.ensureLauncherOnPath has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · T3CodeInstaller.pluginAssetsPresent (cyclomatic 23) · ×1
  • T3CodeInstaller.pluginAssetsPresent (cyclomatic 23) REDACTED:199 — T3CodeInstaller.pluginAssetsPresent has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RateLimitStore.set (cyclomatic 23) · ×1
  • RateLimitStore.set (cyclomatic 23) src/services/worker/RateLimitStore.ts:118 — RateLimitStore.set has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Logger.formatTool (cyclomatic 22) · ×1
  • Logger.formatTool (cyclomatic 22) src/utils/logger.ts:276 — Logger.formatTool has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CanonicalContent.validateBody (cyclomatic 22) · ×1
  • CanonicalContent.validateBody (cyclomatic 22) src/services/sync/CanonicalContent.ts:293 — CanonicalContent.validateBody has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CanonicalContent.validatePayload (cyclomatic 22) · ×1
  • CanonicalContent.validatePayload (cyclomatic 22) src/services/sync/CanonicalContent.ts:340 — CanonicalContent.validatePayload has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CanonicalContent.validateMutation (cyclomatic 22) · ×1
  • CanonicalContent.validateMutation (cyclomatic 22) src/services/sync/CanonicalContent.ts:407 — CanonicalContent.validateMutation has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · worker-utils.executeWithWorkerFallback (cyclomatic 22) · ×1
  • worker-utils.executeWithWorkerFallback (cyclomatic 22) REDACTED:2265 — worker-utils.executeWithWorkerFallback has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CloudSync.runHubStatusProbe (cyclomatic 22) · ×1
  • CloudSync.runHubStatusProbe (cyclomatic 22) src/services/sync/CloudSync.ts:1018 — CloudSync.runHubStatusProbe has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SyncClient.handleSocketMessage (cyclomatic 22) · ×1
  • SyncClient.handleSocketMessage (cyclomatic 22) src/services/sync/SyncClient.ts:999 — SyncClient.handleSocketMessage has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeObservationProvider.classifyClaudeServerError (cyclomatic 22) · ×1
  • ClaudeObservationProvider.classifyClaudeServerError (cyclomatic 22) src/server/generation/providers/ClaudeObservationProvider.ts:190 — ClaudeObservationProvider.classifyClaudeServerError has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SessionManager.deleteSession (cyclomatic 22) · ×1
  • SessionManager.deleteSession (cyclomatic 22) src/services/worker/SessionManager.ts:581 — SessionManager.deleteSession has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · create-server-service.instantiateServerGenerationProvider (cyclomatic 22) · ×1
  • create-server-service.instantiateServerGenerationProvider (cyclomatic 22) src/server/runtime/create-server-service.ts:412 — create-server-service.instantiateServerGenerationProvider has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemoryFileWatcher.scan (cyclomatic 22) · ×1
  • MemoryFileWatcher.scan (cyclomatic 22) src/services/memory/file-watcher.ts:48 — MemoryFileWatcher.scan has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · state.loadWatchState (cyclomatic 22) · ×1
  • state.loadWatchState (cyclomatic 22) src/services/transcripts/state.ts:56 — state.loadWatchState has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CodexAppServerClient.runTurnExclusive (cyclomatic 22) · ×1
  • CodexAppServerClient.runTurnExclusive (cyclomatic 22) src/services/worker/CodexAppServerClient.ts:492 — CodexAppServerClient.runTurnExclusive has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TranscriptEventProcessor.handleToolResult (cyclomatic 22) · ×1
  • TranscriptEventProcessor.handleToolResult (cyclomatic 22) src/services/transcripts/processor.ts:507 — TranscriptEventProcessor.handleToolResult has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SyncHub.pushOps (cyclomatic 22) · ×1
  • SyncHub.pushOps (cyclomatic 22) workers/sync-hub/src/do/SyncHub.ts:368 — SyncHub.pushOps has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · export-memories.exportMemories (cyclomatic 21) · ×1
  • export-memories.exportMemories (cyclomatic 21) REDACTED:52 — export-memories.exportMemories has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · observer-health.renderObserverHealthWarning (cyclomatic 21) · ×1
  • observer-health.renderObserverHealthWarning (cyclomatic 21) src/shared/observer-health.ts:650 — observer-health.renderObserverHealthWarning has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CloudSync.flush (cyclomatic 21) · ×1
  • CloudSync.flush (cyclomatic 21) src/services/sync/CloudSync.ts:754 — CloudSync.flush has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CloudSync.pushOps (cyclomatic 21) · ×1
  • CloudSync.pushOps (cyclomatic 21) src/services/sync/CloudSync.ts:1669 — CloudSync.pushOps has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 1726). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · mode-validation.validateMode (cyclomatic 21) · ×1
  • mode-validation.validateMode (cyclomatic 21) src/services/domain/mode-validation.ts:49 — mode-validation.validateMode has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HubStore.pushOps (cyclomatic 21) · ×1
  • HubStore.pushOps (cyclomatic 21) services/sync-api/src/store.ts:357 — HubStore.pushOps has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · progressive-search.projectMemoryContent (cyclomatic 21) · ×1
  • progressive-search.projectMemoryContent (cyclomatic 21) src/shared/progressive-search.ts:239 — progressive-search.projectMemoryContent has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · T3CodeInstaller.installT3Code (cyclomatic 21) · ×1
  • T3CodeInstaller.installT3Code (cyclomatic 21) REDACTED:229 — T3CodeInstaller.installT3Code has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hermes-config-yaml.findBlock (cyclomatic 21) · ×1
  • hermes-config-yaml.findBlock (cyclomatic 21) src/services/integrations/hermes-config-yaml.ts:55 — hermes-config-yaml.findBlock has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shutdown-helper.shutdownWorkerAndWait (cyclomatic 21) · ×1
  • shutdown-helper.shutdownWorkerAndWait (cyclomatic 21) src/services/install/shutdown-helper.ts:104 — shutdown-helper.shutdownWorkerAndWait has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · uninstall.removeStrayClaudeMemPaths (cyclomatic 21) · ×1
  • uninstall.removeStrayClaudeMemPaths (cyclomatic 21) src/npx-cli/commands/uninstall.ts:169 — uninstall.removeStrayClaudeMemPaths has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProviderObservationGenerator.process (cyclomatic 21) · ×1
  • ProviderObservationGenerator.process (cyclomatic 21) src/server/generation/ProviderObservationGenerator.ts:168 — ProviderObservationGenerator.process has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · App.LoadedApp (cyclomatic 21) · ×1
  • App.LoadedApp (cyclomatic 21) src/ui/my-work/src/App.tsx:115 — App.LoadedApp has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · connection-status.getConnectionStatus (cyclomatic 21) · ×1
  • connection-status.getConnectionStatus (cyclomatic 21) src/ui/my-work/src/live/connection-status.ts:54 — connection-status.getConnectionStatus has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Feed.Feed (cyclomatic 21) · ×1
  • Feed.Feed (cyclomatic 21) src/ui/viewer/components/Feed.tsx:22 — Feed.Feed has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · readGoals (cyclomatic 21) · ×1
  • readGoals (cyclomatic 21) src/services/work-view/request-groups.mjs:150 — readGoals has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 158, 162, 158, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · cmem-hook.flushSpool (cyclomatic 20) · ×1
  • cmem-hook.flushSpool (cyclomatic 20) cowork/scripts/cmem-hook.mjs:216 — cmem-hook.flushSpool has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Logger.log (cyclomatic 20) · ×1
  • Logger.log (cyclomatic 20) src/utils/logger.ts:351 — Logger.log has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionStore.getObservationsByIds (cyclomatic 20) · ×1
  • SessionStore.getObservationsByIds (cyclomatic 20) src/services/sqlite/SessionStore.ts:3207 — SessionStore.getObservationsByIds has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChromaSync.addDocuments (cyclomatic 20) · ×1
  • ChromaSync.addDocuments (cyclomatic 20) src/services/sync/ChromaSync.ts:727 — ChromaSync.addDocuments has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · auth.authenticateRequest (cyclomatic 20) · ×1
  • auth.authenticateRequest (cyclomatic 20) services/sync-api/src/auth.ts:175 — auth.authenticateRequest has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · file-context.lookupFileObservationHistory (cyclomatic 20) · ×1
  • file-context.lookupFileObservationHistory (cyclomatic 20) src/cli/handlers/file-context.ts:436 — file-context.lookupFileObservationHistory has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HermesInstaller.uninstallHermesIntegration (cyclomatic 20) · ×1
  • HermesInstaller.uninstallHermesIntegration (cyclomatic 20) src/services/integrations/HermesInstaller.ts:176 — HermesInstaller.uninstallHermesIntegration has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CursorHooksInstaller.checkCursorHooksStatus (cyclomatic 20) · ×1
  • CursorHooksInstaller.checkCursorHooksStatus (cyclomatic 20) src/services/integrations/CursorHooksInstaller.ts:475 — CursorHooksInstaller.checkCursorHooksStatus has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetry.errorBeforeSend (cyclomatic 20) · ×1
  • telemetry.errorBeforeSend (cyclomatic 20) src/services/telemetry/telemetry.ts:337 — telemetry.errorBeforeSend has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ServerService.runServerApiKeyCli (cyclomatic 20) · ×1
  • ServerService.runServerApiKeyCli (cyclomatic 20) REDACTED:514 — ServerService.runServerApiKeyCli has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · find-claude-executable.findClaudeExecutable (cyclomatic 20) · ×1
  • find-claude-executable.findClaudeExecutable (cyclomatic 20) src/shared/find-claude-executable.ts:414 — find-claude-executable.findClaudeExecutable has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchManager.normalizeParams (cyclomatic 20) · ×1
  • SearchManager.normalizeParams (cyclomatic 20) src/services/worker/SearchManager.ts:294 — SearchManager.normalizeParams has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · data.assertConsistentRequest (cyclomatic 20) · ×1
  • data.assertConsistentRequest (cyclomatic 20) src/ui/my-work/src/data.ts:215 — data.assertConsistentRequest has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 216). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · createHumanCopyInput (cyclomatic 20) · ×1
  • createHumanCopyInput (cyclomatic 20) src/services/work-view/human-copy.mjs:41 — createHumanCopyInput has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 10 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · index.connectToSSEStream (cyclomatic 19) · ×1
  • index.connectToSSEStream (cyclomatic 19) REDACTED:536 — index.connectToSSEStream has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tree-sitter-cli-provision.ensureTreeSitterCliBinary (cyclomatic 19) · ×1
  • tree-sitter-cli-provision.ensureTreeSitterCliBinary (cyclomatic 19) src/services/smart-file-read/tree-sitter-cli-provision.ts:221 — tree-sitter-cli-provision.ensureTreeSitterCliBinary has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · grok-bot-session-inject.runWatch (cyclomatic 19) · ×1
  • grok-bot-session-inject.runWatch (cyclomatic 19) scripts/grok-bot-session-inject.mjs:893 — grok-bot-session-inject.runWatch has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (kick, ensureActivityWatches, pollActivity). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · strip-comments.stripHashFromLine (cyclomatic 19) · ×1
  • strip-comments.stripHashFromLine (cyclomatic 19) scripts/strip-comments.ts:298 — strip-comments.stripHashFromLine has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SyncApply.applyRemapProject (cyclomatic 19) · ×1
  • SyncApply.applyRemapProject (cyclomatic 19) src/services/sync/SyncApply.ts:1565 — SyncApply.applyRemapProject has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SyncClient.pullCycle (cyclomatic 19) · ×1
  • SyncClient.pullCycle (cyclomatic 19) src/services/sync/SyncClient.ts:637 — SyncClient.pullCycle has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · progressive-search.renderProgressiveSearchResult (cyclomatic 19) · ×1
  • progressive-search.renderProgressiveSearchResult (cyclomatic 19) src/shared/progressive-search.ts:299 — progressive-search.renderProgressiveSearchResult has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · teambrain.runJoin (cyclomatic 19) · ×1
  • teambrain.runJoin (cyclomatic 19) src/npx-cli/commands/teambrain.ts:544 — teambrain.runJoin has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · teambrain.runLeave (cyclomatic 19) · ×1
  • teambrain.runLeave (cyclomatic 19) src/npx-cli/commands/teambrain.ts:755 — teambrain.runLeave has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResponseProcessor.syncAndBroadcastObservations (cyclomatic 19) · ×1
  • ResponseProcessor.syncAndBroadcastObservations (cyclomatic 19) src/services/worker/agents/ResponseProcessor.ts:1060 — ResponseProcessor.syncAndBroadcastObservations has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · create-server-service.validateServerEnv (cyclomatic 19) · ×1
  • create-server-service.validateServerEnv (cyclomatic 19) src/server/runtime/create-server-service.ts:94 — create-server-service.validateServerEnv has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CleanupV12_4_3.executeCleanup (cyclomatic 19) · ×1
  • CleanupV12_4_3.executeCleanup (cyclomatic 19) src/services/infrastructure/CleanupV12_4_3.ts:120 — CleanupV12_4_3.executeCleanup has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexAppServerClient.handleNotification (cyclomatic 19) · ×1
  • CodexAppServerClient.handleNotification (cyclomatic 19) src/services/worker/CodexAppServerClient.ts:901 — CodexAppServerClient.handleNotification has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · streamed-chat-completion.sendChatCompletion (cyclomatic 19) · ×1
  • streamed-chat-completion.sendChatCompletion (cyclomatic 19) src/services/worker/streamed-chat-completion.ts:288 — streamed-chat-completion.sendChatCompletion has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchOrchestrator.supplementEmptyCategories (cyclomatic 19) · ×1
  • SearchOrchestrator.supplementEmptyCategories (cyclomatic 19) src/services/worker/search/SearchOrchestrator.ts:163 — SearchOrchestrator.supplementEmptyCategories has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchOrchestrator.normalizeParams (cyclomatic 19) · ×1
  • SearchOrchestrator.normalizeParams (cyclomatic 19) src/services/worker/search/SearchOrchestrator.ts:245 — SearchOrchestrator.normalizeParams has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SearchManager.searchObservations (cyclomatic 19) · ×1
  • SearchManager.searchObservations (cyclomatic 19) src/services/worker/SearchManager.ts:984 — SearchManager.searchObservations has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sample-source.applySampleRuleChange (cyclomatic 19) · ×1
  • sample-source.applySampleRuleChange (cyclomatic 19) src/ui/my-work/src/live/sample-source.ts:18 — sample-source.applySampleRuleChange has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · index.authenticateRequest (cyclomatic 19) · ×1
  • index.authenticateRequest (cyclomatic 19) workers/sync-hub/src/index.ts:324 — index.authenticateRequest has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · commitsFrom (cyclomatic 19) · ×1
  • commitsFrom (cyclomatic 19) src/services/work-view/work-product.mjs:125 — commitsFrom has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · collector.formatDiagnostics (cyclomatic 18) · ×1
  • collector.formatDiagnostics (cyclomatic 18) REDACTED:324 — collector.formatDiagnostics has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SessionSearch.searchSessions (cyclomatic 18) · ×1
  • SessionSearch.searchSessions (cyclomatic 18) src/services/sqlite/SessionSearch.ts:812 — SessionSearch.searchSessions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · eval-read-gate.parseRunnerArguments (cyclomatic 18) · ×1
  • eval-read-gate.parseRunnerArguments (cyclomatic 18) REDACTED:124 — eval-read-gate.parseRunnerArguments has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · error-scrub.extractErrorType (cyclomatic 18) · ×1
  • error-scrub.extractErrorType (cyclomatic 18) src/services/telemetry/error-scrub.ts:343 — error-scrub.extractErrorType has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HealthMonitor.probePortBind (cyclomatic 18) · ×1
  • HealthMonitor.probePortBind (cyclomatic 18) REDACTED:127 — HealthMonitor.probePortBind has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 170, 130, 141, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · worker-spawn-gate.acquireSpawnLock (cyclomatic 18) · ×1
  • worker-spawn-gate.acquireSpawnLock (cyclomatic 18) src/shared/worker-spawn-gate.ts:100 — worker-spawn-gate.acquireSpawnLock has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · worker-utils.readWorkerReadyStream (cyclomatic 18) · ×1
  • worker-utils.readWorkerReadyStream (cyclomatic 18) REDACTED:787 — worker-utils.readWorkerReadyStream has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · spool-hook-event.uploadRemoteHookSpool (cyclomatic 18) · ×1
  • spool-hook-event.uploadRemoteHookSpool (cyclomatic 18) src/cli/spool-hook-event.ts:23 — spool-hook-event.uploadRemoteHookSpool has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 38, canContinue). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · bun-runtime.findBun (cyclomatic 18) · ×1
  • bun-runtime.findBun (cyclomatic 18) src/launcher/bun-runtime.ts:98 — bun-runtime.findBun has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexCliInstaller.tomlStructuralLines (cyclomatic 18) · ×1
  • CodexCliInstaller.tomlStructuralLines (cyclomatic 18) src/services/integrations/CodexCliInstaller.ts:256 — CodexCliInstaller.tomlStructuralLines has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 258). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · HermesInstaller.installHermesIntegration (cyclomatic 18) · ×1
  • HermesInstaller.installHermesIntegration (cyclomatic 18) src/services/integrations/HermesInstaller.ts:112 — HermesInstaller.installHermesIntegration has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · install.promptClaudeModel (cyclomatic 18) · ×1
  • install.promptClaudeModel (cyclomatic 18) REDACTED:1392 — install.promptClaudeModel has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · processGeneratedResponse.persistGeneratedObservations (cyclomatic 18) · ×1
  • processGeneratedResponse.persistGeneratedObservations (cyclomatic 18) src/server/generation/processGeneratedResponse.ts:293 — processGeneratedResponse.persistGeneratedObservations has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 316). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · api-key-pool.hydrate (cyclomatic 18) · ×1
  • api-key-pool.hydrate (cyclomatic 18) src/shared/api-key-pool.ts:260 — api-key-pool.hydrate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · recall-mcp-server.dispatchToolCall (cyclomatic 18) · ×1
  • recall-mcp-server.dispatchToolCall (cyclomatic 18) src/server/mcp/recall-mcp-server.ts:152 — recall-mcp-server.dispatchToolCall has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CodexAppServerClient.createPrivateRuntime (cyclomatic 18) · ×1
  • CodexAppServerClient.createPrivateRuntime (cyclomatic 18) src/services/worker/CodexAppServerClient.ts:329 — CodexAppServerClient.createPrivateRuntime has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexProvider.classifyCodexError (cyclomatic 18) · ×1
  • CodexProvider.classifyCodexError (cyclomatic 18) src/services/worker/CodexProvider.ts:116 — CodexProvider.classifyCodexError has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CorpusBuilder.build (cyclomatic 18) · ×1
  • CorpusBuilder.build (cyclomatic 18) src/services/worker/knowledge/CorpusBuilder.ts:37 — CorpusBuilder.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · request-detail.RequestDetail (cyclomatic 18) · ×1
  • request-detail.RequestDetail (cyclomatic 18) src/ui/my-work/src/components/request-detail.tsx:117 — request-detail.RequestDetail has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · control-plane-probe.runControlPlaneProbe (cyclomatic 18) · ×1
  • control-plane-probe.runControlPlaneProbe (cyclomatic 18) workers/sync-hub/src/control-plane-probe.ts:336 — control-plane-probe.runControlPlaneProbe has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tool-uses.getToolUsesByIds (cyclomatic 17) · ×1
  • tool-uses.getToolUsesByIds (cyclomatic 17) src/services/sqlite/tool-uses.ts:314 — tool-uses.getToolUsesByIds has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tag-stripping.stripBalancedMemoryTags (cyclomatic 17) · ×1
  • tag-stripping.stripBalancedMemoryTags (cyclomatic 17) src/utils/tag-stripping.ts:42 — tag-stripping.stripBalancedMemoryTags has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CanonicalContent.parseCanonicalOperation (cyclomatic 17) · ×1
  • CanonicalContent.parseCanonicalOperation (cyclomatic 17) src/services/sync/CanonicalContent.ts:239 — CanonicalContent.parseCanonicalOperation has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · worker-utils.ensureWorkerReadyWithin (cyclomatic 17) · ×1
  • worker-utils.ensureWorkerReadyWithin (cyclomatic 17) REDACTED:1760 — worker-utils.ensureWorkerReadyWithin has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude-md-utils.formatTimelineForClaudeMd (cyclomatic 17) · ×1
  • claude-md-utils.formatTimelineForClaudeMd (cyclomatic 17) src/utils/claude-md-utils.ts:117 — claude-md-utils.formatTimelineForClaudeMd has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · smoke-clean-room.checkPluginClosure (cyclomatic 17) · ×1
  • smoke-clean-room.checkPluginClosure (cyclomatic 17) scripts/smoke-clean-room.cjs:79 — smoke-clean-room.checkPluginClosure has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ChromaMcpManager.disposeCurrentSubprocess (cyclomatic 17) · ×1
  • ChromaMcpManager.disposeCurrentSubprocess (cyclomatic 17) REDACTED:1702 — ChromaMcpManager.disposeCurrentSubprocess has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · transcript-parser.findLastMessageInJsonl (cyclomatic 17) · ×1
  • transcript-parser.findLastMessageInJsonl (cyclomatic 17) src/shared/transcript-parser.ts:383 — transcript-parser.findLastMessageInJsonl has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install.requireWorkerStopped (cyclomatic 17) · ×1
  • install.requireWorkerStopped (cyclomatic 17) REDACTED:2372 — install.requireWorkerStopped has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · output-classifier.describeObserverOutputShape (cyclomatic 17) · ×1
  • output-classifier.describeObserverOutputShape (cyclomatic 17) src/sdk/output-classifier.ts:49 — output-classifier.describeObserverOutputShape has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResponseProcessor.extractPathsFromToolInput (cyclomatic 17) · ×1
  • ResponseProcessor.extractPathsFromToolInput (cyclomatic 17) src/services/worker/agents/ResponseProcessor.ts:122 — ResponseProcessor.extractPathsFromToolInput has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProjectMerge.mergeProjectInto (cyclomatic 17) · ×1
  • ProjectMerge.mergeProjectInto (cyclomatic 17) src/services/infrastructure/ProjectMerge.ts:39 — ProjectMerge.mergeProjectInto has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MemoryFileWatcher.readMarkdown (cyclomatic 17) · ×1
  • MemoryFileWatcher.readMarkdown (cyclomatic 17) src/services/memory/file-watcher.ts:90 — MemoryFileWatcher.readMarkdown has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · provider-dispatch.noteQuotaFallbackTransition (cyclomatic 17) · ×1
  • provider-dispatch.noteQuotaFallbackTransition (cyclomatic 17) src/services/worker/provider-dispatch.ts:249 — provider-dispatch.noteQuotaFallbackTransition has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SessionRoutes.admitAndStartGenerator (cyclomatic 17) · ×1
  • SessionRoutes.admitAndStartGenerator (cyclomatic 17) REDACTED:447 — SessionRoutes.admitAndStartGenerator has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileTailer.readNewZstdFrames (cyclomatic 17) · ×1
  • FileTailer.readNewZstdFrames (cyclomatic 17) src/services/transcripts/watcher.ts:455 — FileTailer.readNewZstdFrames has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · my-rules.AgentFile (cyclomatic 17) · ×1
  • my-rules.AgentFile (cyclomatic 17) src/ui/my-work/src/pages/my-rules.tsx:457 — my-rules.AgentFile has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · productsFromToolUse (cyclomatic 17) · ×1
  • productsFromToolUse (cyclomatic 17) src/services/work-view/work-product.mjs:223 — productsFromToolUse has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · validateOutcome (cyclomatic 17) · ×1
  • validateOutcome (cyclomatic 17) src/services/work-view/request-groups.mjs:269 — validateOutcome has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Logger.safeStringify (cyclomatic 16) · ×1
  • Logger.safeStringify (cyclomatic 16) src/utils/logger.ts:209 — Logger.safeStringify has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (prune). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · index.generateBugReport (cyclomatic 16) · ×1
  • index.generateBugReport (cyclomatic 16) scripts/bug-report/index.ts:26 — index.generateBugReport has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionSearch.ensureFTSTables (cyclomatic 16) · ×1
  • SessionSearch.ensureFTSTables (cyclomatic 16) src/services/sqlite/SessionSearch.ts:134 — SessionSearch.ensureFTSTables has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SessionSearch.buildFilterClause (cyclomatic 16) · ×1
  • SessionSearch.buildFilterClause (cyclomatic 16) src/services/sqlite/SessionSearch.ts:300 — SessionSearch.buildFilterClause has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CanonicalContent.normalizeJson (cyclomatic 16) · ×1
  • CanonicalContent.normalizeJson (cyclomatic 16) src/services/sync/CanonicalContent.ts:78 — CanonicalContent.normalizeJson has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionStore.getTimelineAroundObservation (cyclomatic 16) · ×1
  • SessionStore.getTimelineAroundObservation (cyclomatic 16) src/services/sqlite/SessionStore.ts:4288 — SessionStore.getTimelineAroundObservation has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProcessManager.resolveWorkerRuntimePathUncached (cyclomatic 16) · ×1
  • ProcessManager.resolveWorkerRuntimePathUncached (cyclomatic 16) REDACTED:127 — ProcessManager.resolveWorkerRuntimePathUncached has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sync-health.readSyncHealth (cyclomatic 16) · ×1
  • sync-health.readSyncHealth (cyclomatic 16) src/shared/sync-health.ts:113 — sync-health.readSyncHealth has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChromaMcpManager.readChromaStoreRecord (cyclomatic 16) · ×1
  • ChromaMcpManager.readChromaStoreRecord (cyclomatic 16) REDACTED:908 — ChromaMcpManager.readChromaStoreRecord has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ServerClient.request (cyclomatic 16) · ×1
  • ServerClient.request (cyclomatic 16) src/services/hooks/server-client.ts:446 — ServerClient.request has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EnvManager.buildIsolatedEnvWithFreshOAuth (cyclomatic 16) · ×1
  • EnvManager.buildIsolatedEnvWithFreshOAuth (cyclomatic 16) src/shared/EnvManager.ts:335 — EnvManager.buildIsolatedEnvWithFreshOAuth has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · stdin-reader.readJsonFromStdin (cyclomatic 16) · ×1
  • stdin-reader.readJsonFromStdin (cyclomatic 16) src/cli/stdin-reader.ts:42 — stdin-reader.readJsonFromStdin has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 88, 108, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · index.parseInstallOptions (cyclomatic 16) · ×1
  • index.parseInstallOptions (cyclomatic 16) src/npx-cli/index.ts:84 — index.parseInstallOptions has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · openrouter-token-compatibility.isMaxCompletionTokensCompatibilityError (cyclomatic 16) · ×1
  • openrouter-token-compatibility.isMaxCompletionTokensCompatibilityError (cyclomatic 16) src/shared/openrouter-token-compatibility.ts:1 — openrouter-token-compatibility.isMaxCompletionTokensCompatibilityError has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ServerJobQueue.start (cyclomatic 16) · ×1
  • ServerJobQueue.start (cyclomatic 16) src/server/jobs/ServerJobQueue.ts:249 — ServerJobQueue.start has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 272, 287, 269). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ServerV1PostgresRoutes.retryGenerationJob (cyclomatic 16) · ×1
  • ServerV1PostgresRoutes.retryGenerationJob (cyclomatic 16) src/server/routes/v1/ServerV1PostgresRoutes.ts:1708 — ServerV1PostgresRoutes.retryGenerationJob has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · mcp-http.startMcpHttpServer.handle (cyclomatic 16) · ×1
  • mcp-http.startMcpHttpServer.handle (cyclomatic 16) src/servers/mcp-http.ts:335 — mcp-http.startMcpHttpServer.handle has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CcsAlignMiddleCache.appendMiddleCacheRecordsAtomic (cyclomatic 16) · ×1
  • CcsAlignMiddleCache.appendMiddleCacheRecordsAtomic (cyclomatic 16) src/services/integrations/CcsAlignMiddleCache.ts:335 — CcsAlignMiddleCache.appendMiddleCacheRecordsAtomic has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeProvider.createMessageGenerator (cyclomatic 16) · ×1
  • ClaudeProvider.createMessageGenerator (cyclomatic 16) src/services/worker/ClaudeProvider.ts:1165 — ClaudeProvider.createMessageGenerator has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agent-view.buildAgentView.getGroup (cyclomatic 16) · ×1
  • agent-view.buildAgentView.getGroup (cyclomatic 16) src/services/work-view/agent-view.mjs:238 — agent-view.buildAgentView.getGroup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeneratorExitHandler.handleGeneratorExit (cyclomatic 16) · ×1
  • GeneratorExitHandler.handleGeneratorExit (cyclomatic 16) src/services/worker/session/GeneratorExitHandler.ts:46 — GeneratorExitHandler.handleGeneratorExit has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · status-normalization.normalizeRequestStatus (cyclomatic 16) · ×1
  • status-normalization.normalizeRequestStatus (cyclomatic 16) src/ui/my-work/src/live/status-normalization.ts:72 — status-normalization.normalizeRequestStatus has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useSessionCatalog.useSessionCatalog.fetchPage (cyclomatic 16) · ×1
  • useSessionCatalog.useSessionCatalog.fetchPage (cyclomatic 16) src/ui/viewer/hooks/useSessionCatalog.ts:44 — useSessionCatalog.useSessionCatalog.fetchPage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · canary.parseArgs (cyclomatic 16) · ×1
  • canary.parseArgs (cyclomatic 16) workers/sync-hub/canary/canary.ts:85 — canary.parseArgs has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · pushesFrom (cyclomatic 16) · ×1
  • pushesFrom (cyclomatic 16) src/services/work-view/work-product.mjs:168 — pushesFrom has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · buildHumanRequests · ×1
  • buildHumanRequests::requestFor (cyclomatic 16) src/services/work-view/request-projection.mjs:173 — buildHumanRequests::requestFor has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · readAgentRecords (cyclomatic 16) · ×1
  • readAgentRecords (cyclomatic 16) src/services/work-view/agent-view.mjs:78 — readAgentRecords has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 17 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · parser.buildSymbols (cognitive 212) · ×1
  • parser.buildSymbols (cognitive 212) REDACTED:703 — parser.buildSymbols has cognitive complexity 212 (threshold 15). Drivers by points: if/else 51 (127 pts), boolean chains 40, ternaries 8 (23 pts), loops 11 (22 pts) (nesting depth added 102). Of this number, 201 points are the body's own statements and 11 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeProvider.startSession (cognitive 201) · ×1
  • ClaudeProvider.startSession (cognitive 201) src/services/worker/ClaudeProvider.ts:372 — ClaudeProvider.startSession has cognitive complexity 201 (threshold 15). Drivers by points: if/else 39 (99 pts), ternaries 17 (51 pts), boolean chains 26, error handling 8 (24 pts), loops 1 (nesting depth added 110). Of this number, 198 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ServerV1PostgresRoutes.setupRoutes (cognitive 163) · ×1
  • ServerV1PostgresRoutes.setupRoutes (cognitive 163) src/server/routes/v1/ServerV1PostgresRoutes.ts:161 — ServerV1PostgresRoutes.setupRoutes has cognitive complexity 163 (threshold 15). Drivers by points: if/else 72 (80 pts), ternaries 32 (54 pts), error handling 14, boolean chains 13, loops 1 (2 pts) (nesting depth added 31). Most of this is not in the body itself: 4 of the 163 points are its own statements and the rest belongs to 33 function literals inside it that branch (lines 337, 259, 749, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · buildHumanRequests (cognitive 160) · ×1
  • buildHumanRequests (cognitive 160) src/services/work-view/request-projection.mjs:97 — buildHumanRequests has cognitive complexity 160 (threshold 15). Drivers by points: if/else 39 (80 pts), other 56, ternaries 29 (55 pts), boolean chains 36, loops 23 (36 pts) (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.runInstallCommandInner (cognitive 157) · ×1
  • install.runInstallCommandInner (cognitive 157) REDACTED:2653 — install.runInstallCommandInner has cognitive complexity 157 (threshold 15). Drivers by points: if/else 57 (78 pts), ternaries 31 (52 pts), error handling 6 (14 pts), boolean chains 12, match/switch 1 (nesting depth added 50). Of this number, 146 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker-service.main (cognitive 122) · ×1
  • worker-service.main (cognitive 122) REDACTED:1475 — worker-service.main has cognitive complexity 122 (threshold 15). Drivers by points: if/else 39 (78 pts), ternaries 10 (22 pts), boolean chains 19, loops 1 (2 pts), match/switch 1 (nesting depth added 52). Of this number, 115 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.claudeMemPlugin (cognitive 107) · ×1
  • index.claudeMemPlugin (cognitive 107) REDACTED:630 — index.claudeMemPlugin has cognitive complexity 107 (threshold 15). Drivers by points: if/else 43 (51 pts), boolean chains 34, ternaries 13 (14 pts), loops 6 (7 pts), error handling 1 (nesting depth added 10). Most of this is not in the body itself: 5 of the 107 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 807, a function literal at line 858, a function literal at line 1043, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · SearchManager.search (cognitive 105) · ×1
  • SearchManager.search (cognitive 105) src/services/worker/SearchManager.ts:442 — SearchManager.search has cognitive complexity 105 (threshold 15). Drivers by points: if/else 34 (59 pts), ternaries 9 (23 pts), boolean chains 8, loops 4 (8 pts), error handling 3 (7 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchManager.getRecentContext (cognitive 101) · ×1
  • SearchManager.getRecentContext (cognitive 101) src/services/worker/SearchManager.ts:1063 — SearchManager.getRecentContext has cognitive complexity 101 (threshold 15). Drivers by points: if/else 20 (66 pts), ternaries 4 (17 pts), error handling 2 (10 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 70). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · buildAgentView (cognitive 97) · ×1
  • buildAgentView (cognitive 97) src/services/work-view/agent-view.mjs:158 — buildAgentView has cognitive complexity 97 (threshold 15). Drivers by points: ternaries 45 (75 pts), other 55, if/else 27 (47 pts), boolean chains 18, loops 13 (17 pts), error handling 2 (5 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsDefaultsManager.loadFromFile (cognitive 95) · ×1
  • SettingsDefaultsManager.loadFromFile (cognitive 95) src/shared/SettingsDefaultsManager.ts:733 — SettingsDefaultsManager.loadFromFile has cognitive complexity 95 (threshold 15). Drivers by points: ternaries 11 (39 pts), if/else 16 (30 pts), error handling 7 (19 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsRoutes.validateSettings (cognitive 95) · ×1
  • SettingsRoutes.validateSettings (cognitive 95) REDACTED:354 — SettingsRoutes.validateSettings has cognitive complexity 95 (threshold 15). Drivers by points: if/else 47 (68 pts), boolean chains 20, ternaries 1 (3 pts), error handling 1 (2 pts), loops 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResponseProcessor.processAgentResponse (cognitive 94) · ×1
  • ResponseProcessor.processAgentResponse (cognitive 94) src/services/worker/agents/ResponseProcessor.ts:419 — ResponseProcessor.processAgentResponse has cognitive complexity 94 (threshold 15). Drivers by points: if/else 24 (35 pts), ternaries 12 (24 pts), error handling 6 (18 pts), boolean chains 16, loops 1 (nesting depth added 35). Of this number, 92 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CcsAlignRulesWalker.walkRules (cognitive 87) · ×1
  • CcsAlignRulesWalker.walkRules (cognitive 87) src/services/integrations/CcsAlignRulesWalker.ts:447 — CcsAlignRulesWalker.walkRules has cognitive complexity 87 (threshold 15). Drivers by points: if/else 15 (41 pts), ternaries 5 (19 pts), loops 11 (17 pts), error handling 3 (7 pts), boolean chains 3 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogsModal.LogsDrawer (cognitive 86) · ×1
  • LogsModal.LogsDrawer (cognitive 86) src/ui/viewer/components/LogsModal.tsx:73 — LogsModal.LogsDrawer has cognitive complexity 86 (threshold 15). Drivers by points: if/else 41 (50 pts), ternaries 14 (19 pts), boolean chains 12, error handling 3 (5 pts) (nesting depth added 16). Most of this is not in the body itself: 12 of the 86 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 160, a function literal at line 135, a function literal at line 110, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · worker-utils.ensureWorkerRunning (cognitive 84) · ×1
  • worker-utils.ensureWorkerRunning (cognitive 84) REDACTED:1242 — worker-utils.ensureWorkerRunning has cognitive complexity 84 (threshold 15). Drivers by points: if/else 36 (72 pts), boolean chains 6, ternaries 3 (4 pts), error handling 1 (2 pts) (nesting depth added 38). Of this number, 82 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaMcpManager.acquireChromaWriterLock (cognitive 78) · ×1
  • ChromaMcpManager.acquireChromaWriterLock (cognitive 78) REDACTED:707 — ChromaMcpManager.acquireChromaWriterLock has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 9 (43 pts), if/else 7 (18 pts), error handling 4 (15 pts), boolean chains 1, loops 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buffer.computeSessionCompressedRollup (cognitive 76) · ×1
  • buffer.computeSessionCompressedRollup (cognitive 76) src/services/telemetry/buffer.ts:135 — buffer.computeSessionCompressedRollup has cognitive complexity 76 (threshold 15). Drivers by points: if/else 28 (52 pts), boolean chains 17, loops 3 (5 pts), ternaries 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchManager.timeline (cognitive 75) · ×1
  • SearchManager.timeline (cognitive 75) src/services/worker/SearchManager.ts:792 — SearchManager.timeline has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (34 pts), ternaries 8 (19 pts), boolean chains 16, error handling 2 (6 pts) (nesting depth added 28). Of this number, 68 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build-hooks.verifyShellTemplateCanonical (cognitive 69) · ×1
  • build-hooks.verifyShellTemplateCanonical (cognitive 69) scripts/build-hooks.js:325 — build-hooks.verifyShellTemplateCanonical has cognitive complexity 69 (threshold 15). Drivers by points: if/else 16 (53 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · reduceWorkState (cognitive 68) · ×1
  • reduceWorkState (cognitive 68) src/services/work-view/data-source.mjs:21 — reduceWorkState has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 9 (19 pts), boolean chains 12, other 7, loops 3 (4 pts) (nesting depth added 24). Of this number, 50 points are the body's own statements and 18 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runCli (cognitive 67) · ×1
  • runCli (cognitive 67) src/services/work-view/request-groups.mjs:575 — runCli has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 9 (22 pts), if/else 14 (20 pts), other 15, boolean chains 8, loops 1 (2 pts) (nesting depth added 20). Of this number, 53 points are the body's own statements and 14 belong to 32 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · applyGroupDecisions (cognitive 66) · ×1
  • applyGroupDecisions (cognitive 66) src/services/work-view/request-groups.mjs:201 — applyGroupDecisions has cognitive complexity 66 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 8 (14 pts), boolean chains 10, other 6, ternaries 2 (4 pts) (nesting depth added 26). Of this number, 62 points are the body's own statements and 4 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloudSync.drainMutations (cognitive 64) · ×1
  • CloudSync.drainMutations (cognitive 64) src/services/sync/CloudSync.ts:1228 — CloudSync.drainMutations has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (43 pts), boolean chains 7, error handling 2 (7 pts), ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 38). Of this number, 61 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HookSpool.drain (cognitive 64) · ×1
  • HookSpool.drain (cognitive 64) src/shared/hook-spool.ts:383 — HookSpool.drain has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (46 pts), ternaries 3 (9 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 33). Of this number, 57 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shared.ingestObservation (cognitive 64) · ×1
  • shared.ingestObservation (cognitive 64) REDACTED:149 — shared.ingestObservation has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 16 (25 pts), if/else 17 (21 pts), boolean chains 13, error handling 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-md-utils.updateFolderClaudeMdFiles (cognitive 63) · ×1
  • claude-md-utils.updateFolderClaudeMdFiles (cognitive 63) src/utils/claude-md-utils.ts:236 — claude-md-utils.updateFolderClaudeMdFiles has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (38 pts), boolean chains 12, ternaries 2 (6 pts), error handling 3 (4 pts), loops 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker-spawner.ensureWorkerStarted (cognitive 62) · ×1
  • worker-spawner.ensureWorkerStarted (cognitive 62) src/services/worker-spawner.ts:179 — worker-spawner.ensureWorkerStarted has cognitive complexity 62 (threshold 15). Drivers by points: if/else 28 (43 pts), ternaries 7 (16 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · field-utils.matchesRule (cognitive 62) · ×1
  • field-utils.matchesRule (cognitive 62) REDACTED:116 — field-utils.matchesRule has cognitive complexity 62 (threshold 15). Drivers by points: if/else 28 (44 pts), boolean chains 10, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionRoutes.ensureGeneratorRunningLocked (cognitive 61) · ×1
  • SessionRoutes.ensureGeneratorRunningLocked (cognitive 61) REDACTED:245 — SessionRoutes.ensureGeneratorRunningLocked has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (37 pts), ternaries 2 (10 pts), error handling 2 (8 pts), boolean chains 6 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · App.App (cognitive 61) · ×1
  • App.App (cognitive 61) src/ui/viewer/App.tsx:54 — App.App has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (33 pts), ternaries 11 (16 pts), boolean chains 11, error handling 1 (nesting depth added 9). Of this number, 16 points are the body's own statements and 45 belong to 15 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChromaSync.backfillKind (cognitive 60) · ×1
  • ChromaSync.backfillKind (cognitive 60) src/services/sync/ChromaSync.ts:1440 — ChromaSync.backfillKind has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (37 pts), error handling 4 (10 pts), ternaries 3 (9 pts), loops 3 (4 pts) (nesting depth added 36). Of this number, 59 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.promptProvider (cognitive 60) · ×1
  • install.promptProvider (cognitive 60) REDACTED:1175 — install.promptProvider has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (42 pts), ternaries 7 (9 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 18). Of this number, 56 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenRouterProvider.classifyOpenRouterError (cognitive 60) · ×1
  • OpenRouterProvider.classifyOpenRouterError (cognitive 60) src/services/worker/OpenRouterProvider.ts:166 — OpenRouterProvider.classifyOpenRouterError has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 16 (29 pts), boolean chains 20, if/else 11 (nesting depth added 13). Of this number, 58 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · retry.withRetry (cognitive 59) · ×1
  • retry.withRetry (cognitive 59) src/services/worker/retry.ts:241 — retry.withRetry has cognitive complexity 59 (threshold 15). Drivers by points: if/else 10 (28 pts), ternaries 7 (21 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (nesting depth added 33). Of this number, 56 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · advisor-transcript.extractAdvisorCallsFromJsonl (cognitive 58) · ×1
  • advisor-transcript.extractAdvisorCallsFromJsonl (cognitive 58) src/shared/advisor-transcript.ts:135 — advisor-transcript.extractAdvisorCallsFromJsonl has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 13, ternaries 2 (8 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 29). Of this number, 57 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorktreeAdoption.adoptMergedWorktrees (cognitive 57) · ×1
  • WorktreeAdoption.adoptMergedWorktrees (cognitive 57) src/services/infrastructure/WorktreeAdoption.ts:492 — WorktreeAdoption.adoptMergedWorktrees has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (31 pts), ternaries 5 (8 pts), loops 5 (7 pts), boolean chains 6, error handling 3 (5 pts) (nesting depth added 18). Of this number, 39 points are the body's own statements and 18 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenRouterProvider.queryOpenRouterMultiTurn (cognitive 57) · ×1
  • OpenRouterProvider.queryOpenRouterMultiTurn (cognitive 57) src/services/worker/OpenRouterProvider.ts:954 — OpenRouterProvider.queryOpenRouterMultiTurn has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 16 (28 pts), if/else 12 (17 pts), boolean chains 9, error handling 1 (3 pts) (nesting depth added 19). Of this number, 53 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · read (cognitive 56) · ×1
  • read (cognitive 56) src/services/work-view/data-source.mjs:199 — read has cognitive complexity 56 (threshold 15). Drivers by points: loops 6 (19 pts), if/else 6 (17 pts), ternaries 4 (9 pts), boolean chains 5, error handling 2 (3 pts), other 3 (nesting depth added 30). Of this number, 41 points are the body's own statements and 15 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eval-read-gate.analyzeReadGateTrace (cognitive 55) · ×1
  • eval-read-gate.analyzeReadGateTrace (cognitive 55) REDACTED:245 — eval-read-gate.analyzeReadGateTrace has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 7, loops 3 (4 pts), ternaries 1 (4 pts), error handling 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uninstall.removeStrayClaudeMemPaths (cognitive 55) · ×1
  • uninstall.removeStrayClaudeMemPaths (cognitive 55) src/npx-cli/commands/uninstall.ts:169 — uninstall.removeStrayClaudeMemPaths has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 6 (22 pts), error handling 6 (16 pts), if/else 5 (10 pts), loops 3 (7 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.startSyncApi (cognitive 54) · ×1
  • index.startSyncApi (cognitive 54) REDACTED:381 — index.startSyncApi has cognitive complexity 54 (threshold 15). Drivers by points: if/else 29 (45 pts), error handling 2 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextSettingsModal.ContextSettingsModal (cognitive 54) · ×1
  • ContextSettingsModal.ContextSettingsModal (cognitive 54) src/ui/viewer/components/ContextSettingsModal.tsx:144 — ContextSettingsModal.ContextSettingsModal has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 44, ternaries 6 (7 pts), if/else 3 (nesting depth added 1). Of this number, 47 points are the body's own statements and 7 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · streamed-chat-completion.assembleStream (cognitive 52) · ×1
  • streamed-chat-completion.assembleStream (cognitive 52) src/services/worker/streamed-chat-completion.ts:360 — streamed-chat-completion.assembleStream has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 7 (11 pts), boolean chains 8, error handling 2 (3 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker-spawn-gate.acquireSpawnLock (cognitive 51) · ×1
  • worker-spawn-gate.acquireSpawnLock (cognitive 51) src/shared/worker-spawn-gate.ts:100 — worker-spawn-gate.acquireSpawnLock has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (27 pts), error handling 6 (19 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory-search.bashSearchPattern (cognitive 51) · ×1
  • memory-search.bashSearchPattern (cognitive 51) src/cli/handlers/memory-search.ts:54 — memory-search.bashSearchPattern has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (29 pts), ternaries 6 (12 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchManager.renderTimeline (cognitive 51) · ×1
  • SearchManager.renderTimeline (cognitive 51) src/services/worker/SearchManager.ts:189 — SearchManager.renderTimeline has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (26 pts), ternaries 4 (16 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · to-work-model.toRequest (cognitive 51) · ×1
  • to-work-model.toRequest (cognitive 51) src/ui/my-work/src/live/to-work-model.ts:137 — to-work-model.toRequest has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 28 (30 pts), boolean chains 21 (nesting depth added 2). Of this number, 40 points are the body's own statements and 11 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · index.connectToSSEStream (cognitive 49) · ×1
  • index.connectToSSEStream (cognitive 49) REDACTED:536 — index.connectToSSEStream has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 2 (8 pts), error handling 2 (6 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · projection.drainProjection (cognitive 48) · ×1
  • projection.drainProjection (cognitive 48) services/sync-api/src/projection.ts:103 — projection.drainProjection has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 8, error handling 5 (8 pts), ternaries 3 (5 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.claudeMemPi (cognitive 48) · ×1
  • index.claudeMemPi (cognitive 48) src/integrations/pi-extension/index.ts:81 — index.claudeMemPi has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26, boolean chains 16, error handling 4, ternaries 2. None of this is in the body itself: all 48 points belong to 15 function items inside it that branch (a function literal at line 170, a function literal at line 153, a function literal at line 135, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · T3CodeInstaller.discoverT3CodeProviders (cognitive 48) · ×1
  • T3CodeInstaller.discoverT3CodeProviders (cognitive 48) REDACTED:80 — T3CodeInstaller.discoverT3CodeProviders has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 14, loops 3 (4 pts), error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). Of this number, 47 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.drainProjection (cognitive 48) · ×1
  • index.drainProjection (cognitive 48) workers/sync-hub/src/index.ts:758 — index.drainProjection has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 8, error handling 5 (8 pts), ternaries 3 (5 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bun-runner.findBun (cognitive 47) · ×1
  • bun-runner.findBun (cognitive 47) plugin/scripts/bun-runner.js:23 — bun-runner.findBun has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 12 (21 pts), if/else 9 (19 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 20). Of this number, 46 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiProvider.queryGeminiMultiTurn (cognitive 47) · ×1
  • GeminiProvider.queryGeminiMultiTurn (cognitive 47) src/services/worker/GeminiProvider.ts:453 — GeminiProvider.queryGeminiMultiTurn has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 12 (23 pts), if/else 10 (17 pts), error handling 3 (5 pts), boolean chains 2 (nesting depth added 20). Of this number, 36 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · zstd-frames.scanZstdFramesInFile (cognitive 47) · ×1
  • zstd-frames.scanZstdFramesInFile (cognitive 47) src/services/transcripts/zstd-frames.ts:62 — zstd-frames.scanZstdFramesInFile has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (31 pts), ternaries 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 24). Of this number, 42 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · export_owner_prompts.read_agent_authored_text (cognitive 47) · ×1
  • export_owner_prompts.read_agent_authored_text (cognitive 47) plugin/skills/owner-goals/scripts/export_owner_prompts.py:156 — export_owner_prompts.read_agent_authored_text has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 5 (9 pts), boolean chains 7, error handling 2 (6 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TranscriptWatcher.startTailer (cognitive 46) · ×1
  • TranscriptWatcher.startTailer (cognitive 46) src/services/transcripts/watcher.ts:932 — TranscriptWatcher.startTailer has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (29 pts), boolean chains 9, ternaries 2 (5 pts), error handling 2 (3 pts) (nesting depth added 9). Of this number, 33 points are the body's own statements and 13 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · export_owner_prompts.read_owner_typed_prompts (cognitive 46) · ×1
  • export_owner_prompts.read_owner_typed_prompts (cognitive 46) plugin/skills/owner-goals/scripts/export_owner_prompts.py:98 — export_owner_prompts.read_owner_typed_prompts has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 9, error handling 3 (8 pts), loops 4 (6 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kill-process-tree.killProcessTree (cognitive 45) · ×1
  • kill-process-tree.killProcessTree (cognitive 45) src/shared/kill-process-tree.ts:141 — kill-process-tree.killProcessTree has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 6 (11 pts), ternaries 6 (11 pts), loops 4, boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessRegistry.reapSession (cognitive 45) · ×1
  • ProcessRegistry.reapSession (cognitive 45) src/supervisor/process-registry.ts:349 — ProcessRegistry.reapSession has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 5 (6 pts), error handling 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncApply.applyOps (cognitive 45) · ×1
  • SyncApply.applyOps (cognitive 45) src/services/sync/SyncApply.ts:492 — SyncApply.applyOps has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 5 (12 pts), boolean chains 5, loops 4, error handling 1 (2 pts) (nesting depth added 17). Most of this is not in the body itself: 10 of the 45 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 521, 555, 619). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · save-error.describeSaveFailure (cognitive 45) · ×1
  • save-error.describeSaveFailure (cognitive 45) REDACTED:94 — save-error.describeSaveFailure has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 4 (10 pts), boolean chains 8, error handling 2 (nesting depth added 13). Of this number, 35 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaMcpManager.callToolUnqueued (cognitive 44) · ×1
  • ChromaMcpManager.callToolUnqueued (cognitive 44) REDACTED:1419 — ChromaMcpManager.callToolUnqueued has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 6 (13 pts), boolean chains 6, error handling 3 (4 pts) (nesting depth added 15). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uninstall.runUninstallCommand (cognitive 44) · ×1
  • uninstall.runUninstallCommand (cognitive 44) src/npx-cli/commands/uninstall.ts:254 — uninstall.runUninstallCommand has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 8 (12 pts), error handling 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 12). Of this number, 36 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run (cognitive 44) · ×1
  • run (cognitive 44) REDACTED:78 — run has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 14, ternaries 8 (9 pts), loops 2, other 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp-text-format.formatMcpPayload (cognitive 43) · ×1
  • mcp-text-format.formatMcpPayload (cognitive 43) src/servers/mcp-text-format.ts:107 — mcp-text-format.formatMcpPayload has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 10 (22 pts), if/else 5 (12 pts), boolean chains 6, loops 1 (2 pts), match/switch 1 (nesting depth added 20). Of this number, 21 points are the body's own statements and 22 belong to 4 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · install.makeIDETask (cognitive 43) · ×1
  • install.makeIDETask (cognitive 43) REDACTED:291 — install.makeIDETask has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (40 pts), boolean chains 1, match/switch 1, ternaries 1 (nesting depth added 20). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 15 function items inside it that branch (a function literal at line 376, recordFailure, a function literal at line 316, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WorkerService.initializeBackground (cognitive 43) · ×1
  • WorkerService.initializeBackground (cognitive 43) REDACTED:718 — WorkerService.initializeBackground has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 7 (13 pts), error handling 4, boolean chains 3, loops 1 (2 pts) (nesting depth added 13). Of this number, 21 points are the body's own statements and 22 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · port-reclaim.reclaimGhostListeningPort (cognitive 42) · ×1
  • port-reclaim.reclaimGhostListeningPort (cognitive 42) REDACTED:725 — port-reclaim.reclaimGhostListeningPort has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 5 (6 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 14). Of this number, 35 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · smoke-clean-room.checkPackageCompleteness (cognitive 42) · ×1
  • smoke-clean-room.checkPackageCompleteness (cognitive 42) scripts/smoke-clean-room.cjs:185 — smoke-clean-room.checkPackageCompleteness has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 11, loops 3, error handling 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeneratorRunner.startGeneratorWithProvider (cognitive 42) · ×1
  • GeneratorRunner.startGeneratorWithProvider (cognitive 42) src/services/worker/session/GeneratorRunner.ts:135 — GeneratorRunner.startGeneratorWithProvider has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 8 (20 pts), boolean chains 17, if/else 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · productsFromFields (cognitive 42) · ×1
  • productsFromFields (cognitive 42) src/services/work-view/work-product.mjs:259 — productsFromFields has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 7 (17 pts), other 9, boolean chains 7, if/else 3 (6 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sse-reader.readSseEvents (cognitive 41) · ×1
  • sse-reader.readSseEvents (cognitive 41) src/shared/sse-reader.ts:86 — sse-reader.readSseEvents has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 4 (7 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 17). Of this number, 25 points are the body's own statements and 16 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaSync.addDocuments (cognitive 41) · ×1
  • ChromaSync.addDocuments (cognitive 41) src/services/sync/ChromaSync.ts:727 — ChromaSync.addDocuments has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (26 pts), error handling 3 (7 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 23). Of this number, 38 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api-key-pool.hydrate (cognitive 41) · ×1
  • api-key-pool.hydrate (cognitive 41) src/shared/api-key-pool.ts:260 — api-key-pool.hydrate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (7 pts), ternaries 2 (7 pts), boolean chains 3, error handling 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backfill.collectDailyRollups (cognitive 41) · ×1
  • backfill.collectDailyRollups (cognitive 41) src/services/telemetry/backfill.ts:189 — backfill.collectDailyRollups has cognitive complexity 41 (threshold 15). Drivers by points: loops 13 (14 pts), error handling 11, if/else 5 (7 pts), ternaries 4 (7 pts), boolean chains 2 (nesting depth added 6). Of this number, 20 points are the body's own statements and 21 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.install (cognitive 40) · ×1
  • install.install (cognitive 40) ods/install.mjs:113 — install.install has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (7 pts), boolean chains 3, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 16). Of this number, 39 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.translateToLanguage (cognitive 40) · ×1
  • index.translateToLanguage (cognitive 40) scripts/translate-readme/index.ts:107 — index.translateToLanguage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 5, loops 2 (4 pts), ternaries 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · owned-file-install.replaceOwnedFiles (cognitive 40) · ×1
  • owned-file-install.replaceOwnedFiles (cognitive 40) src/shared/owned-file-install.ts:21 — owned-file-install.replaceOwnedFiles has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (22 pts), error handling 4 (9 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.unfoldSymbol (cognitive 40) · ×1
  • parser.unfoldSymbol (cognitive 40) REDACTED:1346 — parser.unfoldSymbol has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (9 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 19). Of this number, 32 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoryFileWatcher.scan (cognitive 40) · ×1
  • MemoryFileWatcher.scan (cognitive 40) src/services/memory/file-watcher.ts:48 — MemoryFileWatcher.scan has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 2 (7 pts), error handling 2 (5 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaMcpManager.prewarmChromaMcp (cognitive 39) · ×1
  • ChromaMcpManager.prewarmChromaMcp (cognitive 39) REDACTED:1222 — ChromaMcpManager.prewarmChromaMcp has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 7 (15 pts), error handling 3 (7 pts) (nesting depth added 16). Of this number, 35 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.waitForInstallerPairing (cognitive 39) · ×1
  • install.waitForInstallerPairing (cognitive 39) REDACTED:1903 — install.waitForInstallerPairing has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 6 (7 pts), boolean chains 2, loops 1 (nesting depth added 14). Of this number, 38 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.validateNonInteractiveProvider (cognitive 39) · ×1
  • install.validateNonInteractiveProvider (cognitive 39) REDACTED:2473 — install.validateNonInteractiveProvider has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 5 (19 pts), if/else 8 (14 pts), boolean chains 6 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProviderObservationGenerator.process (cognitive 39) · ×1
  • ProviderObservationGenerator.process (cognitive 39) src/server/generation/ProviderObservationGenerator.ts:168 — ProviderObservationGenerator.process has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 9 (14 pts), boolean chains 3, error handling 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResponseProcessor.extractPathsFromToolInput (cognitive 39) · ×1
  • ResponseProcessor.extractPathsFromToolInput (cognitive 39) src/services/worker/agents/ResponseProcessor.ts:122 — ResponseProcessor.extractPathsFromToolInput has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 4 (11 pts), boolean chains 2, ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · create-server-service.instantiateServerGenerationProvider (cognitive 39) · ×1
  • create-server-service.instantiateServerGenerationProvider (cognitive 39) src/server/runtime/create-server-service.ts:412 — create-server-service.instantiateServerGenerationProvider has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenRouterProvider.resolveOpenRouterConfig (cognitive 39) · ×1
  • OpenRouterProvider.resolveOpenRouterConfig (cognitive 39) src/services/worker/OpenRouterProvider.ts:694 — OpenRouterProvider.resolveOpenRouterConfig has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 14, if/else 6 (7 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · build-hooks.buildHooks (cognitive 38) · ×1
  • build-hooks.buildHooks (cognitive 38) scripts/build-hooks.js:442 — build-hooks.buildHooks has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26 (32 pts), loops 5, error handling 1 (nesting depth added 6). Of this number, 36 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OpenAICompatProvider.queryChatCompletions (cognitive 38) · ×1
  • OpenAICompatProvider.queryChatCompletions (cognitive 38) src/services/worker/OpenAICompatProvider.ts:622 — OpenAICompatProvider.queryChatCompletions has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (17 pts), if/else 10 (15 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 12). Of this number, 36 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readCandidates (cognitive 38) · ×1
  • readCandidates (cognitive 38) src/services/work-view/request-groups.mjs:50 — readCandidates has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (11 pts), other 10, ternaries 6 (9 pts), boolean chains 3, loops 3, error handling 1 (2 pts) (nesting depth added 9). Of this number, 34 points are the body's own statements and 4 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · doctor.runDoctorCommand (cognitive 37) · ×1
  • doctor.runDoctorCommand (cognitive 37) REDACTED:430 — doctor.runDoctorCommand has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 13 (21 pts), if/else 6 (7 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 10). Of this number, 33 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CursorHooksInstaller.checkCursorHooksStatus (cognitive 37) · ×1
  • CursorHooksInstaller.checkCursorHooksStatus (cognitive 37) src/services/integrations/CursorHooksInstaller.ts:475 — CursorHooksInstaller.checkCursorHooksStatus has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 2 (6 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CanonicalContent.validatePayload (cognitive 36) · ×1
  • CanonicalContent.validatePayload (cognitive 36) src/services/sync/CanonicalContent.ts:340 — CanonicalContent.validatePayload has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-md-utils.formatTimelineForClaudeMd (cognitive 36) · ×1
  • claude-md-utils.formatTimelineForClaudeMd (cognitive 36) src/utils/claude-md-utils.ts:117 — claude-md-utils.formatTimelineForClaudeMd has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 2 (6 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · v2.setupV2 (cognitive 36) · ×1
  • v2.setupV2 (cognitive 36) src/integrations/opencode-plugin/v2.ts:228 — v2.setupV2 has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1, match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (onBusEvent, trackSession, a function literal at line 283, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · prompts.stripImagePayloads (cognitive 36) · ×1
  • prompts.stripImagePayloads (cognitive 36) src/sdk/prompts.ts:248 — prompts.stripImagePayloads has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (nesting depth added 10). Of this number, 34 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerService.runServerServiceCli (cognitive 36) · ×1
  • ServerService.runServerServiceCli (cognitive 36) REDACTED:300 — ServerService.runServerServiceCli has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 5, ternaries 1 (4 pts), error handling 1 (3 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validateProgress (cognitive 36) · ×1
  • validateProgress (cognitive 36) src/services/work-view/request-groups.mjs:297 — validateProgress has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (14 pts), other 12, boolean chains 9, loops 1 (nesting depth added 1). Of this number, 28 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChromaSync.sweepAllProjects (cognitive 35) · ×1
  • ChromaSync.sweepAllProjects (cognitive 35) src/services/sync/ChromaSync.ts:2068 — ChromaSync.sweepAllProjects has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (5 pts), ternaries 1 (4 pts), error handling 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · T3CodeInstaller.installT3Code (cognitive 35) · ×1
  • T3CodeInstaller.installT3Code (cognitive 35) REDACTED:229 — T3CodeInstaller.installT3Code has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 4 (9 pts), boolean chains 3, error handling 2 (3 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · save_goals.main (cognitive 35) · ×1
  • save_goals.main (cognitive 35) plugin/skills/owner-goals/scripts/save_goals.py:163 — save_goals.main has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (12 pts), ternaries 7 (8 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · buildRules (cognitive 35) · ×1
  • buildRules (cognitive 35) src/services/work-view/my-rules.mjs:67 — buildRules has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 10, other 7, if/else 1 (2 pts), loops 2 (nesting depth added 7). Of this number, 30 points are the body's own statements and 5 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mode-validation.validateMode (cognitive 34) · ×1
  • mode-validation.validateMode (cognitive 34) src/services/domain/mode-validation.ts:49 — mode-validation.validateMode has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (8 pts), boolean chains 6, ternaries 1 (nesting depth added 14). Of this number, 31 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory-search.memorySearchLookup (cognitive 34) · ×1
  • memory-search.memorySearchLookup (cognitive 34) src/cli/handlers/memory-search.ts:100 — memory-search.memorySearchLookup has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 11, ternaries 6 (9 pts), error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · output-classifier.describeObserverOutputShape (cognitive 34) · ×1
  • output-classifier.describeObserverOutputShape (cognitive 34) src/sdk/output-classifier.ts:49 — output-classifier.describeObserverOutputShape has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 2 (7 pts), ternaries 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiProvider.classifyGeminiError (cognitive 34) · ×1
  • GeminiProvider.classifyGeminiError (cognitive 34) src/services/worker/GeminiProvider.ts:46 — GeminiProvider.classifyGeminiError has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 10 (13 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchManager.hybridSemanticHydrate (cognitive 34) · ×1
  • SearchManager.hybridSemanticHydrate (cognitive 34) src/services/worker/SearchManager.ts:116 — SearchManager.hybridSemanticHydrate has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 4 (9 pts), loops 4 (9 pts), boolean chains 6 (nesting depth added 14). Of this number, 29 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mergeProducts (cognitive 34) · ×1
  • mergeProducts (cognitive 34) src/services/work-view/work-product.mjs:288 — mergeProducts has cognitive complexity 34 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 5 (8 pts), loops 4 (6 pts), other 6, boolean chains 5 (nesting depth added 10). Of this number, 27 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker-utils.executeWithWorkerFallback (cognitive 33) · ×1
  • worker-utils.executeWithWorkerFallback (cognitive 33) REDACTED:2265 — worker-utils.executeWithWorkerFallback has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 4 (7 pts), error handling 4 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerV1Routes.setupRoutes (cognitive 33) · ×1
  • ServerV1Routes.setupRoutes (cognitive 33) REDACTED:62 — ServerV1Routes.setupRoutes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26 (27 pts), ternaries 3, boolean chains 2, loops 1 (nesting depth added 1). None of this is in the body itself: all 33 points belong to 18 function literals inside it that branch (lines 215, 158, 106, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ClaudeProvider.classifyClaudeError (cognitive 33) · ×1
  • ClaudeProvider.classifyClaudeError (cognitive 33) src/services/worker/ClaudeProvider.ts:138 — ClaudeProvider.classifyClaudeError has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 13, error handling 1 (3 pts), ternaries 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · deriveSessionProjects (cognitive 33) · ×1
  • deriveSessionProjects (cognitive 33) src/services/work-view/session-project.mjs:139 — deriveSessionProjects has cognitive complexity 33 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 5 (9 pts), boolean chains 5, ternaries 3 (5 pts), other 4 (nesting depth added 9). Of this number, 27 points are the body's own statements and 6 belong to 10 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloudSync.flush (cognitive 32) · ×1
  • CloudSync.flush (cognitive 32) src/services/sync/CloudSync.ts:754 — CloudSync.flush has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bun-runtime.findBun (cognitive 32) · ×1
  • bun-runtime.findBun (cognitive 32) src/launcher/bun-runtime.ts:98 — bun-runtime.findBun has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 2 (6 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionManager.initializeSession (cognitive 32) · ×1
  • SessionManager.initializeSession (cognitive 32) src/services/worker/SessionManager.ts:252 — SessionManager.initializeSession has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 11, ternaries 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useContextPreview.useContextPreview (cognitive 32) · ×1
  • useContextPreview.useContextPreview (cognitive 32) src/ui/viewer/hooks/useContextPreview.ts:28 — useContextPreview.useContextPreview has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (10 pts), ternaries 6 (9 pts), error handling 2 (nesting depth added 4). None of this is in the body itself: all 32 points belong to 6 function literals inside it that branch (lines 38, 92, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SyncHub.pushOps (cognitive 32) · ×1
  • SyncHub.pushOps (cognitive 32) workers/sync-hub/src/do/SyncHub.ts:368 — SyncHub.pushOps has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2, loops 1 (nesting depth added 14). Most of this is not in the body itself: 15 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 398, 373). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChromaSync.queryChroma (cognitive 31) · ×1
  • ChromaSync.queryChroma (cognitive 31) src/services/sync/ChromaSync.ts:1874 — ChromaSync.queryChroma has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 9, ternaries 3 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 9). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transcript-parser.findLastMessageInJsonl (cognitive 31) · ×1
  • transcript-parser.findLastMessageInJsonl (cognitive 31) src/shared/transcript-parser.ts:383 — transcript-parser.findLastMessageInJsonl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · search.searchCodebase · ×1
  • search.searchCodebase::checkSymbols (cognitive 31) src/services/smart-file-read/search.ts:185 — search.searchCodebase::checkSymbols has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 5 (11 pts), boolean chains 7, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider.classifyOpenAICompatError (cognitive 31) · ×1
  • OpenAICompatProvider.classifyOpenAICompatError (cognitive 31) src/services/worker/OpenAICompatProvider.ts:250 — OpenAICompatProvider.classifyOpenAICompatError has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 10, if/else 9 (nesting depth added 4). Of this number, 29 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SearchOrchestrator.supplementEmptyCategories (cognitive 31) · ×1
  • SearchOrchestrator.supplementEmptyCategories (cognitive 31) src/services/worker/search/SearchOrchestrator.ts:163 — SearchOrchestrator.supplementEmptyCategories has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 3 (8 pts), boolean chains 6, loops 1 (nesting depth added 14). Of this number, 18 points are the body's own statements and 13 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · my-work.MyWork (cognitive 31) · ×1
  • my-work.MyWork (cognitive 31) src/ui/my-work/src/pages/my-work.tsx:333 — my-work.MyWork has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 6 (16 pts), boolean chains 15 (nesting depth added 10). Of this number, 27 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · install.verifyReceipt (cognitive 30) · ×1
  • install.verifyReceipt (cognitive 30) ods/install.mjs:85 — install.verifyReceipt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, ternaries 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · regenerate-claude-md.cleanupAutoGeneratedFiles (cognitive 30) · ×1
  • regenerate-claude-md.cleanupAutoGeneratedFiles (cognitive 30) scripts/regenerate-claude-md.ts:264 — regenerate-claude-md.cleanupAutoGeneratedFiles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), error handling 3 (6 pts), loops 2 (nesting depth added 13). Of this number, 16 points are the body's own statements and 14 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-md-commands.extractRelevantFile (cognitive 30) · ×1
  • claude-md-commands.extractRelevantFile (cognitive 30) src/cli/claude-md-commands.ts:234 — claude-md-commands.extractRelevantFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts), ternaries 2 (6 pts), error handling 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.setupCoreRoutes (cognitive 30) · ×1
  • Server.setupCoreRoutes (cognitive 30) REDACTED:440 — Server.setupCoreRoutes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 11, boolean chains 7 (nesting depth added 1). None of this is in the body itself: all 30 points belong to 8 function literals inside it that branch (lines 488, 441, 532, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CleanupV12_4_3.executeCleanup (cognitive 30) · ×1
  • CleanupV12_4_3.executeCleanup (cognitive 30) src/services/infrastructure/CleanupV12_4_3.ts:120 — CleanupV12_4_3.executeCleanup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (12 pts), error handling 4 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HumanCopyWorker.observe (cognitive 30) · ×1
  • HumanCopyWorker.observe (cognitive 30) src/services/work-view/human-copy-worker.mjs:74 — HumanCopyWorker.observe has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, ternaries 4 (7 pts), error handling 3 (5 pts) (nesting depth added 7). Most of this is not in the body itself: 2 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 77). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · WorkViewRoutes.saveRule (cognitive 30) · ×1
  • WorkViewRoutes.saveRule (cognitive 30) REDACTED:312 — WorkViewRoutes.saveRule has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 5 (8 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cmem-hook.flushSpool (cognitive 29) · ×1
  • cmem-hook.flushSpool (cognitive 29) cowork/scripts/cmem-hook.mjs:216 — cmem-hook.flushSpool has cognitive complexity 29 (threshold 15). Drivers by points: error handling 11 (18 pts), if/else 5 (8 pts), boolean chains 2, loops 1 (nesting depth added 10). Of this number, 26 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncClient.pullCycle (cognitive 29) · ×1
  • SyncClient.pullCycle (cognitive 29) src/services/sync/SyncClient.ts:637 — SyncClient.pullCycle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 1, error handling 1, loops 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HubStore.pushOps (cognitive 29) · ×1
  • HubStore.pushOps (cognitive 29) services/sync-api/src/store.ts:357 — HubStore.pushOps has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, error handling 2, loops 1 (nesting depth added 12). Of this number, 15 points are the body's own statements and 14 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · progressive-search.projectMemoryContent (cognitive 29) · ×1
  • progressive-search.projectMemoryContent (cognitive 29) src/shared/progressive-search.ts:239 — progressive-search.projectMemoryContent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 2 (5 pts), loops 3, boolean chains 2 (nesting depth added 10). Of this number, 27 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.main (cognitive 29) · ×1
  • index.main (cognitive 29) src/npx-cli/index.ts:144 — index.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 3 (9 pts), boolean chains 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerJobQueue.start (cognitive 29) · ×1
  • ServerJobQueue.start (cognitive 29) src/server/jobs/ServerJobQueue.ts:249 — ServerJobQueue.start has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (8 pts), ternaries 4 (8 pts), loops 2 (4 pts) (nesting depth added 14). Most of this is not in the body itself: 9 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 272, 287, 269). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · find-claude-executable.findClaudeExecutable (cognitive 29) · ×1
  • find-claude-executable.findClaudeExecutable (cognitive 29) src/shared/find-claude-executable.ts:414 — find-claude-executable.findClaudeExecutable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 3, loops 1 (nesting depth added 10). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TranscriptEventProcessor.handleEvent (cognitive 29) · ×1
  • TranscriptEventProcessor.handleEvent (cognitive 29) src/services/transcripts/processor.ts:268 — TranscriptEventProcessor.handleEvent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SessionSearch.searchSessions (cognitive 28) · ×1
  • SessionSearch.searchSessions (cognitive 28) src/services/sqlite/SessionSearch.ts:812 — SessionSearch.searchSessions has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 6 (9 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker-utils.acquireHookFailureLock (cognitive 28) · ×1
  • worker-utils.acquireHookFailureLock (cognitive 28) REDACTED:1883 — worker-utils.acquireHookFailureLock has cognitive complexity 28 (threshold 15). Drivers by points: error handling 4 (14 pts), if/else 3 (10 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HermesInstaller.uninstallHermesIntegration (cognitive 28) · ×1
  • HermesInstaller.uninstallHermesIntegration (cognitive 28) src/services/integrations/HermesInstaller.ts:176 — HermesInstaller.uninstallHermesIntegration has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · processGeneratedResponse.persistGeneratedObservations (cognitive 28) · ×1
  • processGeneratedResponse.persistGeneratedObservations (cognitive 28) src/server/generation/processGeneratedResponse.ts:293 — processGeneratedResponse.persistGeneratedObservations has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (9 pts), error handling 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 12). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 316). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ServerService.runServerApiKeyCli (cognitive 28) · ×1
  • ServerService.runServerApiKeyCli (cognitive 28) REDACTED:514 — ServerService.runServerApiKeyCli has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 5 (10 pts), boolean chains 3, error handling 1 (nesting depth added 10). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · streamed-chat-completion.sendChatCompletion (cognitive 28) · ×1
  • streamed-chat-completion.sendChatCompletion (cognitive 28) src/services/worker/streamed-chat-completion.ts:288 — streamed-chat-completion.sendChatCompletion has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent-view.buildAgentView.getGroup (cognitive 28) · ×1
  • agent-view.buildAgentView.getGroup (cognitive 28) src/services/work-view/agent-view.mjs:238 — agent-view.buildAgentView.getGroup has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (24 pts), boolean chains 2, if/else 2 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TranscriptEventProcessor.handleToolResult (cognitive 28) · ×1
  • TranscriptEventProcessor.handleToolResult (cognitive 28) src/services/transcripts/processor.ts:507 — TranscriptEventProcessor.handleToolResult has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 5 (6 pts), boolean chains 4 (nesting depth added 9). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileTailer.readNewZstdFrames (cognitive 28) · ×1
  • FileTailer.readNewZstdFrames (cognitive 28) src/services/transcripts/watcher.ts:455 — FileTailer.readNewZstdFrames has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (6 pts), loops 3 (5 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ragtime.processFile (cognitive 27) · ×1
  • ragtime.processFile (cognitive 27) ragtime/ragtime.ts:151 — ragtime.processFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 1 (6 pts), loops 2 (5 pts), boolean chains 2, error handling 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Logger.log (cognitive 27) · ×1
  • Logger.log (cognitive 27) src/utils/logger.ts:351 — Logger.log has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 2 (6 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 9). Of this number, 20 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tag-stripping.stripBalancedMemoryTags (cognitive 27) · ×1
  • tag-stripping.stripBalancedMemoryTags (cognitive 27) src/utils/tag-stripping.ts:42 — tag-stripping.stripBalancedMemoryTags has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 3, ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CanonicalContent.validateMutation (cognitive 27) · ×1
  • CanonicalContent.validateMutation (cognitive 27) src/services/sync/CanonicalContent.ts:407 — CanonicalContent.validateMutation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grok-bot-session-inject.refreshAgent (cognitive 27) · ×1
  • grok-bot-session-inject.refreshAgent (cognitive 27) scripts/grok-bot-session-inject.mjs:739 — grok-bot-session-inject.refreshAgent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, ternaries 3, error handling 1 (2 pts) (nesting depth added 6). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · grok-bot-session-inject.runWatch (cognitive 27) · ×1
  • grok-bot-session-inject.runWatch (cognitive 27) scripts/grok-bot-session-inject.mjs:893 — grok-bot-session-inject.runWatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (6 pts), error handling 2 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 3 function items inside it that branch (ensureActivityWatches, kick, pollActivity). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · port-reclaim.reclaimWedgedOwnedWorker (cognitive 27) · ×1
  • port-reclaim.reclaimWedgedOwnedWorker (cognitive 27) REDACTED:561 — port-reclaim.reclaimWedgedOwnedWorker has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker-utils.readWorkerReadyStream (cognitive 27) · ×1
  • worker-utils.readWorkerReadyStream (cognitive 27) REDACTED:787 — worker-utils.readWorkerReadyStream has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 4 (8 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 11). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · observer-health.renderObserverHealthWarning (cognitive 27) · ×1
  • observer-health.renderObserverHealthWarning (cognitive 27) src/shared/observer-health.ts:650 — observer-health.renderObserverHealthWarning has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 6, boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaMcpManager.connectInternal (cognitive 27) · ×1
  • ChromaMcpManager.connectInternal (cognitive 27) REDACTED:372 — ChromaMcpManager.connectInternal has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (9 pts), boolean chains 3, error handling 3 (nesting depth added 9). Of this number, 26 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install-launcher.ensureLauncherOnPath (cognitive 27) · ×1
  • install-launcher.ensureLauncherOnPath (cognitive 27) src/launcher/install-launcher.ts:658 — install-launcher.ensureLauncherOnPath has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 5). Of this number, 24 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · T3CodeInstaller.pluginAssetsPresent (cognitive 27) · ×1
  • T3CodeInstaller.pluginAssetsPresent (cognitive 27) REDACTED:199 — T3CodeInstaller.pluginAssetsPresent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 5, ternaries 1 (nesting depth added 9). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · field-optimizer.compactEditOutput (cognitive 27) · ×1
  • field-optimizer.compactEditOutput (cognitive 27) src/services/worker/field-optimizer.ts:219 — field-optimizer.compactEditOutput has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (6 pts), ternaries 4 (5 pts), error handling 1, loops 1 (nesting depth added 3). Of this number, 25 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · find-claude-executable.discoverCandidates (cognitive 27) · ×1
  • find-claude-executable.discoverCandidates (cognitive 27) src/shared/find-claude-executable.ts:278 — find-claude-executable.discoverCandidates has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 3 (7 pts), loops 4 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CanonicalContent.validateBody (cognitive 26) · ×1
  • CanonicalContent.validateBody (cognitive 26) src/services/sync/CanonicalContent.ts:293 — CanonicalContent.validateBody has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · regenerate-claude-md.extractRelevantFile (cognitive 26) · ×1
  • regenerate-claude-md.extractRelevantFile (cognitive 26) scripts/regenerate-claude-md.ts:164 — regenerate-claude-md.extractRelevantFile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · observer-health.withLedgerLock (cognitive 26) · ×1
  • observer-health.withLedgerLock (cognitive 26) src/shared/observer-health.ts:220 — observer-health.withLedgerLock has cognitive complexity 26 (threshold 15). Drivers by points: error handling 4 (11 pts), if/else 4 (8 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaSync.updateMergedIntoProject (cognitive 26) · ×1
  • ChromaSync.updateMergedIntoProject (cognitive 26) src/services/sync/ChromaSync.ts:2165 — ChromaSync.updateMergedIntoProject has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). Of this number, 22 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeProvider.createMessageGenerator (cognitive 26) · ×1
  • ClaudeProvider.createMessageGenerator (cognitive 26) src/services/worker/ClaudeProvider.ts:1165 — ClaudeProvider.createMessageGenerator has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 11). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build-dataset.main (cognitive 26) · ×1
  • build-dataset.main (cognitive 26) scripts/openrouter-price-history/build-dataset.py:82 — build-dataset.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · commitsFrom (cognitive 26) · ×1
  • commitsFrom (cognitive 26) src/services/work-view/work-product.mjs:125 — commitsFrom has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (7 pts), loops 2 (4 pts), boolean chains 3, other 2 (nesting depth added 9). Of this number, 23 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · atomic-json.writeJsonFileAtomic (cognitive 25) · ×1
  • atomic-json.writeJsonFileAtomic (cognitive 25) src/shared/atomic-json.ts:146 — atomic-json.writeJsonFileAtomic has cognitive complexity 25 (threshold 15). Drivers by points: error handling 6 (13 pts), if/else 5 (8 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.generateBugReport (cognitive 25) · ×1
  • index.generateBugReport (cognitive 25) scripts/bug-report/index.ts:26 — index.generateBugReport has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionStore.getObservationsByIds (cognitive 25) · ×1
  • SessionStore.getObservationsByIds (cognitive 25) src/services/sqlite/SessionStore.ts:3207 — SessionStore.getObservationsByIds has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 7 (9 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SessionStore.storeObservations (cognitive 25) · ×1
  • SessionStore.storeObservations (cognitive 25) src/services/sqlite/SessionStore.ts:3947 — SessionStore.storeObservations has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 12). None of this is in the body itself: all 25 points belong to one function literal inside it that branches (line 4006). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · strip-comments.processFile (cognitive 25) · ×1
  • strip-comments.processFile (cognitive 25) scripts/strip-comments.ts:331 — strip-comments.processFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 4, error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CloudSync.runHubStatusProbe (cognitive 25) · ×1
  • CloudSync.runHubStatusProbe (cognitive 25) src/services/sync/CloudSync.ts:1018 — CloudSync.runHubStatusProbe has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (6 pts), boolean chains 4, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseObservationBlocks (cognitive 25) · ×1
  • parser.parseObservationBlocks (cognitive 25) REDACTED:114 — parser.parseObservationBlocks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 13). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex-file-context.extractFromBash (cognitive 25) · ×1
  • codex-file-context.extractFromBash (cognitive 25) src/cli/adapters/codex-file-context.ts:87 — codex-file-context.extractFromBash has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 11). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · progressive-search.renderProgressiveSearchResult (cognitive 25) · ×1
  • progressive-search.renderProgressiveSearchResult (cognitive 25) src/shared/progressive-search.ts:299 — progressive-search.renderProgressiveSearchResult has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, ternaries 4 (6 pts), loops 1 (2 pts) (nesting depth added 7). Of this number, 21 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools.projectFullItem (cognitive 25) · ×1
  • tools.projectFullItem (cognitive 25) src/integrations/dsh-plugin/tools.ts:87 — tools.projectFullItem has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · tools.formatFullOutput (cognitive 25) · ×1
  • tools.formatFullOutput (cognitive 25) src/integrations/dsh-plugin/tools.ts:405 — tools.formatFullOutput has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 7. Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 409). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CodexCliInstaller.tomlStructuralLines (cognitive 25) · ×1
  • CodexCliInstaller.tomlStructuralLines (cognitive 25) src/services/integrations/CodexCliInstaller.ts:256 — CodexCliInstaller.tomlStructuralLines has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, loops 2 (5 pts), ternaries 1 (nesting depth added 8). None of this is in the body itself: all 25 points belong to one function literal inside it that branches (line 258). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · teambrain.runLeave (cognitive 25) · ×1
  • teambrain.runLeave (cognitive 25) src/npx-cli/commands/teambrain.ts:755 — teambrain.runLeave has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatibleProvider.startSession (cognitive 25) · ×1
  • OpenAICompatibleProvider.startSession (cognitive 25) src/services/worker/OpenAICompatibleProvider.ts:356 — OpenAICompatibleProvider.startSession has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Logger.formatTool (cognitive 24) · ×1
  • Logger.formatTool (cognitive 24) src/utils/logger.ts:276 — Logger.formatTool has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SessionSearch.buildFilterClause (cognitive 24) · ×1
  • SessionSearch.buildFilterClause (cognitive 24) src/services/sqlite/SessionSearch.ts:300 — SessionSearch.buildFilterClause has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 4 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · export-memories.exportMemories (cognitive 24) · ×1
  • export-memories.exportMemories (cognitive 24) REDACTED:52 — export-memories.exportMemories has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1 (nesting depth added 3). Of this number, 20 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · shutdown.signalProcess (cognitive 24) · ×1
  • shutdown.signalProcess (cognitive 24) src/supervisor/shutdown.ts:244 — shutdown.signalProcess has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (7 pts), error handling 2 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HealthMonitor.probePortBind (cognitive 24) · ×1
  • HealthMonitor.probePortBind (cognitive 24) REDACTED:127 — HealthMonitor.probePortBind has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, error handling 7 (10 pts), ternaries 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 170, 130, 141, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · teambrain.parseTeamBrainBoard (cognitive 24) · ×1
  • teambrain.parseTeamBrainBoard (cognitive 24) src/shared/teambrain.ts:406 — teambrain.parseTeamBrainBoard has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (8 pts), loops 3 (4 pts) (nesting depth added 5). Of this number, 17 points are the body's own statements and 7 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · hook-spool.parseHookSpoolEntry (cognitive 24) · ×1
  • hook-spool.parseHookSpoolEntry (cognitive 24) src/shared/hook-spool.ts:225 — hook-spool.parseHookSpoolEntry has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 9, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · stdin-reader.readJsonFromStdin (cognitive 24) · ×1
  • stdin-reader.readJsonFromStdin (cognitive 24) src/cli/stdin-reader.ts:42 — stdin-reader.readJsonFromStdin has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 2, ternaries 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 88, 108, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · install-launcher.ensureLocalBinOnShellPath (cognitive 24) · ×1
  • install-launcher.ensureLocalBinOnShellPath (cognitive 24) src/launcher/install-launcher.ts:237 — install-launcher.ensureLocalBinOnShellPath has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (11 pts), error handling 3 (6 pts), if/else 5, boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.requireWorkerStopped (cognitive 24) · ×1
  • install.requireWorkerStopped (cognitive 24) REDACTED:2372 — install.requireWorkerStopped has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 6 (9 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RateLimitStore.set (cognitive 24) · ×1
  • RateLimitStore.set (cognitive 24) src/services/worker/RateLimitStore.ts:118 — RateLimitStore.set has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 7, if/else 5 (7 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refresh-task.buildRefreshTask.run (cognitive 24) · ×1
  • refresh-task.buildRefreshTask.run (cognitive 24) src/services/work-view/refresh-task.ts:110 — refresh-task.buildRefreshTask.run has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 13 (24 pts), if/else 14 (19 pts), loops 6 (8 pts), error handling 3 (7 pts), boolean chains 4 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (refresh-task.buildRefreshTask.run::reviewBatch) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · sample-source.applySampleRuleChange (cognitive 24) · ×1
  • sample-source.applySampleRuleChange (cognitive 24) src/ui/my-work/src/live/sample-source.ts:18 — sample-source.applySampleRuleChange has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 5). Of this number, 23 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · control-plane-probe.runControlPlaneProbe (cognitive 24) · ×1
  • control-plane-probe.runControlPlaneProbe (cognitive 24) workers/sync-hub/src/control-plane-probe.ts:336 — control-plane-probe.runControlPlaneProbe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (7 pts), boolean chains 3, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readGoals (cognitive 24) · ×1
  • readGoals (cognitive 24) src/services/work-view/request-groups.mjs:150 — readGoals has cognitive complexity 24 (threshold 15). Drivers by points: other 9, ternaries 4 (5 pts), if/else 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 4). Of this number, 13 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ragtime.cleanupOldTranscripts (cognitive 23) · ×1
  • ragtime.cleanupOldTranscripts (cognitive 23) ragtime/ragtime.ts:57 — ragtime.cleanupOldTranscripts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (8 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionStore.ensureSyncRevisionTextAffinity (cognitive 23) · ×1
  • SessionStore.ensureSyncRevisionTextAffinity (cognitive 23) src/services/sqlite/SessionStore.ts:896 — SessionStore.ensureSyncRevisionTextAffinity has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 917). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · shutdown.runShutdownCascade (cognitive 23) · ×1
  • shutdown.runShutdownCascade (cognitive 23) src/supervisor/shutdown.ts:15 — shutdown.runShutdownCascade has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (4 pts), loops 4, boolean chains 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · error-scrub.extractErrorType (cognitive 23) · ×1
  • error-scrub.extractErrorType (cognitive 23) src/services/telemetry/error-scrub.ts:343 — error-scrub.extractErrorType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4 (7 pts), boolean chains 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessManager.resolveWorkerRuntimePathUncached (cognitive 23) · ×1
  • ProcessManager.resolveWorkerRuntimePathUncached (cognitive 23) REDACTED:127 — ProcessManager.resolveWorkerRuntimePathUncached has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 5 (8 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · port-reclaim.readWindowsProcessTableWithNames (cognitive 23) · ×1
  • port-reclaim.readWindowsProcessTableWithNames (cognitive 23) REDACTED:167 — port-reclaim.readWindowsProcessTableWithNames has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 2 (4 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaSync.buildClientSidePredicate (cognitive 23) · ×1
  • ChromaSync.buildClientSidePredicate (cognitive 23) src/services/sync/ChromaSync.ts:234 — ChromaSync.buildClientSidePredicate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncClient.handleSocketMessage (cognitive 23) · ×1
  • SyncClient.handleSocketMessage (cognitive 23) src/services/sync/SyncClient.ts:999 — SyncClient.handleSocketMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, error handling 2 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HookSpool.readEntries (cognitive 23) · ×1
  • HookSpool.readEntries (cognitive 23) src/shared/hook-spool.ts:625 — HookSpool.readEntries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shutdown-helper.shutdownWorkerAndWait (cognitive 23) · ×1
  • shutdown-helper.shutdownWorkerAndWait (cognitive 23) src/services/install/shutdown-helper.ts:104 — shutdown-helper.shutdownWorkerAndWait has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 4 (5 pts), error handling 1, loops 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AntigravityCliHooksInstaller.checkAntigravityCliHooksStatus (cognitive 23) · ×1
  • AntigravityCliHooksInstaller.checkAntigravityCliHooksStatus (cognitive 23) REDACTED:674 — AntigravityCliHooksInstaller.checkAntigravityCliHooksStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.promptClaudeModel (cognitive 23) · ×1
  • install.promptClaudeModel (cognitive 23) REDACTED:1392 — install.promptClaudeModel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 6). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · error-classification.classifyHttpProviderError (cognitive 23) · ×1
  • error-classification.classifyHttpProviderError (cognitive 23) src/server/generation/providers/shared/error-classification.ts:111 — error-classification.classifyHttpProviderError has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (8 pts), if/else 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · gemini-error-details.parseGeminiErrorDetails (cognitive 23) · ×1
  • gemini-error-details.parseGeminiErrorDetails (cognitive 23) src/shared/gemini-error-details.ts:47 — gemini-error-details.parseGeminiErrorDetails has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenRouterObservationProvider.generate (cognitive 23) · ×1
  • OpenRouterObservationProvider.generate (cognitive 23) src/server/generation/providers/OpenRouterObservationProvider.ts:92 — OpenRouterObservationProvider.generate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (7 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingest.parseMemoryFrontmatter (cognitive 23) · ×1
  • ingest.parseMemoryFrontmatter (cognitive 23) src/services/memory/ingest.ts:156 — ingest.parseMemoryFrontmatter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runMemoryCommand (cognitive 23) · ×1
  • cli.runMemoryCommand (cognitive 23) src/services/memory/cli.ts:44 — cli.runMemoryCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (8 pts), error handling 1 (3 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CodexAppServerClient.handleNotification (cognitive 23) · ×1
  • CodexAppServerClient.handleNotification (cognitive 23) src/services/worker/CodexAppServerClient.ts:901 — CodexAppServerClient.handleNotification has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexAppServerClient.createPrivateRuntime (cognitive 23) · ×1
  • CodexAppServerClient.createPrivateRuntime (cognitive 23) src/services/worker/CodexAppServerClient.ts:329 — CodexAppServerClient.createPrivateRuntime has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2 (4 pts), boolean chains 3, error handling 3 (nesting depth added 5). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeAgent.executeQuery (cognitive 23) · ×1
  • KnowledgeAgent.executeQuery (cognitive 23) src/services/worker/knowledge/KnowledgeAgent.ts:208 — KnowledgeAgent.executeQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-mem.claudeMemBridge (cognitive 22) · ×1
  • claude-mem.claudeMemBridge (cognitive 22) REDACTED:255 — claude-mem.claudeMemBridge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, ternaries 3, error handling 1 (2 pts) (nesting depth added 2). None of this is in the body itself: all 22 points belong to 6 function items inside it that branch (a function literal at line 355, a function literal at line 319, switchSession, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · dedup-store.sweepProjectCandidates (cognitive 22) · ×1
  • dedup-store.sweepProjectCandidates (cognitive 22) src/services/sqlite/dedup-store.ts:188 — dedup-store.sweepProjectCandidates has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 6 (10 pts), boolean chains 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ChromaMcpManager.isUvxAvailable (cognitive 22) · ×1
  • ChromaMcpManager.isUvxAvailable (cognitive 22) REDACTED:2131 — ChromaMcpManager.isUvxAvailable has cognitive complexity 22 (threshold 15). Drivers by points: error handling 2 (5 pts), if/else 3 (5 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncApply.applyCanonicalRowOp (cognitive 22) · ×1
  • SyncApply.applyCanonicalRowOp (cognitive 22) src/services/sync/SyncApply.ts:819 — SyncApply.applyCanonicalRowOp has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (10 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · auth.authenticateRequest (cognitive 22) · ×1
  • auth.authenticateRequest (cognitive 22) services/sync-api/src/auth.ts:175 — auth.authenticateRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 4 (6 pts), boolean chains 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · hook-command.hookCommand (cognitive 22) · ×1
  • hook-command.hookCommand (cognitive 22) src/cli/hook-command.ts:89 — hook-command.hookCommand has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (9 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HermesInstaller.installHermesIntegration (cognitive 22) · ×1
  • HermesInstaller.installHermesIntegration (cognitive 22) src/services/integrations/HermesInstaller.ts:112 — HermesInstaller.installHermesIntegration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · observation-embeddings.observationEmbeddingParts (cognitive 22) · ×1
  • observation-embeddings.observationEmbeddingParts (cognitive 22) src/storage/postgres/observation-embeddings.ts:31 — observation-embeddings.observationEmbeddingParts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (8 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). Of this number, 19 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeObservationProvider.classifyClaudeServerError (cognitive 22) · ×1
  • ClaudeObservationProvider.classifyClaudeServerError (cognitive 22) src/server/generation/providers/ClaudeObservationProvider.ts:190 — ClaudeObservationProvider.classifyClaudeServerError has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 9, boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · telemetry.errorBeforeSend (cognitive 22) · ×1
  • telemetry.errorBeforeSend (cognitive 22) src/services/telemetry/telemetry.ts:337 — telemetry.errorBeforeSend has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 4 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SessionManager.getMessageIterator (cognitive 22) · ×1
  • SessionManager.getMessageIterator (cognitive 22) src/services/worker/SessionManager.ts:825 — SessionManager.getMessageIterator has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 4 (6 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResponseProcessor.extractObservationFileEvidence (cognitive 22) · ×1
  • ResponseProcessor.extractObservationFileEvidence (cognitive 22) src/services/worker/agents/ResponseProcessor.ts:46 — ResponseProcessor.extractObservationFileEvidence has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (10 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResponseProcessor.syncAndBroadcastObservations (cognitive 22) · ×1
  • ResponseProcessor.syncAndBroadcastObservations (cognitive 22) src/services/worker/agents/ResponseProcessor.ts:1060 — ResponseProcessor.syncAndBroadcastObservations has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (8 pts), loops 2 (3 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CodexAppServerClient.runTurnExclusive (cognitive 22) · ×1
  • CodexAppServerClient.runTurnExclusive (cognitive 22) src/services/worker/CodexAppServerClient.ts:492 — CodexAppServerClient.runTurnExclusive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, ternaries 4 (5 pts), boolean chains 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SearchManager.searchObservations (cognitive 22) · ×1
  • SearchManager.searchObservations (cognitive 22) src/services/worker/SearchManager.ts:984 — SearchManager.searchObservations has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 4 (5 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchManager.getTimelineByQuery (cognitive 22) · ×1
  • SearchManager.getTimelineByQuery (cognitive 22) src/services/worker/SearchManager.ts:1189 — SearchManager.getTimelineByQuery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (8 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextCacheService.renderPending (cognitive 22) · ×1
  • ContextCacheService.renderPending (cognitive 22) src/services/worker/ContextCacheService.ts:315 — ContextCacheService.renderPending has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeAgent.prime (cognitive 22) · ×1
  • KnowledgeAgent.prime (cognitive 22) src/services/worker/knowledge/KnowledgeAgent.ts:95 — KnowledgeAgent.prime has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.authenticateRequest (cognitive 22) · ×1
  • index.authenticateRequest (cognitive 22) workers/sync-hub/src/index.ts:324 — index.authenticateRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 4 (6 pts), boolean chains 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · build-hooks.verifyClaudeCodeRuntimeHooksAreExecForm (cognitive 21) · ×1
  • build-hooks.verifyClaudeCodeRuntimeHooksAreExecForm (cognitive 21) scripts/build-hooks.js:294 — build-hooks.verifyClaudeCodeRuntimeHooksAreExecForm has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (12 pts), boolean chains 4, if/else 2 (4 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 302). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · project-environments.parseProjectEnvironments (cognitive 21) · ×1
  • project-environments.parseProjectEnvironments (cognitive 21) src/utils/project-environments.ts:21 — project-environments.parseProjectEnvironments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionSearch.searchObservations (cognitive 21) · ×1
  • SessionSearch.searchObservations (cognitive 21) src/services/sqlite/SessionSearch.ts:741 — SessionSearch.searchObservations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 2 (5 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionStore.getTimelineAroundObservation (cognitive 21) · ×1
  • SessionStore.getTimelineAroundObservation (cognitive 21) src/services/sqlite/SessionStore.ts:4288 — SessionStore.getTimelineAroundObservation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (4 pts), ternaries 2, boolean chains 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaMcpManager.disposeCurrentSubprocess (cognitive 21) · ×1
  • ChromaMcpManager.disposeCurrentSubprocess (cognitive 21) REDACTED:1702 — ChromaMcpManager.disposeCurrentSubprocess has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (7 pts), error handling 3 (6 pts), if/else 5, boolean chains 3 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · hook-spool.migrateLegacySessionEndReplay (cognitive 21) · ×1
  • hook-spool.migrateLegacySessionEndReplay (cognitive 21) src/shared/hook-spool.ts:679 — hook-spool.migrateLegacySessionEndReplay has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 4 (6 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · teambrain.runJoin (cognitive 21) · ×1
  • teambrain.runJoin (cognitive 21) src/npx-cli/commands/teambrain.ts:544 — teambrain.runJoin has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LocalEmbedder.encode (cognitive 21) · ×1
  • LocalEmbedder.encode (cognitive 21) src/services/vector/LocalEmbedder.ts:129 — LocalEmbedder.encode has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 5 (9 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 147). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · telemetry.redactAutocapturedExceptionList (cognitive 21) · ×1
  • telemetry.redactAutocapturedExceptionList (cognitive 21) src/services/telemetry/telemetry.ts:251 — telemetry.redactAutocapturedExceptionList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerV1PostgresRoutes.retryGenerationJob (cognitive 21) · ×1
  • ServerV1PostgresRoutes.retryGenerationJob (cognitive 21) src/server/routes/v1/ServerV1PostgresRoutes.ts:1708 — ServerV1PostgresRoutes.retryGenerationJob has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 2 (5 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · create-server-service.validateServerEnv (cognitive 21) · ×1
  • create-server-service.validateServerEnv (cognitive 21) src/server/runtime/create-server-service.ts:94 — create-server-service.validateServerEnv has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingest.ingestMemorySource (cognitive 21) · ×1
  • ingest.ingestMemorySource (cognitive 21) src/services/memory/ingest.ts:631 — ingest.ingestMemorySource has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenRouterProvider.buildOpenRouterRequestBody (cognitive 21) · ×1
  • OpenRouterProvider.buildOpenRouterRequestBody (cognitive 21) src/services/worker/OpenRouterProvider.ts:576 — OpenRouterProvider.buildOpenRouterRequestBody has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, ternaries 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · request-groups.validateGroupingAnswer (cognitive 21) · ×1
  • request-groups.validateGroupingAnswer (cognitive 21) src/services/work-view/request-groups.mjs:555 — request-groups.validateGroupingAnswer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (7 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refresh-task.buildRefreshTask.run · ×1
  • refresh-task.buildRefreshTask.run::reviewBatch (cognitive 21) src/services/work-view/refresh-task.ts:224 — refresh-task.buildRefreshTask.run::reviewBatch has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 2 (6 pts), error handling 2 (5 pts), loops 3 (5 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (refresh-task.buildRefreshTask.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · GeneratorExitHandler.handleGeneratorExit (cognitive 21) · ×1
  • GeneratorExitHandler.handleGeneratorExit (cognitive 21) src/services/worker/session/GeneratorExitHandler.ts:46 — GeneratorExitHandler.handleGeneratorExit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configure-telegram.promptLine (cognitive 20) · ×1
  • configure-telegram.promptLine (cognitive 20) REDACTED:55 — configure-telegram.promptLine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 71). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tool-uses.getToolUsesByIds (cognitive 20) · ×1
  • tool-uses.getToolUsesByIds (cognitive 20) src/services/sqlite/tool-uses.ts:314 — tool-uses.getToolUsesByIds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eval-read-gate.parseRunnerArguments (cognitive 20) · ×1
  • eval-read-gate.parseRunnerArguments (cognitive 20) REDACTED:124 — eval-read-gate.parseRunnerArguments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessManager.executeCwdRemap (cognitive 20) · ×1
  • ProcessManager.executeCwdRemap (cognitive 20) REDACTED:325 — ProcessManager.executeCwdRemap has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). Of this number, 10 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloudSync.drainContentOutbox (cognitive 20) · ×1
  • CloudSync.drainContentOutbox (cognitive 20) src/services/sync/CloudSync.ts:1192 — CloudSync.drainContentOutbox has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncApply.applyRemapProject (cognitive 20) · ×1
  • SyncApply.applyRemapProject (cognitive 20) src/services/sync/SyncApply.ts:1565 — SyncApply.applyRemapProject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · file-context.lookupFileObservationHistory (cognitive 20) · ×1
  • file-context.lookupFileObservationHistory (cognitive 20) src/cli/handlers/file-context.ts:436 — file-context.lookupFileObservationHistory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SessionManager.deleteSession (cognitive 20) · ×1
  • SessionManager.deleteSession (cognitive 20) src/services/worker/SessionManager.ts:581 — SessionManager.deleteSession has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, error handling 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ServerJobQueue.close (cognitive 20) · ×1
  • ServerJobQueue.close (cognitive 20) src/server/jobs/ServerJobQueue.ts:362 — ServerJobQueue.close has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), error handling 3 (6 pts), if/else 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectMerge.mergeProjectInto (cognitive 20) · ×1
  • ProjectMerge.mergeProjectInto (cognitive 20) src/services/infrastructure/ProjectMerge.ts:39 — ProjectMerge.mergeProjectInto has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 2, loops 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CcsAlignRulesWalker.discoverLayerPaths (cognitive 20) · ×1
  • CcsAlignRulesWalker.discoverLayerPaths (cognitive 20) src/services/integrations/CcsAlignRulesWalker.ts:633 — CcsAlignRulesWalker.discoverLayerPaths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (5 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingest.sniffCwd (cognitive 20) · ×1
  • ingest.sniffCwd (cognitive 20) src/services/memory/ingest.ts:256 — ingest.sniffCwd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingest.scanMemorySource (cognitive 20) · ×1
  • ingest.scanMemorySource (cognitive 20) src/services/memory/ingest.ts:386 — ingest.scanMemorySource has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 3 (7 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchOrchestrator.normalizeParams (cognitive 20) · ×1
  • SearchOrchestrator.normalizeParams (cognitive 20) src/services/worker/search/SearchOrchestrator.ts:245 — SearchOrchestrator.normalizeParams has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SessionRoutes.admitAndStartGenerator (cognitive 20) · ×1
  • SessionRoutes.admitAndStartGenerator (cognitive 20) REDACTED:447 — SessionRoutes.admitAndStartGenerator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useSessionCatalog.useSessionCatalog.fetchPage (cognitive 20) · ×1
  • useSessionCatalog.useSessionCatalog.fetchPage (cognitive 20) src/ui/viewer/hooks/useSessionCatalog.ts:44 — useSessionCatalog.useSessionCatalog.fetchPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pathsIn (cognitive 20) · ×1
  • pathsIn (cognitive 20) src/services/work-view/session-project.mjs:71 — pathsIn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 6). Of this number, 16 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · version-check.ensurePluginDependencies (cognitive 19) · ×1
  • version-check.ensurePluginDependencies (cognitive 19) plugin/scripts/version-check.js:206 — version-check.ensurePluginDependencies has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · tree-sitter-cli-provision.ensureTreeSitterCliBinary (cognitive 19) · ×1
  • tree-sitter-cli-provision.ensureTreeSitterCliBinary (cognitive 19) src/services/smart-file-read/tree-sitter-cli-provision.ts:221 — tree-sitter-cli-provision.ensureTreeSitterCliBinary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (4 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · orphan-chroma-sweep.sweepOrphanedChromaTrees (cognitive 19) · ×1
  • orphan-chroma-sweep.sweepOrphanedChromaTrees (cognitive 19) src/supervisor/orphan-chroma-sweep.ts:138 — orphan-chroma-sweep.sweepOrphanedChromaTrees has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker-utils.ensureWorkerReadyWithin (cognitive 19) · ×1
  • worker-utils.ensureWorkerReadyWithin (cognitive 19) REDACTED:1760 — worker-utils.ensureWorkerReadyWithin has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · smoke-clean-room.checkPluginClosure (cognitive 19) · ×1
  • smoke-clean-room.checkPluginClosure (cognitive 19) scripts/smoke-clean-room.cjs:79 — smoke-clean-room.checkPluginClosure has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 2 (3 pts), loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · observer-health.renderObserverQuotaCooldownNotice (cognitive 19) · ×1
  • observer-health.renderObserverQuotaCooldownNotice (cognitive 19) src/shared/observer-health.ts:532 — observer-health.renderObserverQuotaCooldownNotice has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloudSync.validatePushResponse (cognitive 19) · ×1
  • CloudSync.validatePushResponse (cognitive 19) src/services/sync/CloudSync.ts:1758 — CloudSync.validatePushResponse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HookSpool.unlinkTransferredEntry (cognitive 19) · ×1
  • HookSpool.unlinkTransferredEntry (cognitive 19) src/shared/hook-spool.ts:521 — HookSpool.unlinkTransferredEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 pts), error handling 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage-summary.buildUsageSummary (cognitive 19) · ×1
  • usage-summary.buildUsageSummary (cognitive 19) src/npx-cli/install/usage-summary.ts:72 — usage-summary.buildUsageSummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.runSearchCommand (cognitive 19) · ×1
  • runtime.runSearchCommand (cognitive 19) src/npx-cli/commands/runtime.ts:256 — runtime.runSearchCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), boolean chains 2, error handling 2 (nesting depth added 5). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.runServerKeysRotateCommand (cognitive 19) · ×1
  • server.runServerKeysRotateCommand (cognitive 19) src/npx-cli/commands/server.ts:117 — server.runServerKeysRotateCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 5 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · middleware.logRemoteDenial (cognitive 19) · ×1
  • middleware.logRemoteDenial (cognitive 19) REDACTED:342 — middleware.logRemoteDenial has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ObservationEmbeddingService.embedMissingObservations (cognitive 19) · ×1
  • ObservationEmbeddingService.embedMissingObservations (cognitive 19) src/server/services/ObservationEmbeddingService.ts:317 — ObservationEmbeddingService.embedMissingObservations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResponseProcessor.extractPatchPaths (cognitive 19) · ×1
  • ResponseProcessor.extractPatchPaths (cognitive 19) src/services/worker/agents/ResponseProcessor.ts:180 — ResponseProcessor.extractPatchPaths has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CcsAlignMiddleCache.appendMiddleCacheRecordsAtomic (cognitive 19) · ×1
  • CcsAlignMiddleCache.appendMiddleCacheRecordsAtomic (cognitive 19) src/services/integrations/CcsAlignMiddleCache.ts:335 — CcsAlignMiddleCache.appendMiddleCacheRecordsAtomic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, error handling 2 (3 pts), loops 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchManager.normalizeParams (cognitive 19) · ×1
  • SearchManager.normalizeParams (cognitive 19) src/services/worker/SearchManager.ts:294 — SearchManager.normalizeParams has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · worker-service.runServerApiKeyCli (cognitive 19) · ×1
  • worker-service.runServerApiKeyCli (cognitive 19) REDACTED:1384 — worker-service.runServerApiKeyCli has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shared.ingestSummarize (cognitive 19) · ×1
  • shared.ingestSummarize (cognitive 19) REDACTED:377 — shared.ingestSummarize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App.LoadedApp (cognitive 19) · ×1
  • App.LoadedApp (cognitive 19) src/ui/my-work/src/App.tsx:115 — App.LoadedApp has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 8 (9 pts) (nesting depth added 1). Of this number, 11 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · canary.parseArgs (cognitive 19) · ×1
  • canary.parseArgs (cognitive 19) workers/sync-hub/canary/canary.ts:85 — canary.parseArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, loops 2 (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · client._strip_text (cognitive 19) · ×1
  • client._strip_text (cognitive 19) REDACTED:42 — client._strip_text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · export_owner_prompts.strip_memory_tags (cognitive 19) · ×1
  • export_owner_prompts.strip_memory_tags (cognitive 19) plugin/skills/owner-goals/scripts/export_owner_prompts.py:40 — export_owner_prompts.strip_memory_tags has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createHumanCopyInput (cognitive 19) · ×1
  • createHumanCopyInput (cognitive 19) src/services/work-view/human-copy.mjs:41 — createHumanCopyInput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, other 4, loops 1, ternaries 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 4 belong to 10 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · version-check.findMissingDependencies (cognitive 18) · ×1
  • version-check.findMissingDependencies (cognitive 18) plugin/scripts/version-check.js:95 — version-check.findMissingDependencies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 3 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Logger.safeStringify (cognitive 18) · ×1
  • Logger.safeStringify (cognitive 18) src/utils/logger.ts:209 — Logger.safeStringify has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, ternaries 3 (5 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (prune). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · collector.formatDiagnostics (cognitive 18) · ×1
  • collector.formatDiagnostics (cognitive 18) REDACTED:324 — collector.formatDiagnostics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worktree.detectWorktree (cognitive 18) · ×1
  • worktree.detectWorktree (cognitive 18) src/utils/worktree.ts:23 — worktree.detectWorktree has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 2, error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redaction.redactSensitive (cognitive 18) · ×1
  • redaction.redactSensitive (cognitive 18) REDACTED:109 — redaction.redactSensitive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CanonicalContent.normalizeJson (cognitive 18) · ×1
  • CanonicalContent.normalizeJson (cognitive 18) src/services/sync/CanonicalContent.ts:78 — CanonicalContent.normalizeJson has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Supervisor.configureSignalHandlers (cognitive 18) · ×1
  • Supervisor.configureSignalHandlers (cognitive 18) src/supervisor/index.ts:75 — Supervisor.configureSignalHandlers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (handleSignal). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · worker-utils.pollLegacyWorkerReadiness (cognitive 18) · ×1
  • worker-utils.pollLegacyWorkerReadiness (cognitive 18) REDACTED:857 — worker-utils.pollLegacyWorkerReadiness has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (5 pts), error handling 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaMcpManager.readChromaStoreRecord (cognitive 18) · ×1
  • ChromaMcpManager.readChromaStoreRecord (cognitive 18) REDACTED:908 — ChromaMcpManager.readChromaStoreRecord has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 5 (6 pts), error handling 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ChromaSync.getExistingChromaIds (cognitive 18) · ×1
  • ChromaSync.getExistingChromaIds (cognitive 18) src/services/sync/ChromaSync.ts:1181 — ChromaSync.getExistingChromaIds has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncApply.replaySetAsideWorkState (cognitive 18) · ×1
  • SyncApply.replaySetAsideWorkState (cognitive 18) src/services/sync/SyncApply.ts:719 — SyncApply.replaySetAsideWorkState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 723). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · claude-md-commands.cleanClaudeMd (cognitive 18) · ×1
  • claude-md-commands.cleanClaudeMd (cognitive 18) src/cli/claude-md-commands.ts:532 — claude-md-commands.cleanClaudeMd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (5 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (walkForClaudeMd). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · my-rules.renderRulesFile (cognitive 18) · ×1
  • my-rules.renderRulesFile (cognitive 18) src/services/work-view/my-rules.mjs:150 — my-rules.renderRulesFile has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (8 pts), boolean chains 4, loops 3 (4 pts), if/else 1 (2 pts) (nesting depth added 7). Of this number, 14 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hermes-config-yaml.findBlock (cognitive 18) · ×1
  • hermes-config-yaml.findBlock (cognitive 18) src/services/integrations/hermes-config-yaml.ts:55 — hermes-config-yaml.findBlock has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 7, loops 2, ternaries 2. Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CursorHooksInstaller.removeCursorHooksFiles (cognitive 18) · ×1
  • CursorHooksInstaller.removeCursorHooksFiles (cognitive 18) src/services/integrations/CursorHooksInstaller.ts:420 — CursorHooksInstaller.removeCursorHooksFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrokBotInstaller.listGrokBotAgents (cognitive 18) · ×1
  • GrokBotInstaller.listGrokBotAgents (cognitive 18) src/services/integrations/GrokBotInstaller.ts:179 — GrokBotInstaller.listGrokBotAgents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api-key-pool.withKeyPool (cognitive 18) · ×1
  • api-key-pool.withKeyPool (cognitive 18) src/shared/api-key-pool.ts:465 — api-key-pool.withKeyPool has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingest.readMemoryDir (cognitive 18) · ×1
  • ingest.readMemoryDir (cognitive 18) src/services/memory/ingest.ts:309 — ingest.readMemoryDir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · field-utils.resolveFieldSpec (cognitive 18) · ×1
  • field-utils.resolveFieldSpec (cognitive 18) REDACTED:67 — field-utils.resolveFieldSpec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent-view.buildAgentView.metadataFor (cognitive 18) · ×1
  • agent-view.buildAgentView.metadataFor (cognitive 18) src/services/work-view/agent-view.mjs:183 — agent-view.buildAgentView.metadataFor has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (7 pts), error handling 1 (3 pts), if/else 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeAgent.query (cognitive 18) · ×1
  • KnowledgeAgent.query (cognitive 18) src/services/worker/knowledge/KnowledgeAgent.ts:163 — KnowledgeAgent.query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connection-status.getConnectionStatus (cognitive 18) · ×1
  • connection-status.getConnectionStatus (cognitive 18) src/ui/my-work/src/live/connection-status.ts:54 — connection-status.getConnectionStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · data.assertConsistentRequest (cognitive 18) · ×1
  • data.assertConsistentRequest (cognitive 18) src/ui/my-work/src/data.ts:215 — data.assertConsistentRequest has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 9. Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 216). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · status-normalization.normalizeRequestStatus (cognitive 18) · ×1
  • status-normalization.normalizeRequestStatus (cognitive 18) src/ui/my-work/src/live/status-normalization.ts:72 — status-normalization.normalizeRequestStatus has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 6, if/else 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · my-rules.MyRules · ×1
  • my-rules.MyRules::saveDraft (cognitive 18) src/ui/my-work/src/pages/my-rules.tsx:710 — my-rules.MyRules::saveDraft has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5 (7 pts), error handling 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · projectFromToolPaths (cognitive 18) · ×1
  • projectFromToolPaths (cognitive 18) src/services/work-view/session-project.mjs:110 — projectFromToolPaths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 1, other 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Logger.formatData (cognitive 17) · ×1
  • Logger.formatData (cognitive 17) src/utils/logger.ts:248 — Logger.formatData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grok-bot-session-inject.parseTimelineRows (cognitive 17) · ×1
  • grok-bot-session-inject.parseTimelineRows (cognitive 17) scripts/grok-bot-session-inject.mjs:511 — grok-bot-session-inject.parseTimelineRows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · process-identity.readStartToken (cognitive 17) · ×1
  • process-identity.readStartToken (cognitive 17) src/shared/process-identity.ts:135 — process-identity.readStartToken has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (5 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · process-registry.createSdkSpawnFactory (cognitive 17) · ×1
  • process-registry.createSdkSpawnFactory (cognitive 17) src/supervisor/process-registry.ts:1030 — process-registry.createSdkSpawnFactory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 1031). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · port-reclaim.readLinuxProcessTableWithNames (cognitive 17) · ×1
  • port-reclaim.readLinuxProcessTableWithNames (cognitive 17) REDACTED:215 — port-reclaim.readLinuxProcessTableWithNames has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 2 (4 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · regenerate-claude-md.formatObservationsForClaudeMd (cognitive 17) · ×1
  • regenerate-claude-md.formatObservationsForClaudeMd (cognitive 17) scripts/regenerate-claude-md.ts:194 — regenerate-claude-md.formatObservationsForClaudeMd has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 2 (4 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · strip-comments.stripHashFromLine (cognitive 17) · ×1
  • strip-comments.stripHashFromLine (cognitive 17) scripts/strip-comments.ts:298 — strip-comments.stripHashFromLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-md-commands.formatObservationsForClaudeMd (cognitive 17) · ×1
  • claude-md-commands.formatObservationsForClaudeMd (cognitive 17) src/cli/claude-md-commands.ts:268 — claude-md-commands.formatObservationsForClaudeMd has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 2 (4 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · quota-cooldown.hydrateFromDisk (cognitive 17) · ×1
  • quota-cooldown.hydrateFromDisk (cognitive 17) src/shared/quota-cooldown.ts:118 — quota-cooldown.hydrateFromDisk has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (5 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-mem-launcher.runThroughWorker (cognitive 17) · ×1
  • claude-mem-launcher.runThroughWorker (cognitive 17) src/launcher/claude-mem-launcher.ts:268 — claude-mem-launcher.runThroughWorker has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 3). Of this number, 10 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · banner.playBanner (cognitive 17) · ×1
  • banner.playBanner (cognitive 17) src/npx-cli/banner.ts:213 — banner.playBanner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 6 (nesting depth added 4). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · setup-runtime.ensureUv (cognitive 17) · ×1
  • setup-runtime.ensureUv (cognitive 17) src/npx-cli/install/setup-runtime.ts:334 — setup-runtime.ensureUv has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · teambrain.restartWorkerForSyncChange (cognitive 17) · ×1
  • teambrain.restartWorkerForSyncChange (cognitive 17) src/npx-cli/commands/teambrain.ts:465 — teambrain.restartWorkerForSyncChange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrokBotAwarenessPusher.notifyGrokBotAwareness (cognitive 17) · ×1
  • GrokBotAwarenessPusher.notifyGrokBotAwareness (cognitive 17) src/services/integrations/GrokBotAwarenessPusher.ts:136 — GrokBotAwarenessPusher.notifyGrokBotAwareness has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (5 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp-http.startMcpHttpServer.handle (cognitive 17) · ×1
  • mcp-http.startMcpHttpServer.handle (cognitive 17) src/servers/mcp-http.ts:335 — mcp-http.startMcpHttpServer.handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · state.loadWatchState (cognitive 17) · ×1
  • state.loadWatchState (cognitive 17) src/services/transcripts/state.ts:56 — state.loadWatchState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 3 belong to 4 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CorpusBuilder.build (cognitive 17) · ×1
  • CorpusBuilder.build (cognitive 17) src/services/worker/knowledge/CorpusBuilder.ts:37 — CorpusBuilder.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FileTailer.readNewData (cognitive 17) · ×1
  • FileTailer.readNewData (cognitive 17) src/services/transcripts/watcher.ts:321 — FileTailer.readNewData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FileTailer.readNewJsonl (cognitive 17) · ×1
  • FileTailer.readNewJsonl (cognitive 17) src/services/transcripts/watcher.ts:396 — FileTailer.readNewJsonl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (4 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · to-work-model.toWorkModel (cognitive 17) · ×1
  • to-work-model.toWorkModel (cognitive 17) src/ui/my-work/src/live/to-work-model.ts:411 — to-work-model.toWorkModel has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 3, error handling 1 (2 pts), if/else 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · save-error.readResponseText (cognitive 17) · ×1
  • save-error.readResponseText (cognitive 17) REDACTED:26 — save-error.readResponseText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · watchdog.runWatchdog (cognitive 17) · ×1
  • watchdog.runWatchdog (cognitive 17) workers/sync-hub/src/watchdog.ts:426 — watchdog.runWatchdog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 3 (5 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · export_owner_prompts.main (cognitive 17) · ×1
  • export_owner_prompts.main (cognitive 17) plugin/skills/owner-goals/scripts/export_owner_prompts.py:230 — export_owner_prompts.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmem-hook.mcpRpc (cognitive 16) · ×1
  • cmem-hook.mcpRpc (cognitive 16) cowork/scripts/cmem-hook.mjs:287 — cmem-hook.mcpRpc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionStore.createSDKSession (cognitive 16) · ×1
  • SessionStore.createSDKSession (cognitive 16) src/services/sqlite/SessionStore.ts:3571 — SessionStore.createSDKSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grok-bot-session-inject.ensureWatchesForLiveAgents (cognitive 16) · ×1
  • grok-bot-session-inject.ensureWatchesForLiveAgents (cognitive 16) scripts/grok-bot-session-inject.mjs:356 — grok-bot-session-inject.ensureWatchesForLiveAgents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · regenerate-claude-md.main (cognitive 16) · ×1
  • regenerate-claude-md.main (cognitive 16) scripts/regenerate-claude-md.ts:379 — regenerate-claude-md.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.translateReadme · ×1
  • index.translateReadme::translateLang (cognitive 16) scripts/translate-readme/index.ts:284 — index.translateReadme::translateLang has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerClient.request (cognitive 16) · ×1
  • ServerClient.request (cognitive 16) src/services/hooks/server-client.ts:446 — ServerClient.request has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 4, ternaries 3 (4 pts), error handling 3 (nesting depth added 1). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TimelineRenderer.buildHumanTimelineEntries (cognitive 16) · ×1
  • TimelineRenderer.buildHumanTimelineEntries (cognitive 16) src/services/context/sections/TimelineRenderer.ts:107 — TimelineRenderer.buildHumanTimelineEntries has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 1 (3 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · quota-cooldown.syncObserverHealthQuotaCooldown (cognitive 16) · ×1
  • quota-cooldown.syncObserverHealthQuotaCooldown (cognitive 16) src/shared/quota-cooldown.ts:617 — quota-cooldown.syncObserverHealthQuotaCooldown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 4, boolean chains 2, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · progressive-search.indexRows (cognitive 16) · ×1
  • progressive-search.indexRows (cognitive 16) src/shared/progressive-search.ts:111 — progressive-search.indexRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install-launcher.removeStalePlacementLeftovers (cognitive 16) · ×1
  • install-launcher.removeStalePlacementLeftovers (cognitive 16) src/launcher/install-launcher.ts:598 — install-launcher.removeStalePlacementLeftovers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · T3CodeInstaller.assertT3CodePluginLoading (cognitive 16) · ×1
  • T3CodeInstaller.assertT3CodePluginLoading (cognitive 16) REDACTED:137 — T3CodeInstaller.assertT3CodePluginLoading has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · npm-install-helper.runNpmStrict (cognitive 16) · ×1
  • npm-install-helper.runNpmStrict (cognitive 16) src/npx-cli/install/npm-install-helper.ts:77 — npm-install-helper.runNpmStrict has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 4 function literals inside it that branch (lines 124, 93, 110, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · OpenCodeInstaller.checkOpenCodeStatus (cognitive 16) · ×1
  • OpenCodeInstaller.checkOpenCodeStatus (cognitive 16) src/services/integrations/OpenCodeInstaller.ts:436 — OpenCodeInstaller.checkOpenCodeStatus has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 5 (6 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WindsurfHooksInstaller.checkWindsurfHooksStatus (cognitive 16) · ×1
  • WindsurfHooksInstaller.checkWindsurfHooksStatus (cognitive 16) REDACTED:356 — WindsurfHooksInstaller.checkWindsurfHooksStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 1 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenClawInstaller.checkOpenClawStatus (cognitive 16) · ×1
  • OpenClawInstaller.checkOpenClawStatus (cognitive 16) src/services/integrations/OpenClawInstaller.ts:242 — OpenClawInstaller.checkOpenClawStatus has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4 (7 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RateLimitStore.readUnifiedWindows (cognitive 16) · ×1
  • RateLimitStore.readUnifiedWindows (cognitive 16) src/services/worker/RateLimitStore.ts:268 — RateLimitStore.readUnifiedWindows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeObservationProvider.generate (cognitive 16) · ×1
  • ClaudeObservationProvider.generate (cognitive 16) src/server/generation/providers/ClaudeObservationProvider.ts:66 — ClaudeObservationProvider.generate has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 5, boolean chains 2, error handling 2 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · OpenAICompatibleProvider.conversationToOpenAIMessages (cognitive 16) · ×1
  • OpenAICompatibleProvider.conversationToOpenAIMessages (cognitive 16) src/services/worker/OpenAICompatibleProvider.ts:292 — OpenAICompatibleProvider.conversationToOpenAIMessages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.qualifySymbolName (cognitive 16) · ×1
  • parser.qualifySymbolName (cognitive 16) REDACTED:1260 — parser.qualifySymbolName has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (6 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · search.walkDir (cognitive 16) · ×1
  • search.walkDir (cognitive 16) src/services/smart-file-read/search.ts:70 — search.walkDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CleanupV12_4_3.runOneTimeV12_4_3Cleanup (cognitive 16) · ×1
  • CleanupV12_4_3.runOneTimeV12_4_3Cleanup (cognitive 16) src/services/infrastructure/CleanupV12_4_3.ts:27 — CleanupV12_4_3.runOneTimeV12_4_3Cleanup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 2 (5 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dependency-preflight.runWorkerDependencyPreflight (cognitive 16) · ×1
  • dependency-preflight.runWorkerDependencyPreflight (cognitive 16) src/services/worker/dependency-preflight.ts:163 — dependency-preflight.runWorkerDependencyPreflight has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 2 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexProvider.classifyCodexError (cognitive 16) · ×1
  • CodexProvider.classifyCodexError (cognitive 16) src/services/worker/CodexProvider.ts:116 — CodexProvider.classifyCodexError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · provider-dispatch.noteQuotaFallbackTransition (cognitive 16) · ×1
  • provider-dispatch.noteQuotaFallbackTransition (cognitive 16) src/services/worker/provider-dispatch.ts:249 — provider-dispatch.noteQuotaFallbackTransition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · provider-dispatch.selectProviderForGenerator (cognitive 16) · ×1
  • provider-dispatch.selectProviderForGenerator (cognitive 16) src/services/worker/provider-dispatch.ts:406 — provider-dispatch.selectProviderForGenerator has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider-dispatch.recordCmemFallbackIfEligible (cognitive 16) · ×1
  • provider-dispatch.recordCmemFallbackIfEligible (cognitive 16) src/services/worker/provider-dispatch.ts:469 — provider-dispatch.recordCmemFallbackIfEligible has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SearchManager.mergeKeywordMatchesByDate (cognitive 16) · ×1
  • SearchManager.mergeKeywordMatchesByDate (cognitive 16) src/services/worker/SearchManager.ts:402 — SearchManager.mergeKeywordMatchesByDate has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 3, if/else 1 (2 pts), loops 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · request-groups.linkBackwards · ×1
  • request-groups.linkBackwards::shared (cognitive 16) src/services/work-view/request-groups.mjs:123 — request-groups.linkBackwards::shared has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-mem._last_assistant_text (cognitive 16) · ×1
  • claude-mem._last_assistant_text (cognitive 16) hermes/claude-mem/__init__.py:81 — claude-mem._last_assistant_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pushesFrom (cognitive 16) · ×1
  • pushesFrom (cognitive 16) src/services/work-view/work-product.mjs:168 — pushesFrom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (4 pts), other 3, boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validateOutcome (cognitive 16) · ×1
  • validateOutcome (cognitive 16) src/services/work-view/request-groups.mjs:269 — validateOutcome has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 4, other 4, ternaries 1. Of this number, 10 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · readAgentRecords (cognitive 16) · ×1
  • readAgentRecords (cognitive 16) src/services/work-view/agent-view.mjs:78 — readAgentRecords has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6, if/else 3 (4 pts), boolean chains 2, loops 2, error handling 1, other 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to 17 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D32 · Data Compliance (PII/GDPR) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: SettingsDefaultsManager.ts, settings.ts, types.ts src/shared/SettingsDefaultsManager.ts — 3 files — `src/shared/SettingsDefaultsManager.ts`, `src/ui/viewer/constants/settings.ts`, `src/ui/viewer/types.ts` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 137 shared lines) · ×1
  • Near-duplicate member family (5 members, 137 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:100 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:100-321 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:100-321 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:100-321 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:100-321 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:100-321 — These 5 members are variants of one another: a block of 137 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 71 shared lines) · ×1
  • Near-duplicate member family (5 members, 71 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:59 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:59-228 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:59-228 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:59-228 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:59-228 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:59-228 — These 5 members are variants of one another: a block of 71 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 70 shared lines) · ×1
  • Near-duplicate member family (5 members, 70 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:236 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/wins.py:236-316 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/wins.py:236-316 | cowork/skills/agent-cost-report/scripts/acr/wins.py:236-316 | openclaw/skills/agent-cost-report/scripts/acr/wins.py:236-316 | plugin/skills/agent-cost-report/scripts/acr/wins.py:236-316 — These 5 members are variants of one another: a block of 70 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 59 shared lines) · ×1
  • Near-duplicate member family (5 members, 59 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:144 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:144-212 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:144-212 | cowork/skills/agent-cost-report/scripts/acr.py:144-212 | openclaw/skills/agent-cost-report/scripts/acr.py:144-212 | plugin/skills/agent-cost-report/scripts/acr.py:144-212 — These 5 members are variants of one another: a block of 59 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 48 shared lines) · ×1
  • Near-duplicate member family (5 members, 48 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:117 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:117-166 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:117-166 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:117-166 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:117-166 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:117-166 — These 5 members are variants of one another: a block of 48 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 40 shared lines) · ×1
  • Near-duplicate member family (5 members, 40 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:88 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/evidence.py:88-154 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/evidence.py:88-154 | cowork/skills/agent-cost-report/scripts/acr/evidence.py:88-154 | openclaw/skills/agent-cost-report/scripts/acr/evidence.py:88-154 | plugin/skills/agent-cost-report/scripts/acr/evidence.py:88-154 — These 5 members are variants of one another: a block of 40 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 37 shared lines) · ×1
  • Near-duplicate member family (5 members, 37 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:44 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/transcripts.py:44-82 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/transcripts.py:44-82 | cowork/skills/agent-cost-report/scripts/acr/transcripts.py:44-82 | openclaw/skills/agent-cost-report/scripts/acr/transcripts.py:44-82 | plugin/skills/agent-cost-report/scripts/acr/transcripts.py:44-82 — These 5 members are variants of one another: a block of 37 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 29 shared lines) · ×1
  • Near-duplicate member family (5 members, 29 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:232 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rollup.py:232-283 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rollup.py:232-283 | cowork/skills/agent-cost-report/scripts/acr/rollup.py:232-283 | openclaw/skills/agent-cost-report/scripts/acr/rollup.py:232-283 | plugin/skills/agent-cost-report/scripts/acr/rollup.py:232-283 — These 5 members are variants of one another: a block of 29 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 24 shared lines) · ×1
  • Near-duplicate member family (5 members, 24 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:44 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:44-73 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:44-73 | cowork/skills/agent-cost-report/scripts/acr.py:44-73 | openclaw/skills/agent-cost-report/scripts/acr.py:44-73 | plugin/skills/agent-cost-report/scripts/acr.py:44-73 — These 5 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 23 shared lines) · ×1
  • Near-duplicate member family (5 members, 23 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:306 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:306-338 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:306-338 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:306-338 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:306-338 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:306-338 — These 5 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 18 shared lines) · ×1
  • Near-duplicate member family (5 members, 18 shared lines) claude-mem-cursor/skills/agent-cost-report/scripts/acr/rules.py:57 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/rules.py:57-78 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/rules.py:57-78 | cowork/skills/agent-cost-report/scripts/acr/rules.py:57-78 | openclaw/skills/agent-cost-report/scripts/acr/rules.py:57-78 | plugin/skills/agent-cost-report/scripts/acr/rules.py:57-78 — These 5 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (24 lines × 5) · ×1
  • Duplicated block (24 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:100 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:100-123 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py:100-123 | cowork/skills/agent-cost-report/scripts/acr/mistakes.py:100-123 | openclaw/skills/agent-cost-report/scripts/acr/mistakes.py:100-123 | plugin/skills/agent-cost-report/scripts/acr/mistakes.py:100-123 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/mistakes.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/mistakes.py:100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 5) · ×1
  • Duplicated block (22 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/snapshot.py:27 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/snapshot.py:27-48 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/snapshot.py:27-48 | cowork/skills/agent-cost-report/scripts/acr/snapshot.py:27-48 | openclaw/skills/agent-cost-report/scripts/acr/snapshot.py:27-48 | plugin/skills/agent-cost-report/scripts/acr/snapshot.py:27-48 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/snapshot.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/snapshot.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (20 lines × 5) · ×1
  • Duplicated block (20 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:144 — claude-mem-cursor/skills/agent-cost-report/scripts/acr.py:144-163 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py:144-163 | cowork/skills/agent-cost-report/scripts/acr.py:144-163 | openclaw/skills/agent-cost-report/scripts/acr.py:144-163 | plugin/skills/agent-cost-report/scripts/acr.py:144-163 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) scripts/openrouter-price-history/build-dataset.py:183 — scripts/openrouter-price-history/build-dataset.py:183-198 | scripts/openrouter-price-history/build-dataset.py:204-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/openrouter-price-history/build-dataset.py:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17 lines × 5) · ×1
  • Duplicated block (17 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:122 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:122-138 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py:122-138 | cowork/skills/agent-cost-report/scripts/acr/behavior.py:122-138 | openclaw/skills/agent-cost-report/scripts/acr/behavior.py:122-138 | plugin/skills/agent-cost-report/scripts/acr/behavior.py:122-138 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/behavior.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/behavior.py:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:42 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py:42-57 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py:42-57 | cowork/skills/agent-cost-report/scripts/acr/labels.py:42-57 | openclaw/skills/agent-cost-report/scripts/acr/labels.py:42-57 | plugin/skills/agent-cost-report/scripts/acr/labels.py:42-57 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/labels.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/labels.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23 lines × 5) · ×1
  • Duplicated block (23 lines × 5) claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:158 — claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:158-180 | claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:158-180 | cowork/skills/agent-cost-report/scripts/acr/patterns.py:158-180 | openclaw/skills/agent-cost-report/scripts/acr/patterns.py:158-180 | plugin/skills/agent-cost-report/scripts/acr/patterns.py:158-180 — before extracting anything, compare `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py` and `claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
P5 · DR & Backup · No DR/backup evidence · ×1
  • No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
R10 · Code Duplication · Duplication concentrated across 10 sibling directories (64 clone groups) · ×1
  • Duplication concentrated across 10 sibling directories (64 clone groups) services/sync-api/src/canonical-content.ts:1 — 64 duplicated blocks under the repository root have copies in at least two of the sibling directories cowork, install, ods, openclaw, plugin, ragtime (+4 more sibling(s) not listed) — 55 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 64 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 64 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 64 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 11 sibling directories (33 clone groups) · ×1
  • Duplication concentrated across 11 sibling directories (33 clone groups) src/server/generation/providers/GeminiObservationProvider.ts:48 — 33 duplicated blocks under src/ have copies in at least two of the sibling directories cli, integrations, launcher, npx-cli, server, services (+5 more sibling(s) not listed) — 21 of them are reported below, and 12 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 33 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 33 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 33 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 13 sibling directories (22 clone groups) · ×1
  • Duplication concentrated across 13 sibling directories (22 clone groups) REDACTED:48 — 22 duplicated blocks under src/services/ have copies in at least two of the sibling directories agent-runner, context, domain, infrastructure, integrations, memory (+7 more sibling(s) not listed) — 11 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 22 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 22 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 22 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Wholesale file copy (309 identical lines × 2 files) · ×1
  • Wholesale file copy (309 identical lines × 2 files) services/sync-api/src/canonical-content.ts:1 — services/sync-api/src/canonical-content.ts:1 · workers/sync-hub/src/canonical-content.ts:1 — these 2 files are line-for-line copies of one another — 309 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block with local edits (169 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (169 matched lines × 2 locations) services/sync-api/src/auth.ts:23 — services/sync-api/src/auth.ts:23 · workers/sync-hub/src/index.ts:168 — the two spans are one implementation copied and then locally edited — 1173 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (162 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (162 matched lines × 2 locations) scripts/sync-matrix-e2e-supabase.ts:445 — scripts/sync-matrix-e2e-supabase.ts:445 · REDACTED:489 — the two spans are one implementation copied and then locally edited — 1621 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (111 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (111 matched lines × 2 locations) src/ui/my-work/src/components/ui/dialog.tsx:10 — src/ui/my-work/src/components/ui/dialog.tsx:10 · src/ui/my-work/src/components/ui/sheet.tsx:8 — the two spans are one implementation copied and then locally edited — 473 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (108 lines × 2 locations) · ×1
  • Duplicated block (108 lines × 2 locations) services/sync-api/src/projection.ts:183 — services/sync-api/src/projection.ts:183 · workers/sync-hub/src/index.ts:839 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (101 lines × 3 locations) · ×1
  • Duplicated block (101 lines × 3 locations) services/sync-api/src/canonical-content.ts:282 — services/sync-api/src/canonical-content.ts:282 · src/services/sync/CanonicalContent.ts:345 · workers/sync-hub/src/canonical-content.ts:282 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block with local edits (92 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (92 matched lines × 2 locations) src/server/compat/SessionsObservationsAdapter.ts:41 — src/server/compat/SessionsObservationsAdapter.ts:41 · src/server/compat/SessionsSummarizeAdapter.ts:27 — the two spans are one implementation copied and then locally edited — 611 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (69 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (69 matched lines × 2 locations) src/services/context/formatters/AgentFormatter.ts:14 — src/services/context/formatters/AgentFormatter.ts:14 · src/services/context/formatters/HumanFormatter.ts:14 — the two spans are one implementation copied and then locally edited — 445 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (66 lines × 2 locations) · ×1
  • Duplicated block (66 lines × 2 locations) services/sync-api/src/store.ts:96 — services/sync-api/src/store.ts:96 · workers/sync-hub/src/do/SyncHub.ts:85 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (54 lines × 2 locations) · ×1
  • Duplicated block (54 lines × 2 locations) services/sync-api/src/projection.ts:38 — services/sync-api/src/projection.ts:38 · workers/sync-hub/src/index.ts:677 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (52 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (52 matched lines × 2 locations) src/server/generation/providers/GeminiObservationProvider.ts:174 — src/server/generation/providers/GeminiObservationProvider.ts:174 · src/server/generation/providers/OpenRouterObservationProvider.ts:68 — the two spans are one implementation copied and then locally edited — 288 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (51 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (51 matched lines × 2 locations) src/services/integrations/CcsAlignMiddleCache.ts:99 — src/services/integrations/CcsAlignMiddleCache.ts:99 · src/services/integrations/GrokBotAwarenessPusher.ts:33 — the two spans are one implementation copied and then locally edited — 364 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (48 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (48 matched lines × 2 locations) src/services/worker/ClaudeProvider.ts:1253 — src/services/worker/ClaudeProvider.ts:1253 · src/services/worker/OpenAICompatibleProvider.ts:524 — the two spans are one implementation copied and then locally edited — 302 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (47 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (47 matched lines × 2 locations) scripts/check-hook-io-discipline.cjs:35 — scripts/check-hook-io-discipline.cjs:35 · scripts/check-spawn-env-discipline.cjs:31 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (47 lines × 2 locations) · ×1
  • Duplicated block (47 lines × 2 locations) src/server/generation/providers/GeminiObservationProvider.ts:48 — src/server/generation/providers/GeminiObservationProvider.ts:48 · src/services/worker/GeminiProvider.ts:198 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (43 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (43 matched lines × 2 locations) src/storage/postgres/projects.ts:8 — src/storage/postgres/projects.ts:8 · src/storage/postgres/teams.ts:26 — the two spans are one implementation copied and then locally edited — 239 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (41 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (41 matched lines × 2 locations) REDACTED:7 — REDACTED:7 · plugin/skills/mode-creator/scripts/install-mode.mjs:54 — the two spans are one implementation copied and then locally edited — 363 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (39 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (39 matched lines × 2 locations) src/server/services/IngestEventsService.ts:92 — src/server/services/IngestEventsService.ts:92 · src/server/services/IngestEventsService.ts:159 — the two spans are one implementation copied and then locally edited — 242 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (36 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (36 matched lines × 2 locations) src/services/sqlite/tool-uses.ts:353 — src/services/sqlite/tool-uses.ts:353 · src/services/sqlite/tool-uses.ts:405 — the two spans are one implementation copied and then locally edited — 236 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (36 lines × 2 locations) · ×1
  • Duplicated block (36 lines × 2 locations) src/services/sync/ChromaSync.ts:987 — src/services/sync/ChromaSync.ts:987 · src/services/sync/ChromaSync.ts:1054 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (35 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (35 matched lines × 2 locations) src/services/integrations/CursorHooksInstaller.ts:345 — src/services/integrations/CursorHooksInstaller.ts:345 · REDACTED:237 — the two spans are one implementation copied and then locally edited — 204 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (33 lines × 2 locations) · ×1
  • Duplicated block (33 lines × 2 locations) services/sync-api/src/projection.ts:297 — services/sync-api/src/projection.ts:297 · workers/sync-hub/src/index.ts:959 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (32 lines × 2 locations) · ×1
  • Duplicated block (32 lines × 2 locations) scripts/regenerate-claude-md.ts:203 — scripts/regenerate-claude-md.ts:203 · src/cli/claude-md-commands.ts:281 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (32 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (32 matched lines × 2 locations) src/ui/viewer/components/ContextSettingsModal.tsx:314 — src/ui/viewer/components/ContextSettingsModal.tsx:314 · src/ui/viewer/components/ContextSettingsModal.tsx:694 — the two spans are one implementation copied and then locally edited — 143 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (30 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (30 matched lines × 2 locations) src/ui/viewer/components/ContextSettingsModal.tsx:378 — src/ui/viewer/components/ContextSettingsModal.tsx:378 · src/ui/viewer/components/ContextSettingsModal.tsx:623 — the two spans are one implementation copied and then locally edited — 194 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) src/ui/my-work/src/components/ui/carousel.tsx:174 — src/ui/my-work/src/components/ui/carousel.tsx:174 · src/ui/my-work/src/components/ui/carousel.tsx:204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (28 lines × 2 locations) · ×1
  • Duplicated block (28 lines × 2 locations) REDACTED:156 — REDACTED:156 · workers/sync-hub/src/index.ts:437 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (27 lines × 2 locations) · ×1
  • Duplicated block (27 lines × 2 locations) src/ui/viewer/components/LogsModal.tsx:444 — src/ui/viewer/components/LogsModal.tsx:444 · src/ui/viewer/components/LogsModal.tsx:471 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R11 · Import Boundaries · Boundary violation [package · ×1
  • Boundary violation [package:test-suite-dependency] src/ui/my-work/scripts/coverage.mjs:6 — src/ui/my-work/scripts/coverage.mjs:6 imports src/ui/my-work/src/spec/requirements.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
R2 · Cyclomatic Complexity · Complex function buildHumanRequests (cyclomatic 114, cognitive 160) · ×1
  • Complex function buildHumanRequests (cyclomatic 114, cognitive 160) src/services/work-view/request-projection.mjs:97 — buildHumanRequests has cyclomatic complexity 114 and cognitive complexity 160; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function startSession (cyclomatic 109, cognitive 212) · ×1
  • Complex function startSession (cyclomatic 109, cognitive 212) src/services/worker/ClaudeProvider.ts:372 — startSession has cyclomatic complexity 109 and cognitive complexity 212; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildSymbols (cyclomatic 108, cognitive 216) · ×1
  • Complex function buildSymbols (cyclomatic 108, cognitive 216) REDACTED:703 — buildSymbols has cyclomatic complexity 108 and cognitive complexity 216; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 95, cognitive 122) · ×1
  • Complex function main (cyclomatic 95, cognitive 122) REDACTED:1475 — main has cyclomatic complexity 95 and cognitive complexity 122; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function runInstallCommandInner (cyclomatic 93, cognitive 140) · ×1
  • Complex function runInstallCommandInner (cyclomatic 93, cognitive 140) REDACTED:2653 — runInstallCommandInner has cyclomatic complexity 93 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateSettings (cyclomatic 80, cognitive 95) · ×1
  • Complex function validateSettings (cyclomatic 80, cognitive 95) REDACTED:354 — validateSettings has cyclomatic complexity 80 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function execute (cyclomatic 70, cognitive 73) · ×1
  • Complex function execute (cyclomatic 70, cognitive 73) src/cli/handlers/context.ts:163 — execute has cyclomatic complexity 70 and cognitive complexity 73; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function search (cyclomatic 69, cognitive 135) · ×1
  • Complex function search (cyclomatic 69, cognitive 135) src/services/worker/SearchManager.ts:442 — search has cyclomatic complexity 69 and cognitive complexity 135; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildAgentView (cyclomatic 67, cognitive 97) · ×1
  • Complex function buildAgentView (cyclomatic 67, cognitive 97) src/services/work-view/agent-view.mjs:158 — buildAgentView has cyclomatic complexity 67 and cognitive complexity 97; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processAgentResponse (cyclomatic 65, cognitive 100) · ×1
  • Complex function processAgentResponse (cyclomatic 65, cognitive 100) src/services/worker/agents/ResponseProcessor.ts:419 — processAgentResponse has cyclomatic complexity 65 and cognitive complexity 100; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 60, cognitive 69) · ×1
  • Complex function (anonymous) (cyclomatic 60, cognitive 69) REDACTED:769 — (anonymous) has cyclomatic complexity 60 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function classifyOpenRouterError (cyclomatic 58, cognitive 63) · ×1
  • Complex function classifyOpenRouterError (cyclomatic 58, cognitive 63) src/services/worker/OpenRouterProvider.ts:166 — classifyOpenRouterError has cyclomatic complexity 58 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function computeSessionCompressedRollup (cyclomatic 55, cognitive 80) · ×1
  • Complex function computeSessionCompressedRollup (cyclomatic 55, cognitive 80) src/services/telemetry/buffer.ts:135 — computeSessionCompressedRollup has cyclomatic complexity 55 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ingestObservation (cyclomatic 54, cognitive 66) · ×1
  • Complex function ingestObservation (cyclomatic 54, cognitive 66) REDACTED:149 — ingestObservation has cyclomatic complexity 54 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 53, cognitive 28) · ×1
  • Complex function main (cyclomatic 53, cognitive 28) src/npx-cli/index.ts:144 — main has cyclomatic complexity 53 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function toRequest (cyclomatic 49, cognitive 47) · ×1
  • Complex function toRequest (cyclomatic 49, cognitive 47) src/ui/my-work/src/live/to-work-model.ts:137 — toRequest has cyclomatic complexity 49 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function resolveOpenRouterConfig (cyclomatic 49, cognitive 40) · ×1
  • Complex function resolveOpenRouterConfig (cyclomatic 49, cognitive 40) src/services/worker/OpenRouterProvider.ts:694 — resolveOpenRouterConfig has cyclomatic complexity 49 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ContextSettingsModal (cyclomatic 48, cognitive 47) · ×1
  • Complex function ContextSettingsModal (cyclomatic 48, cognitive 47) src/ui/viewer/components/ContextSettingsModal.tsx:144 — ContextSettingsModal has cyclomatic complexity 48 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ensureWorkerRunning (cyclomatic 47, cognitive 89) · ×1
  • Complex function ensureWorkerRunning (cyclomatic 47, cognitive 89) REDACTED:1242 — ensureWorkerRunning has cyclomatic complexity 47 and cognitive complexity 89; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function run (cyclomatic 47, cognitive 59) · ×1
  • Complex function run (cyclomatic 47, cognitive 59) src/cli/handlers/session-init.ts:140 — run has cyclomatic complexity 47 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · src/services/sqlite/SessionStore.ts · ×1
  • src/services/sqlite/SessionStore.ts: 4339 lines of code src/services/sqlite/SessionStore.ts:1 — src/services/sqlite/SessionStore.ts has 4339 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 3059 lines of code REDACTED:1 — REDACTED has 3059 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/server/routes/v1/ServerV1PostgresRoutes.ts · ×1
  • src/server/routes/v1/ServerV1PostgresRoutes.ts: 2244 lines of code src/server/routes/v1/ServerV1PostgresRoutes.ts:1 — src/server/routes/v1/ServerV1PostgresRoutes.ts has 2244 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2170 lines of code REDACTED:1 — REDACTED has 2170 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2112 lines of code REDACTED:1 — REDACTED has 2112 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/sync/CloudSync.ts · ×1
  • src/services/sync/CloudSync.ts: 2095 lines of code src/services/sync/CloudSync.ts:1 — src/services/sync/CloudSync.ts has 2095 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/sync/ChromaSync.ts · ×1
  • src/services/sync/ChromaSync.ts: 2070 lines of code src/services/sync/ChromaSync.ts:1 — src/services/sync/ChromaSync.ts has 2070 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1932 lines of code REDACTED:1 — REDACTED has 1932 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/sync/SyncApply.ts · ×1
  • src/services/sync/SyncApply.ts: 1549 lines of code src/services/sync/SyncApply.ts:1 — src/services/sync/SyncApply.ts has 1549 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1481 lines of code REDACTED:1 — REDACTED has 1481 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/ClaudeProvider.ts · ×1
  • src/services/worker/ClaudeProvider.ts: 1356 lines of code src/services/worker/ClaudeProvider.ts:1 — src/services/worker/ClaudeProvider.ts has 1356 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/servers/mcp-server.ts · ×1
  • src/servers/mcp-server.ts: 1317 lines of code src/servers/mcp-server.ts:1 — src/servers/mcp-server.ts has 1317 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1274 lines of code REDACTED:1 — REDACTED has 1274 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/sync/SyncClient.ts · ×1
  • src/services/sync/SyncClient.ts: 1251 lines of code src/services/sync/SyncClient.ts:1 — src/services/sync/SyncClient.ts has 1251 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · workers/sync-hub/src/index.ts · ×1
  • workers/sync-hub/src/index.ts: 1146 lines of code workers/sync-hub/src/index.ts:1 — workers/sync-hub/src/index.ts has 1146 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/agents/ResponseProcessor.ts · ×1
  • src/services/worker/agents/ResponseProcessor.ts: 1131 lines of code src/services/worker/agents/ResponseProcessor.ts:1 — src/services/worker/agents/ResponseProcessor.ts has 1131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/SearchManager.ts · ×1
  • src/services/worker/SearchManager.ts: 1130 lines of code src/services/worker/SearchManager.ts:1 — src/services/worker/SearchManager.ts has 1130 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/OpenRouterProvider.ts · ×1
  • src/services/worker/OpenRouterProvider.ts: 1117 lines of code src/services/worker/OpenRouterProvider.ts:1 — src/services/worker/OpenRouterProvider.ts has 1117 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/sqlite/SessionSearch.ts · ×1
  • src/services/sqlite/SessionSearch.ts: 1092 lines of code src/services/sqlite/SessionSearch.ts:1 — src/services/sqlite/SessionSearch.ts has 1092 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/transcripts/watcher.ts · ×1
  • src/services/transcripts/watcher.ts: 1085 lines of code src/services/transcripts/watcher.ts:1 — src/services/transcripts/watcher.ts has 1085 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1065 lines of code REDACTED:1 — REDACTED has 1065 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1047 lines of code REDACTED:1 — REDACTED has 1047 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 993 lines of code REDACTED:1 — REDACTED has 993 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/CodexAppServerClient.ts · ×1
  • src/services/worker/CodexAppServerClient.ts: 955 lines of code src/services/worker/CodexAppServerClient.ts:1 — src/services/worker/CodexAppServerClient.ts has 955 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/supervisor/process-registry.ts · ×1
  • src/supervisor/process-registry.ts: 951 lines of code src/supervisor/process-registry.ts:1 — src/supervisor/process-registry.ts has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · services/sync-api/src/store.ts · ×1
  • services/sync-api/src/store.ts: 923 lines of code services/sync-api/src/store.ts:1 — services/sync-api/src/store.ts has 923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 903 lines of code REDACTED:1 — REDACTED has 903 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · workers/sync-hub/src/do/SyncHub.ts · ×1
  • workers/sync-hub/src/do/SyncHub.ts: 901 lines of code workers/sync-hub/src/do/SyncHub.ts:1 — workers/sync-hub/src/do/SyncHub.ts has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 881 lines of code REDACTED:1 — REDACTED has 881 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · evals/read-gate/fixture-large/src/shipping/carrier-tariffs.ts · ×1
  • evals/read-gate/fixture-large/src/shipping/carrier-tariffs.ts: 878 lines of code evals/read-gate/fixture-large/src/shipping/carrier-tariffs.ts:1 — evals/read-gate/fixture-large/src/shipping/carrier-tariffs.ts has 878 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/SettingsDefaultsManager.ts · ×1
  • src/shared/SettingsDefaultsManager.ts: 873 lines of code src/shared/SettingsDefaultsManager.ts:1 — src/shared/SettingsDefaultsManager.ts has 873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/SessionManager.ts · ×1
  • src/services/worker/SessionManager.ts: 836 lines of code src/services/worker/SessionManager.ts:1 — src/services/worker/SessionManager.ts has 836 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/infrastructure/WorktreeAdoption.ts · ×1
  • src/services/infrastructure/WorktreeAdoption.ts: 798 lines of code src/services/infrastructure/WorktreeAdoption.ts:1 — src/services/infrastructure/WorktreeAdoption.ts has 798 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/npx-cli/commands/teambrain.ts · ×1
  • src/npx-cli/commands/teambrain.ts: 784 lines of code src/npx-cli/commands/teambrain.ts:1 — src/npx-cli/commands/teambrain.ts has 784 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/observer-health.ts · ×1
  • src/shared/observer-health.ts: 765 lines of code src/shared/observer-health.ts:1 — src/shared/observer-health.ts has 765 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/ui/my-work/src/pages/my-rules.tsx · ×1
  • src/ui/my-work/src/pages/my-rules.tsx: 752 lines of code src/ui/my-work/src/pages/my-rules.tsx:1 — src/ui/my-work/src/pages/my-rules.tsx has 752 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/OpenAICompatibleProvider.ts · ×1
  • src/services/worker/OpenAICompatibleProvider.ts: 748 lines of code src/services/worker/OpenAICompatibleProvider.ts:1 — src/services/worker/OpenAICompatibleProvider.ts has 748 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/services/worker/OpenAICompatProvider.ts · ×1
  • src/services/worker/OpenAICompatProvider.ts: 740 lines of code src/services/worker/OpenAICompatProvider.ts:1 — src/services/worker/OpenAICompatProvider.ts has 740 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/launcher/install-launcher.ts · ×1
  • src/launcher/install-launcher.ts: 734 lines of code src/launcher/install-launcher.ts:1 — src/launcher/install-launcher.ts has 734 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/storage/postgres/observations.ts · ×1
  • src/storage/postgres/observations.ts: 731 lines of code src/storage/postgres/observations.ts:1 — src/storage/postgres/observations.ts has 731 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~458 LoC) · ×1
  • Dead file (~458 LoC) src/ui/my-work/src/components/ai-elements/commit.tsx — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~266 LoC) · ×1
  • Dead file (~266 LoC) src/ui/my-work/src/components/ui/dropdown-menu.tsx — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~196 LoC) · ×1
  • Dead file (~196 LoC) src/ui/my-work/src/components/ui/item.tsx — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~109 LoC) · ×1
  • Dead file (~109 LoC) src/ui/my-work/src/components/ui/avatar.tsx — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/ui/my-work/src/components/ai-elements/commit.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~77 LoC) · ×1
  • Dead file (~77 LoC) src/ui/my-work/src/components/ai-elements/sources.tsx — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~71 LoC) · ×1
  • Dead file (~71 LoC) src/ui/my-work/src/components/ai-elements/checkpoint.tsx — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~43 LoC) · ×1
  • Dead file (~43 LoC) ods/service/gateway.mjs — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~41 LoC) · ×1
  • Dead file (~41 LoC) scripts/vendor-dsh-sdk.js — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~25 LoC) · ×1
  • Dead file (~25 LoC) src/ui/my-work/src/components/ui/separator.tsx — no import path from any entry point (111 application, 58 tooling, 1107 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (src/ui/my-work/src/components/ai-elements/checkpoint.tsx, src/ui/my-work/src/components/ui/item.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R8 · Dependency Hygiene · Unused dependency '@derekstride/tree-sitter-sql' · ×1
  • Unused dependency '@derekstride/tree-sitter-sql' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@tree-sitter-grammars/tree-sitter-lua' · ×1
  • Unused dependency '@tree-sitter-grammars/tree-sitter-lua' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@tree-sitter-grammars/tree-sitter-markdown' · ×1
  • Unused dependency '@tree-sitter-grammars/tree-sitter-markdown' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm src/services/telemetry/backfill.ts:80 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
S1 · Web-Security Posture · Password key derivation is priced too cheaply · ×1
  • Password key derivation is priced too cheaply src/server/auth/sqlite-api-key-service.ts:69 — This code fixes scrypt at N=16,384 (r=8, p=1). A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Minor — 256 finding(s)
M4 · Documentation accuracy · README/code drift · ×40
  • README/code drift cursor-hooks/README.md:122 — cursor-hooks/README.md names `session-init.sh`, but no file or folder `session-init.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift cursor-hooks/README.md:123 — cursor-hooks/README.md names `context-inject.sh`, but no file or folder `context-inject.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift cursor-hooks/README.md:140 — cursor-hooks/README.md names `session-summary.sh`, but no file or folder `session-summary.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift cursor-hooks/README.md:236 — cursor-hooks/README.md names `common.sh`, but no file or folder `common.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/SESSION_ID_ARCHITECTURE.md:248 — docs/SESSION_ID_ARCHITECTURE.md names `src/services/worker/SDKAgent.ts`, but no file or folder `src/services/worker/SDKAgent.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/SESSION_ID_ARCHITECTURE.md:251 — docs/SESSION_ID_ARCHITECTURE.md names `tests/session_id_refactor.test.ts`, but no file or folder `tests/session_id_refactor.test.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift ods/README.md:8 — ods/README.md names `ods/current`, but no file or folder `ods/current` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/context/agent-sdk-v2-preview.md:8 — docs/context/agent-sdk-v2-preview.md links to `/docs/en/agent-sdk/typescript`, but `docs/en/agent-sdk/typescript` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/context/cursor-hooks-reference.md:237 — docs/context/cursor-hooks-reference.md links to `/blog/hooks-partners`, but `blog/hooks-partners` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.ar.md:390 — docs/i18n/README.ar.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.ar.md:390 — docs/i18n/README.ar.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.ar.md:391 — docs/i18n/README.ar.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.ar.md:393 — docs/i18n/README.ar.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.ar.md:399 — docs/i18n/README.ar.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.bn.md:389 — docs/i18n/README.bn.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.bn.md:390 — docs/i18n/README.bn.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.bn.md:391 — docs/i18n/README.bn.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.bn.md:393 — docs/i18n/README.bn.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.bn.md:399 — docs/i18n/README.bn.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.cs.md:389 — docs/i18n/README.cs.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.cs.md:389 — docs/i18n/README.cs.md links to `docs/license.md`, but `docs/i18n/docs/license.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.cs.md:390 — docs/i18n/README.cs.md links to `docs/ip-boundary.md`, but `docs/i18n/docs/ip-boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.cs.md:393 — docs/i18n/README.cs.md links to `ragtime/LICENSE`, but `docs/i18n/ragtime/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.cs.md:399 — docs/i18n/README.cs.md links to `docs/`, but `docs/i18n/docs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/i18n/README.da.md:389 — docs/i18n/README.da.md links to `LICENSE`, but `docs/i18n/LICENSE` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • + 15 more in this group — see findings.md.
P2 · Observability · Console output used as the logging channel · ×39
  • Console output used as the logging channel src/integrations/opencode-plugin/v2.ts:188 — `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 188 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/integrations/opencode-plugin/v2.ts:238 — `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 238 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/integrations/opencode-plugin/v2.ts:246 — `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 246 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/integrations/opencode-plugin/v2.ts:381 — `src/integrations/opencode-plugin/v2.ts` reports through `console.*` at line 381 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/integrations/opencode-plugin/v1.ts:73 — `src/integrations/opencode-plugin/v1.ts` reports through `console.*` at line 73 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel REDACTED:113 — `REDACTED` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel REDACTED:118 — `REDACTED` reports through `console.*` at line 118 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel REDACTED:144 — `REDACTED` reports through `console.*` at line 144 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel REDACTED:150 — `REDACTED` reports through `console.*` at line 150 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel REDACTED:268 — `REDACTED` reports through `console.*` at line 268 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/banner.ts:38 — `src/npx-cli/banner.ts` reports through `console.*` at line 38 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:43 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 43 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:57 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 57 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:113 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:121 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 121 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:123 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 123 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:178 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 178 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:187 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 187 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:198 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 198 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:206 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 206 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:216 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 216 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:228 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 228 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:292 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 292 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/uninstall.ts:470 — `src/npx-cli/commands/uninstall.ts` reports through `console.*` at line 470 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/npx-cli/commands/telemetry.ts:120 — `src/npx-cli/commands/telemetry.ts` reports through `console.*` at line 120 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • + 14 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×34
  • Silent fallback default in catch cowork/scripts/cmem-hook.mjs:91 — `readStdin` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch cowork/scripts/cmem-hook.mjs:319 — `viewerPort` swallows every exception into `return 37700` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:73 — `readClaudeMemSettings` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:456 — `parseStringArray` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch plugin/scripts/version-check.js:172 — `findMissingDependencies` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:317 — `gitWorktrees` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:352 — `ghPRs` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:71 — `getClaudememVersion` swallows every exception into `return "unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:80 — `getClaudeCodeVersion` swallows every exception into `return "not installed or not in PATH"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:89 — `getBunVersion` swallows every exception into `return "not installed"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:107 — `getOsVersion` swallows every exception into `return "unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:149 — `readLogLines` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/utils/project-name.ts:161 — `settingsFileMtimeMs` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/services/sqlite/observations/files.ts:25 — `parseIndexedFilePaths` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/shared/spawn.ts:78 — `lookupWindowsCommandCandidates` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/shared/plugin-dependency-closure.ts:44 — `findMissingPluginDependencies` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:584 — `cacheWorkerScriptCandidates` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/services/sync/CloudSync.ts:2034 — `countPendingMutations` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/services/sync/CloudSync.ts:2044 — `countPendingTombstones` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/cli/adapters/codex-file-context.ts:101 — `extractFromBash` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:432 — `createCore.getObservations` swallows every exception into `return 'claude-mem worker is not running. Start it with: npx claude-mem start'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/launcher/claude-mem-launcher.ts:97 — `listCacheVersionRootsDescending` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/launcher/ensure-launcher.ts:139 — `findMissingPluginDependencies` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:138 — `probeChromaDiagnostics` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/npx-cli/utils/prune-cache.ts:93 — `readCacheVersionDirectories` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • + 9 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate plugin/skills/mode-creator/scripts/install-mode.mjs:138 — `!Array.isArray(items) || items.length === 0` appears character-identically in 2 files — plugin/skills/mode-creator/scripts/install-mode.mjs, src/services/domain/mode-validation.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate services/sync-api/src/projection.ts:98 — `!CANONICAL_DECIMAL.test(left) || !CANONICAL_DECIMAL.test(right)` appears character-identically in 2 files — services/sync-api/src/projection.ts, workers/sync-hub/src/index.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate services/sync-api/src/canonical-content.ts:411 — `!Number.isFinite(parsed.valueOf()) || parsed.toISOString() !== value` appears character-identically in 3 files — services/sync-api/src/canonical-content.ts, src/services/sync/CanonicalContent.ts, workers/sync-hub/src/canonical-content.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/storage/postgres/observations.ts:250 — `!Number.isInteger(depth) || depth < 0 || depth > 20` appears character-identically in 2 files — src/storage/postgres/observations.ts, src/storage/sqlite/memory-items.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate services/sync-api/src/projection.ts:55 — `!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs >= PROJECTION_LEASE_MS` appears character-identically in 2 files — services/sync-api/src/projection.ts, workers/sync-hub/src/index.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate services/sync-api/src/canonical-content.ts:79 — `!Number.isSafeInteger(value) && Number.isInteger(value)` appears character-identically in 3 files — services/sync-api/src/canonical-content.ts, src/services/sync/CanonicalContent.ts, workers/sync-hub/src/canonical-content.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/sync-matrix-e2e-supabase.ts:673 — `!body.deleted && compareCanonicalDecimals(body.entity_rev, deleteRev) > 0` appears character-identically in 2 files — scripts/sync-matrix-e2e-supabase.ts, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/grok-bot-session-inject.mjs:338 — `!entry.isDirectory() || !AGENT_ID_RE.test(entry.name)` appears character-identically in 2 files — scripts/grok-bot-session-inject.mjs, src/services/integrations/GrokBotIndexWriter.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate services/sync-api/src/projection.ts:132 — `!env.INTERNAL_PROJECTOR_URL || !env.CMEM_INTERNAL_PROJECTOR_SECRET` appears character-identically in 2 files — services/sync-api/src/projection.ts, workers/sync-hub/src/index.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:39 — `!lifecycle?.explicit || !lifecycle.atEpoch` appears character-identically in 2 files — REDACTED, src/ui/my-work/src/live/to-work-model.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/npx-cli/cmem-memory-credentials.ts:58 — `!parsed || typeof parsed !== 'object' || Array.isArray(parsed)` appears character-identically in 4 files — src/npx-cli/cmem-memory-credentials.ts, src/services/sync/CloudSync.ts, src/services/transcripts/state.ts, src/shared/sync-health.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/server/middleware/auth.ts:50 — `!rawKey && authMode === 'local-dev' && allowLocalDevBypass && isLocalhost(req) && hasLoopbackHostHeader(req) && !hasForwardedClientHeaders(r…` appears character-identically in 2 files — src/server/middleware/auth.ts, src/server/middleware/postgres-auth.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate plugin/scripts/qoder-hook-launcher.cjs:43 — `!relative || relative.startsWith('..') || path.isAbsolute(relative)` appears character-identically in 2 files — plugin/scripts/qoder-hook-launcher.cjs, src/utils/project-name.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/services/integrations/CcsAlignMiddleCache.ts:271 — `!resolved.startsWith(expectedRoot + path.sep) && resolved !== expectedRoot` appears character-identically in 2 files — src/services/integrations/CcsAlignMiddleCache.ts, src/services/integrations/GrokBotAwarenessPusher.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/services/telemetry/skill-id.ts:87 — `!toolInput || typeof toolInput !== 'object'` appears character-identically in 2 files — src/services/telemetry/skill-id.ts, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/advisor-transcript.ts:120 — `!transcriptPath || !existsSync(transcriptPath)` appears character-identically in 2 files — src/shared/advisor-transcript.ts, src/shared/transcript-parser.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:465 — `!upgradeHeader || upgradeHeader !== "websocket"` appears character-identically in 2 files — REDACTED, workers/sync-hub/src/index.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/services/sync/CloudSync.ts:1727 — `!value || typeof value !== 'object' || Array.isArray(value)` appears character-identically in 2 files — src/services/sync/CloudSync.ts, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/server/generation/providers/shared/error-classification.ts:86 — `Number.isFinite(milliseconds) && seconds >= 0` appears character-identically in 2 files — src/server/generation/providers/shared/error-classification.ts, src/services/worker/retry.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:41 — `Number.isFinite(reviewedAt) && reviewedAt >= lifecycle.atEpoch` appears character-identically in 2 files — REDACTED, src/ui/my-work/src/live/to-work-model.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/services/work-view/my-rules.mjs:59 — `Number.isInteger(preference.supportCount) && preference.supportCount > 0` appears character-identically in 2 files — src/services/work-view/my-rules.mjs, src/services/work-view/request-groups.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/sync-matrix-e2e-supabase.ts:654 — `a.apply.getCursor() === finalStatus.head_seq && b.apply.getCursor() === finalStatus.head_seq` appears character-identically in 2 files — scripts/sync-matrix-e2e-supabase.ts, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/sync-matrix-e2e-supabase.ts:472 — `a.apply.getEpoch() === fresh.epoch && b.apply.getEpoch() === fresh.epoch` appears character-identically in 2 files — scripts/sync-matrix-e2e-supabase.ts, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/services/work-view/request-groups.mjs:87 — `a.created_at_epoch - b.created_at_epoch || a.id - b.id` appears character-identically in 4 files — src/services/work-view/request-groups.mjs, src/services/worker/SearchManager.ts, src/services/worker/search/SearchOrchestrator.ts, src/services/worker/search/strategies/ChromaSearchStrategy.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:339 — `action === 'turn-on' || action === 'turn-off'` appears character-identically in 2 files — REDACTED, src/ui/my-work/src/live/sample-source.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×23
  • Hand-rolled JSON/XML parsing via regex claude-mem-cursor/skills/agent-cost-report/scripts/acr/patterns.py:85 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex claude-mem-grok-bot/skills/agent-cost-report/scripts/acr/patterns.py:85 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex cowork/skills/agent-cost-report/scripts/acr/patterns.py:85 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex openclaw/skills/agent-cost-report/scripts/acr/patterns.py:85 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/worker-service.cjs:126 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/worker-service.cjs:302 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/transcript-watcher.cjs:24 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/server-service.cjs:67 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/mcp-server.cjs:29 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/context-read-worker.cjs:24 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/context-read-worker.cjs:283 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/context-generator.cjs:27 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/scripts/context-generator.cjs:101 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/skills/agent-cost-report/scripts/acr/patterns.py:85 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex plugin/sqlite/SessionStore.js:137 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex src/cli/adapters/antigravity-cli.ts:9 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex src/sdk/prompts.ts:508 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:121 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:210 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex src/services/context/ObservationCompiler.ts:309 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:500 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex src/services/worker/agents/ResponseProcessor.ts:416 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:229 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
IC1 · Incompleteness & stubs · Disabled test · ×22
  • Disabled test tests/compat/sessions-observations-adapter.test.ts:30 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/connect-keys.test.ts:29 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/context-recency-mode.test.ts:26 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/data-deletion.test.ts:27 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/generation/generation-attempt-fencing.test.ts:35 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/generation/process-generated-response.test.ts:23 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/generation/provider-observation-generator.test.ts:35 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/generation/reclaim-stale-processing-jobs.test.ts:26 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/generation/scope-enforcement.test.ts:39 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/generation/summary-starved-input.test.ts:92 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/paid-readiness.test.ts:47 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/runtime/jobs-list-and-operator-routes.test.ts:25 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/runtime/memories-generation-key.test.ts:13 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/runtime/server-mcp-http-routes.test.ts:35 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/runtime/server-mcp-routes.test.ts:29 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/runtime/server-session-routes.test.ts:21 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/runtime/server-session-runtime.test.ts:31 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/runtime/team-project-jobs-routes.test.ts:21 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/semantic-context-route.test.ts:29 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/server-service.test.ts:262 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/server/session-start-context-from-store.test.ts:30 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test tests/storage/postgres/postgres-storage.test.ts:90 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×8
  • Diagnostic log message is built whether or not it is wanted src/services/domain/ModeManager.ts:170 — `debug` at line 170 is called with an argument built by `observation_types.map(t => t.id)` (line 171), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted src/services/infrastructure/WorktreeAdoption.ts:153 — `debug` at line 153 is called with an argument built by `args.join(' ')` (line 153), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted src/services/infrastructure/WorktreeAdoption.ts:165 — `debug` at line 165 is called with an argument built by `args.join(' ')` (line 165), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted REDACTED:89 — `debug` at line 89 is called with an argument built by `Array.from(map.keys())` (line 91), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted REDACTED:1436 — `debug` at line 1436 is called with an argument built by `JSON.stringify(toolArguments)` (line 1437), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted src/services/worker/OpenAICompatProvider.ts:645 — `debug` at line 645 is called with an argument built by `history.reduce((sum, m) => sum + m.content.length, 0)` (line 647), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted src/services/worker/ClaudeProvider.ts:676 — `debug` at line 676 is called with an argument built by `content.map((c : any) => String(c?.type))` (line 680), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted src/services/worker/search/SearchOrchestrator.ts:185 — `debug` at line 185 is called with an argument built by `refillCategories.join(',')` (line 186), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×7
  • No app-layer HTTPS enforcement detected ods/service/gateway.mjs:20 — `net(…).listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected ods/service/gateway.mjs:43 — `http(…).listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected REDACTED:225 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected src/servers/mcp-http.ts:432 — `httpServer.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected REDACTED:194 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected REDACTED:295 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected REDACTED:668 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
D31 · IaC & Container Security · Low IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure REDACTED:103 — `load_settings` returns `{}` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure REDACTED:299 — `as_json` returns `{}` when `(UnicodeDecodeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 29 significant file(s) lose their only recent owner: workers/sync-hub/src/index.ts, workers/sync-hub/src/do/SyncHub.ts, REDACTED, src/services/telemetry/backfill.ts, src/services/sync/CanonicalContent.ts, src/shared/kill-process-tree.ts, src/services/telemetry/error-scrub.ts, workers/sync-hub/src/canonical-content.ts (+21 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (34 single-owned of 558 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 558 of the 763 production source files in this repository met that bar). They are anonymized user #2 (3 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: REDACTED, src/core/schemas/memory-item.ts, src/storage/postgres/utils.ts, src/cli/handlers/file-context-dedupe.ts, src/server/middleware/rate-limit.ts.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: contradicts the code docs/anti-pattern-cleanup-plan.md — The anti-pattern list is stale: many adapter files such as SessionStore.ts and BranchManager.ts are not listed, and the detector script references a test that no longer exists. Revalidate the anti-pattern list against the current adapter codebase and update any outdated entries.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 2 of 6 project(s) overshoot their size bounds, lowering Project Cohesion to 4.1/10. The most over is `(repository root)` (155447 LoC, 1505 module-visible types across 94 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
DM9 · Scattered domain decisions · Rule about [device_count, head_seq, op_count, projected_seq] decided in 2 places · ×1
  • Rule about [device_count, head_seq, op_count, projected_seq] decided in 2 places — scripts.sync-matrix-e2e-supabase.HubStatus's [device_count, head_seq, op_count, projected_seq] are judged in scripts.sync-matrix-e2e, scripts.sync-matrix-e2e-supabase — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [head_seq, projected_seq] decided in 2 places · ×1
  • Rule about [head_seq, projected_seq] decided in 2 places — scripts.sync-matrix-e2e-supabase.HubStatus's [head_seq, projected_seq] are judged in scripts.sync-matrix-e2e, scripts.sync-matrix-e2e-supabase — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [CLAUDE_MEM_CLOUD_SYNC_HUB_URL, CLAUDE_MEM_CLOUD_SYNC_TOKEN, CLAUDE_MEM_CLOUD_SYNC_USER_ID] decided in 2 places · ×1
  • Rule about [CLAUDE_MEM_CLOUD_SYNC_HUB_URL, CLAUDE_MEM_CLOUD_SYNC_TOKEN, CLAUDE_MEM_CLOUD_SYNC_USER_ID] decided in 2 places — src.shared.SettingsDefaultsManager.SettingsDefaults's [CLAUDE_MEM_CLOUD_SYNC_HUB_URL, CLAUDE_MEM_CLOUD_SYNC_TOKEN, CLAUDE_MEM_CLOUD_SYNC_USER_ID] are judged in src.npx-cli.commands.teambrain, src.services.worker.DatabaseManager.DatabaseManager — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [attempts, maxAttempts] decided in 2 places · ×1
  • Rule about [attempts, maxAttempts] decided in 2 places — src.storage.postgres.generation-jobs.PostgresObservationGenerationJob's [attempts, maxAttempts] are judged in src.server.generation.processGeneratedResponse, src.storage.postgres.generation-jobs — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 2/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `services/sync-api`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 41409 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
R7 · Dead Code · Unused export 'CONTENT_BODY_MAX_BYTES' · ×1
  • Unused export 'CONTENT_BODY_MAX_BYTES' services/sync-api/src/canonical-content.ts:3 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'decimalAtLeast' · ×1
  • Unused export 'decimalAtLeast' services/sync-api/src/canonical-content.ts:133 — Nothing imports THIS copy of 'decimalAtLeast' — but services/sync-api/src/projection.ts:97 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep services/sync-api/src/projection.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other.
R7 · Dead Code · Unused export 'POLL_PUSH_DRAIN_MAX_PAGES' · ×1
  • Unused export 'POLL_PUSH_DRAIN_MAX_PAGES' services/sync-api/src/projection.ts:18 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'TeamRole' · ×1
  • Unused export 'TeamRole' src/core/schemas/team.ts:41 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'Team' · ×1
  • Unused export 'Team' src/core/schemas/team.ts:42 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'CreateTeam' · ×1
  • Unused export 'CreateTeam' src/core/schemas/team.ts:43 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'TeamMember' · ×1
  • Unused export 'TeamMember' src/core/schemas/team.ts:44 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'CreateTeamMember' · ×1
  • Unused export 'CreateTeamMember' src/core/schemas/team.ts:45 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ServerGenerationJobStatus' · ×1
  • Unused export 'ServerGenerationJobStatus' src/server/jobs/types.ts:11 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'RECALL_MCP_TOOLS' · ×1
  • Unused export 'RECALL_MCP_TOOLS' src/server/mcp/recall-mcp-server.ts:241 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'DisabledBoundaryStatus' · ×1
  • Unused export 'DisabledBoundaryStatus' src/server/runtime/types.ts:7 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'MCP_HTTP_PATH' · ×1
  • Unused export 'MCP_HTTP_PATH' src/servers/mcp-http.ts:39 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'closePostgresPool' · ×1
  • Unused export 'closePostgresPool' src/storage/postgres/pool.ts:57 — Nothing ultimately consumes this binding: its only referrer is the re-export in src/storage/postgres/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/storage/postgres/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'SERVER_STORAGE_SCHEMA_VERSION' · ×1
  • Unused export 'SERVER_STORAGE_SCHEMA_VERSION' src/storage/sqlite/schema.ts:5 — Nothing ultimately consumes this binding: its only referrer is the re-export in src/storage/sqlite/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/storage/sqlite/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'ArtifactClose' · ×1
  • Unused export 'ArtifactClose' src/ui/my-work/src/components/ai-elements/artifact.tsx:44 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ArtifactActions' · ×1
  • Unused export 'ArtifactActions' src/ui/my-work/src/components/ai-elements/artifact.tsx:86 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ArtifactAction' · ×1
  • Unused export 'ArtifactAction' src/ui/my-work/src/components/ai-elements/artifact.tsx:99 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ArtifactContent' · ×1
  • Unused export 'ArtifactContent' src/ui/my-work/src/components/ai-elements/artifact.tsx:143 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationCarousel' · ×1
  • Unused export 'InlineCitationCarousel' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:102 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationCarouselContent' · ×1
  • Unused export 'InlineCitationCarouselContent' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:120 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationCarouselItem' · ×1
  • Unused export 'InlineCitationCarouselItem' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:126 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationCarouselHeader' · ×1
  • Unused export 'InlineCitationCarouselHeader' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:138 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationCarouselIndex' · ×1
  • Unused export 'InlineCitationCarouselIndex' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:153 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationCarouselPrev' · ×1
  • Unused export 'InlineCitationCarouselPrev' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:199 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationCarouselNext' · ×1
  • Unused export 'InlineCitationCarouselNext' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:226 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InlineCitationSource' · ×1
  • Unused export 'InlineCitationSource' src/ui/my-work/src/components/ai-elements/inline-citation.tsx:257 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'QueueMessage' · ×1
  • Unused export 'QueueMessage' src/ui/my-work/src/components/ai-elements/queue.tsx:22 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'QueueTodo' · ×1
  • Unused export 'QueueTodo' src/ui/my-work/src/components/ai-elements/queue.tsx:27 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'QueueItemDescription' · ×1
  • Unused export 'QueueItemDescription' src/ui/my-work/src/components/ai-elements/queue.tsx:92 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'QueueItemActions' · ×1
  • Unused export 'QueueItemActions' src/ui/my-work/src/components/ai-elements/queue.tsx:111 — Nothing imports this binding — it is safe to review for removal.
R8 · Dependency Hygiene · Type-only dependency 'ai' in production deps · ×1
  • Type-only dependency 'ai' in production deps src/ui/my-work/src/components/ai-elements/agent.tsx:10 — Every import is type-only — move it to devDependencies.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 52/67 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 5/7 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~1.3 `!` null assertions per 1k TypeScript source lines — 221 assertion(s) across the 165555 source line(s) of the 645 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (12), REDACTED (12), src/services/sync/SyncApply.ts (11). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand REDACTED:1403 — `trimmed.startsWith("///")` can never decide this `||` — every value satisfying `trimmed.startsWith("///")` also satisfies `trimmed.startsWith("//")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Minor — 56 finding(s)
D10 · Test Quality · Skipped (documented) · ×50
  • Skipped (documented): (unnamed test) services/sync-api/test/ipv6-host-url.test.ts:30 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/setup-runtime.test.ts:373 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/setup-runtime.test.ts:398 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/npm-install-windows-timeout.test.ts:8 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/npm-install-timeout.test.ts:45 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/npm-install-timeout.test.ts:86 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/install-error-matrix.test.ts:263 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/claude-md-git-paths.test.ts:53 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/claude-md-git-paths.test.ts:57 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/claude-md-git-paths.test.ts:61 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/cli/adapters/codex-file-context.test.ts:59 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/evals/read-gate-trace-analysis.test.ts:454 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/hooks/file-context.test.ts:870 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/hooks/file-context.test.ts:964 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/hooks/file-context.test.ts:983 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/infrastructure/process-manager.test.ts:1046 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/infrastructure/hook-shell.test.ts:88 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) tests/infrastructure/hook-early-env-optout.test.ts:73 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) tests/infrastructure/hook-early-env-optout.test.ts:83 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) tests/infrastructure/hook-early-env-optout.test.ts:86 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) tests/integration/t3code-installer.test.ts:152 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/integration/t3code-installer.test.ts:248 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/integration/opencode-installer.test.ts:415 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/integration/harness-installers.test.ts:293 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) tests/integration/harness-installers.test.ts:320 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • + 25 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (npm) · ×6
  • Outdated (npm): ai — ai is pinned at 7.0.147; registry.npmjs.org publishes 7.0.152 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): lucide-react — lucide-react is pinned at 1.60.0; registry.npmjs.org publishes 1.61.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): motion — motion is pinned at 14.4.0; registry.npmjs.org publishes 14.6.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): shell-quote — shell-quote is pinned at 1.9.0; registry.npmjs.org publishes 1.12.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): tree-sitter-cli — tree-sitter-cli is pinned at 0.26.9; registry.npmjs.org publishes 0.27.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): zod — zod is pinned at 4.4.3; registry.npmjs.org publishes 4.6.7 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-aa1c546a25b34ca5967496c6c2bcb9c7/history.json --exit-code 0 --source .0—
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .210artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update15artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .24artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep --config /opt/semgrep-rules/gdpr.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .1artifacts/raw/semgrep-gdpr.json
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a16e86-6c8b-77c3-8105-4b2fd4197071 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md