Public report of K9i-0/ccpocket, published 5 November 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.11.2). Assert 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, 5 November 2026, 22:30 UTC · Survey ID cd_4082b877c0254b0a9075835de7468292

K9i-0/ccpocket

Measured 5 November 2026, 22:29 UTC, at code version 44a255b

CAI score 64out of 100 At risk Up 6 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: 158,240 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 2.3 person-years · Weakest lens: Performance, 60

Findings by how serious they are

33 critical 1037 serious 86 minor

11 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look 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

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
5 November 2026, 22:29 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 the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer 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. We work 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 ▸

92of 92 dimensions measured by tools.
1147of 1156 findings point to an exact file and line, so you can open each one in the code. The other 9 concern the repository as a whole, such as missing documentation.
92dimensions across 8 lenses, read from 158,240 lines of product code in 11 projects.
Chapters

Executive summary

K9i-0/ccpocket is rated At risk because critical security findings are open. It scores 64 out of 100, which the At risk rating leaves unchanged.

Performance, at 60, is the weakest lens and counts most in the score. The best first steps are removing the blocking calls and reducing needless memory use, each worth about 3 points. Raising Performance to 70 would lift the score to about 66.

Thirteen known security holes in the packages the code depends on can be used by attackers. Six secrets can leak from the build pipeline, and two passwords or keys are open to anyone who can read the repository. Updating the vulnerable packages, limiting each secret to its own step and replacing each exposed password or key would close these risks. Passing outside input through environment variables would fix the two pipeline steps that put outside input straight into a shell command, and the two unsafe settings in infrastructure or container files need changing to safe values. The two pages or frames without a title need a descriptive title.

The product code is 158,240 lines, about €330,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.
Performance 60 · counts for 45%Code Health 63 · counts for 25%Accessibility 66 · counts for 14%Production Readiness 67 · counts for 8%Architecture 73 · counts for 4%Security and Compliance 80 · counts for 2%Event-Driven 80 · counts for 1%Maturity 82 · counts for 1%

If Performance rose from 60 to 70, the lowest score rated Strong, the score would rise from 64 to about 66.

Code composition: what the lines of code are
Product code 61%Tests 39%
New since the last survey: 213 findings

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

  • Cyclomatic Complexity · sdk-process.convertSdkMessage (cyclomatic 44) packages/bridge/src/sdk-process.ts
  • Cyclomatic Complexity · SessionManager.rewindInPlace (cyclomatic 32) packages/bridge/src/session.ts
  • Cyclomatic Complexity · SdkProcess.startSdkQuery (cyclomatic 27) packages/bridge/src/sdk-process.ts
  • Cyclomatic Complexity · sessions-index.claudeAbandonedBranchUuids (cyclomatic 24) packages/bridge/src/sessions-index.ts
  • Cyclomatic Complexity · BridgeWebSocketServer.sendCompletionPush (cyclomatic 24) REDACTED
  • Cyclomatic Complexity · recent-session-search.transcriptLineMessageTexts (cyclomatic 22) REDACTED
  • Cyclomatic Complexity · sessions-index.getCodexSessionIndexMetadata (cyclomatic 22) packages/bridge/src/sessions-index.ts
  • Cyclomatic Complexity · skill-triggers.convertSkillTriggers (cyclomatic 22) packages/bridge/src/skill-triggers.ts
  • Cyclomatic Complexity · BridgeWebSocketServer.listRecentSessions (cyclomatic 22) REDACTED
  • Cyclomatic Complexity · BridgeUpdateStatusTile.build (cyclomatic 21) apps/mobile/lib/features/settings/widgets/bridge_update_status_tile.dart
  • Cyclomatic Complexity · GalleryScreen.build (cyclomatic 20) apps/mobile/lib/features/gallery/gallery_screen.dart
  • Cyclomatic Complexity · recent-session-search.searchTranscriptFile (cyclomatic 20) REDACTED
  • Cyclomatic Complexity · recent-session-search.searchRecentSessionContent (cyclomatic 20) REDACTED
  • Cyclomatic Complexity · sessions-index.getPinnedCodexSessions (cyclomatic 20) packages/bridge/src/sessions-index.ts
  • Cyclomatic Complexity · BridgeService._sendRecentSessionsRequest (cyclomatic 19) apps/mobile/lib/services/bridge_service.dart
  • Cyclomatic Complexity · _StripPrimaryAction.build (cyclomatic 19) apps/mobile/lib/widgets/chat_input_bar.dart
  • Cyclomatic Complexity · SdkProcess.updateSettings (cyclomatic 19) packages/bridge/src/sdk-process.ts
  • Cyclomatic Complexity · CodexBackgroundTracker.observe (cyclomatic 19) packages/bridge/src/codex-background-tracker.ts
  • Cyclomatic Complexity · _SessionListScreenState._buildScaffoldBody (cyclomatic 18) apps/mobile/lib/features/session_list/session_list_screen.dart
  • Cyclomatic Complexity · deliver-ios.main (cyclomatic 18) scripts/store-review/apps/deliver-ios.py
  • Cyclomatic Complexity · ChatSessionCubit.setClaudeSettings (cyclomatic 17) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart
  • Cyclomatic Complexity · _CompactWindowRow.build (cyclomatic 17) apps/mobile/lib/features/settings/widgets/usage_section.dart
  • Cyclomatic Complexity · _AskQuestionLayout.build (cyclomatic 17) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart
  • Cyclomatic Complexity · _NewSessionSheetContentState._refreshModelCatalogs (cyclomatic 17) apps/mobile/lib/widgets/new_session_sheet.dart
  • Cyclomatic Complexity · upload-duo-screenshots.main (cyclomatic 17) scripts/store-review/upload-duo-screenshots.py
  • Cyclomatic Complexity · sessions-index.findCodexSessionJsonlPath (cyclomatic 17) packages/bridge/src/sessions-index.ts
  • Cyclomatic Complexity · BridgeWebSocketServer.rewindCodexConversation (cyclomatic 17) REDACTED
  • Cyclomatic Complexity · websocket.buildRecentSessionPredicate.<returned closure> (cyclomatic 17) REDACTED
  • Cyclomatic Complexity · _RecentAdvancedSearchSheetState.build (cyclomatic 16) apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart
  • Cyclomatic Complexity · _CategoryList._summary (cyclomatic 16) apps/mobile/lib/features/settings/widgets/settings_home.dart
  • Cyclomatic Complexity · BridgeService._canSendCodexServiceTier (cyclomatic 16) apps/mobile/lib/services/bridge_service.dart
  • Cyclomatic Complexity · ChatEntryWidget.build (cyclomatic 16) apps/mobile/lib/widgets/message_bubble.dart
  • Cyclomatic Complexity · SdkProcess.updateStatusFromMessage (cyclomatic 16) packages/bridge/src/sdk-process.ts
  • Cyclomatic Complexity · BridgeWebSocketServer.forkClaudeSession (cyclomatic 16) REDACTED
  • Cognitive Complexity · sdk-process.convertSdkMessage (cognitive 78) packages/bridge/src/sdk-process.ts
  • Cognitive Complexity · recent-session-search.searchRecentSessionContent (cognitive 47) REDACTED
  • Cognitive Complexity · SessionManager.rewindInPlace (cognitive 46) packages/bridge/src/session.ts
  • Cognitive Complexity · sessions-index.claudeAbandonedBranchUuids (cognitive 35) packages/bridge/src/sessions-index.ts
  • Cognitive Complexity · pack-delivery.main (cognitive 31) scripts/store-review/apps/pack-delivery.py
  • Cognitive Complexity · recent-session-search.transcriptLineMessageTexts (cognitive 29) REDACTED
  • Cognitive Complexity · skill-triggers.convertSkillTriggers (cognitive 29) packages/bridge/src/skill-triggers.ts
  • Cognitive Complexity · skill-triggers.catalogFromCachedCommands (cognitive 28) packages/bridge/src/skill-triggers.ts
  • Cognitive Complexity · deliver-ios.main (cognitive 27) scripts/store-review/apps/deliver-ios.py
  • Cognitive Complexity · recent-session-search.searchTranscriptFile (cognitive 27) REDACTED
  • Cognitive Complexity · sessions-index.getPinnedCodexSessions (cognitive 26) packages/bridge/src/sessions-index.ts
  • Cognitive Complexity · BridgeWebSocketServer.sendCompletionPush (cognitive 25) REDACTED
  • Cognitive Complexity · _UsageSectionState.build (cognitive 24) apps/mobile/lib/features/settings/widgets/usage_section.dart
  • Cognitive Complexity · codex-service-tier.extractCodexServiceTierMetadata (cognitive 24) packages/bridge/src/codex-service-tier.ts
  • Cognitive Complexity · CodexBackgroundTracker.observe (cognitive 24) packages/bridge/src/codex-background-tracker.ts
  • Cognitive Complexity · BridgeWebSocketServer.listSnapshotOnlyCodexSessions (cognitive 24) REDACTED
  • Cognitive Complexity · SessionFilterBar.build (cognitive 23) apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart
  • Cognitive Complexity · _StripPrimaryAction.build (cognitive 23) apps/mobile/lib/widgets/chat_input_bar.dart
  • Cognitive Complexity · upload-duo-screenshots.main (cognitive 23) scripts/store-review/upload-duo-screenshots.py
  • Cognitive Complexity · _CompactWindowRow.build (cognitive 21) apps/mobile/lib/features/settings/widgets/usage_section.dart
  • Cognitive Complexity · CodexSpeedButton.build (cognitive 21) apps/mobile/lib/widgets/codex_effort_slider.dart
  • Cognitive Complexity · GalleryScreen.build (cognitive 20) apps/mobile/lib/features/gallery/gallery_screen.dart
  • Cognitive Complexity · _SessionListScreenState._buildScaffoldBody (cognitive 20) apps/mobile/lib/features/session_list/session_list_screen.dart
  • Cognitive Complexity · _SessionListScreenState._buildBodyContent (cognitive 20) apps/mobile/lib/features/session_list/session_list_screen.dart
  • Cognitive Complexity · _RecentAdvancedSearchSheetState.build (cognitive 20) apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart
  • Cognitive Complexity · BridgeUpdateStatusTile.build (cognitive 20) apps/mobile/lib/features/settings/widgets/bridge_update_status_tile.dart
  • Cognitive Complexity · _NewSessionSheetContentState._refreshModelCatalogs (cognitive 20) apps/mobile/lib/widgets/new_session_sheet.dart
  • Cognitive Complexity · delivery.extract (cognitive 20) scripts/store-review/apps/delivery.py
  • Cognitive Complexity · websocket.buildRecentSessionPredicate.<returned closure> (cognitive 20) REDACTED
  • Cognitive Complexity · delivery.validate_manifest (cognitive 19) scripts/store-review/apps/delivery.py
  • Cognitive Complexity · sdk-process.backgroundTasksFromSdk (cognitive 19) packages/bridge/src/sdk-process.ts
  • Cognitive Complexity · CodexProcess.rewindBeforeUserTurn (cognitive 19) REDACTED
  • Cognitive Complexity · _RecentProjectPickerSheetState.build (cognitive 18) apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart
  • Cognitive Complexity · BridgeService._sendRecentSessionsRequest (cognitive 18) apps/mobile/lib/services/bridge_service.dart
  • Cognitive Complexity · SdkProcess.updateStatusFromMessage (cognitive 18) packages/bridge/src/sdk-process.ts
  • Cognitive Complexity · BridgeWebSocketServer.listRecentCodexThreads (cognitive 18) REDACTED
  • Cognitive Complexity · _ChatMessageListState._deriveData (cognitive 17) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart
  • Cognitive Complexity · prepare.validate (cognitive 17) scripts/store-review/apps/prepare.py
  • Cognitive Complexity · SessionManager.retractableUserInput (cognitive 17) packages/bridge/src/session.ts
  • Cognitive Complexity · BridgeWebSocketServer.listRecentSessions (cognitive 17) REDACTED
  • Cognitive Complexity · ChatSessionCubit.setClaudeSettings (cognitive 16) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart
  • Cognitive Complexity · _ConnectedStatus.build (cognitive 16) apps/mobile/lib/features/settings/widgets/settings_status_card.dart
  • Cognitive Complexity · SkillTriggerCatalog.fromCompletionItems (cognitive 16) apps/mobile/lib/utils/skill_invocation.dart
  • Cognitive Complexity · _StreamingBubbleState._buildMarkdownBlocks (cognitive 16) apps/mobile/lib/widgets/bubbles/streaming_bubble.dart
  • Cognitive Complexity · ChatEntryWidget.build (cognitive 16) apps/mobile/lib/widgets/message_bubble.dart
  • Cognitive Complexity · SdkProcess.createUserMessageStream (cognitive 16) packages/bridge/src/sdk-process.ts
  • Cognitive Complexity · sessions-index.scanJsonlDir (cognitive 16) packages/bridge/src/sessions-index.ts
  • Cognitive Complexity · BridgeWebSocketServer.rewindCodexConversation (cognitive 16) REDACTED
  • God Classes · MethodTooLong: _RecentAdvancedSearchSheetState.build apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart
  • God Classes · MethodTooLong: _SessionListScreenState._buildScaffoldBody apps/mobile/lib/features/session_list/session_list_screen.dart
  • God Classes · FunctionTooLong: sdk-process.convertSdkMessage packages/bridge/src/sdk-process.ts
  • God Classes · FileTooLong: bubbles/user_bubble.dart apps/mobile/lib/widgets/bubbles/user_bubble.dart
  • God Classes · FileTooLong: widgets/usage_section.dart apps/mobile/lib/features/settings/widgets/usage_section.dart
  • God Classes · MethodTooLong: InputSettingsSection.build apps/mobile/lib/features/settings/sections/input_settings_section.dart
  • God Classes · MethodTooLong: ChatMessageHandler._handleHistory apps/mobile/lib/services/chat_message_handler.dart
  • God Classes · FileTooLong: widgets/recent_session_filter_sheets.dart apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart
  • God Classes · TooManyMethods: SessionListCubit apps/mobile/lib/features/session_list/state/session_list_cubit.dart
  • God Classes · MethodTooLong: _RecentProjectPickerSheetState.build apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart
  • God Classes · MethodTooLong: SdkProcess.processMessages packages/bridge/src/sdk-process.ts
  • God Classes · MethodTooLong: _ConnectedStatus.build apps/mobile/lib/features/settings/widgets/settings_status_card.dart
  • God Classes · MethodTooLong: AgentsSettingsSection.build apps/mobile/lib/features/settings/sections/agents_settings_section.dart
  • God Classes · MethodTooLong: SessionManager.rewindInPlace packages/bridge/src/session.ts
  • God Classes · ClassTooLong: _RunningSessionCardState apps/mobile/lib/widgets/session_card.dart
  • God Classes · MethodTooLong: BrowserHeader.build apps/mobile/lib/features/file_browser/file_browser_view.dart
  • God Classes · TooManyMethods: _AskUserQuestionWidgetState apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart
  • God Classes · MethodTooLong: _SessionListScreenState.initState apps/mobile/lib/features/session_list/session_list_screen.dart

We compare 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: 285 findings

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

  • Cyclomatic Complexity · sdk-process.sdkMessageToServerMessage (cyclomatic 43) packages/bridge/src/sdk-process.ts
  • Cyclomatic Complexity · _SettingsScreenState.build (cyclomatic 40) apps/mobile/lib/features/settings/settings_screen.dart
  • Cyclomatic Complexity · pr-readiness.evaluateIntake (cyclomatic 37) scripts/pr-readiness.mjs
  • Cyclomatic Complexity · pr-readiness.evaluatePullRequest (cyclomatic 37) scripts/pr-readiness.mjs
  • Cyclomatic Complexity · sim-tap.swift.top-level code (cyclomatic 32) .claude/skills/update-store/scripts/sim-tap.swift
  • Cyclomatic Complexity · _BridgeUpdateStatusTile.build (cyclomatic 31) apps/mobile/lib/features/settings/settings_screen.dart
  • Cognitive Complexity · sdk-process.sdkMessageToServerMessage (cognitive 75) packages/bridge/src/sdk-process.ts
  • Cognitive Complexity · _SettingsScreenState.build (cognitive 59) apps/mobile/lib/features/settings/settings_screen.dart
  • Cognitive Complexity · pr-readiness.evaluateIntake (cognitive 45) scripts/pr-readiness.mjs
  • Cognitive Complexity · sim-tap.swift.top-level code (cognitive 44) .claude/skills/update-store/scripts/sim-tap.swift
  • Cognitive Complexity · _BridgeUpdateStatusTile.build (cognitive 30) apps/mobile/lib/features/settings/settings_screen.dart
  • Cognitive Complexity · pr-readiness.evaluatePullRequest (cognitive 29) scripts/pr-readiness.mjs
  • Cognitive Complexity · sim-tap.swift.dismissSpeechDialog (cognitive 20) .claude/skills/update-store/scripts/sim-tap.swift
  • Cognitive Complexity · BridgeWebSocketServer.listWorkspaceFilteredCodexThreads (cognitive 20) REDACTED
  • Cognitive Complexity · sim-tap.swift.dismissDialogs (cognitive 18) .claude/skills/update-store/scripts/sim-tap.swift
  • Cognitive Complexity · codex-process.extractServiceTiers (cognitive 18) REDACTED
  • God Classes · FunctionTooLong: parser.parseClientMessage packages/bridge/src/parser.ts
  • God Classes · MethodTooLong: _SettingsScreenState.build apps/mobile/lib/features/settings/settings_screen.dart
  • God Classes · FileTooLong: settings/settings_screen.dart apps/mobile/lib/features/settings/settings_screen.dart
  • God Classes · ClassTooLong: _SettingsScreenState apps/mobile/lib/features/settings/settings_screen.dart
  • God Classes · FunctionTooLong: pr-readiness.evaluateIntake scripts/pr-readiness.mjs
  • God Classes · FunctionTooLong: sdk-process.sdkMessageToServerMessage packages/bridge/src/sdk-process.ts
  • God Classes · FileTooLong: scripts/pr-readiness.mjs scripts/pr-readiness.mjs
  • God Classes · FileTooLong: scripts/sim-tap.swift .claude/skills/update-store/scripts/sim-tap.swift
  • God Classes · FunctionTooLong: pr-readiness.evaluatePullRequest scripts/pr-readiness.mjs
  • God Classes · FileTooLong: widgets/file_peek_media_controls.dart apps/mobile/lib/features/file_peek/widgets/file_peek_media_controls.dart
  • Code Duplication · Near-duplicate member pair (640 shared lines) apps/mobile/lib/features/claude_session/claude_session_screen.dart
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/mobile/lib/services/store_screenshot_extension.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/menubar/CCPocketMenubar/Views/DoctorPage/DoctorPageView.swift
  • Code Duplication · Duplicated block (164 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart
  • Code Duplication · Duplicated block (41–42 lines × 2) apps/mobile/lib/features/git/git_screen.dart
  • Code Duplication · Duplicated block (39 lines × 2) apps/mobile/lib/services/store_screenshot_extension.dart
  • Code Duplication · Duplicated block (36 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart
  • Code Duplication · Duplicated block (29–30 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart
  • Code Duplication · Duplicated block (30 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart
  • Code Duplication · Duplicated block (17 lines × 2) apps/mobile/lib/services/store_screenshot_extension.dart
  • Code Duplication · Duplicated block (13–15 lines × 2) apps/mobile/lib/features/gallery/gallery_screen.dart
  • Code Duplication · Duplicated block (9 lines × 2) apps/mobile/lib/widgets/codex_environment_summary.dart
  • Code Duplication · Duplicated block (8 lines × 3) apps/mobile/lib/features/git/state/git_status_cubit.dart
  • Code Duplication · Duplicated block (8 lines × 3) apps/mobile/lib/features/git/state/git_status_cubit.dart
  • Churn × Complexity Hotspots · Hotspot: scripts/pr-readiness.mjs scripts/pr-readiness.mjs
  • Churn × Complexity Hotspots · Hotspot: apps/mobile/lib/features/settings/settings_screen.dart apps/mobile/lib/features/settings/settings_screen.dart
  • Churn × Complexity Hotspots · Repeated repair: apps/mobile/lib/widgets/bubbles/plan_card.dart apps/mobile/lib/widgets/bubbles/plan_card.dart
  • Dependency Vulnerabilities · Critical CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Critical CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Critical CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Critical CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] apps/mobile/Gemfile.lock
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] apps/mobile/Gemfile.lock
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High vulnerability: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] apps/mobile/Gemfile.lock
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Change Coupling · Change-coupling hub: REDACTED → messages.dart, bridge_service.dart, parser.ts REDACTED
  • Change Coupling · Change-coupling hub: REDACTED → chat_session_state.dart, bridge_service.dart, mock_bridge_service.dart, message_bubble.dart REDACTED
  • Change Coupling · Change coupling: machine_edit_sheet.dart ↔ machine_manager_service.dart apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart
  • Code Duplication · Duplicated block (50 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (35 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (35 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (30 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (27 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (26 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (25 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (21 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (20 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (19 matched lines × 2 locations) packages/bridge/src/codex-transport.ts
  • Code Duplication · Duplicated block (18 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (18 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (16 lines × 2 locations) packages/bridge/src/parser.ts
  • Code Duplication · Duplicated block (16 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (15 lines × 2 locations) packages/bridge/src/parser.ts
  • Code Duplication · Duplicated block (15 lines × 2 locations) packages/bridge/src/sessions-index.ts
  • Code Duplication · Duplicated block (15 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (14 matched lines × 2 locations) packages/bridge/src/session.ts
  • Code Duplication · Duplicated block (14 lines × 2 locations) packages/bridge/src/sessions-index.ts
  • Code Duplication · Duplicated block (14 lines × 2 locations) packages/bridge/src/sessions-index.ts
  • Code Duplication · Duplicated block (14 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (14 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (14 lines × 2 locations) REDACTED
Rebuild cost: about €330,000 · Estimate
Cost to rebuild€110,000 to €550,000, for 1,813 to 5,751 hours of work, about 2.3 person-years for 1 to 5 engineers
Difficulty of the problemStandard, 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.9 at a score of 64. 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: 158,240 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price 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
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
Raises the score by about 3 points · Medium effort · Async & latency hygiene
2
Raise allocation-aware density on the hot paths — currently 25 use(s) across 128,808 production line(s) (~0.2/1k).
More of the idioms below on the allocation-heavy paths climbs this toward 10.
Raises the score by about 3 points · Medium effort · Allocation hygiene
3
Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with BridgeWebSocketServer.handleClientMessage (cyclomatic 701), parser.parseClientMessage (cyclomatic 555).
Raises the score by about 0.9 points · Medium effort · Cyclomatic Complexity

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.

Where the investment is most exposed · Value at risk
This code would cost about €330,000 to build again, about 2.3 person-years of work. Its weakest lens is Performance, at 60 (Adequate). Performance is about whether the code is written and measured with speed in mind. Because the weakest lens counts most in the score, work on Performance also moves the score most.
Based on: the rebuild estimate · the Performance grade · how much each lens counts
What to do: Start with the Performance actions in Top priorities.
If you do one thing first · First action
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress. Of all the actions in this report, it raises the score most for the work it takes: about 3 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.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 162,314 lines over the last 90 days, which is about 658,273 lines a year. At that pace, the extra work comes to an estimated 93.1 to 558.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 our 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, never less than 2% to 5% and never more than 40% to 60% in all; 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 — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch :app :app @ccpocket/bridge bridge CCPocketMenubar CCPocketMenubar android android ccpocket ccpocket ccpocket-functions ccpocket-functions ccpocket_preview ccpocket_preview ccpocket_preview->ccpocket

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.

85 modules, with 92 dependencies between them. One loop runs through 3 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 45 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 functions.src2 packages.bridge.src.archive-store3 packages.bridge.src.background-completion-gate4 packages.bridge.src.cli-args5 packages.bridge.src.codex-app-server-config6 packages.bridge.src.codex-permissions7 packages.bridge.src.codex-transport8 packages.bridge.src.firebase-auth9 packages.bridge.src.gallery-store10 packages.bridge.src.image-store11 packages.bridge.src.parser12 packages.bridge.src.prompt-history-store13 packages.bridge.src.push-i18n14 packages.bridge.src.recent-session-search15 packages.bridge.src.usage16 packages.bridge.src.workspace-store17 packages.bridge.src.worktree-store18 repository.l10n19 repository.models20 packages.bridge.src.auto-rename21 packages.bridge.src.codex-process22 packages.bridge.src.debug-trace-store23 packages.bridge.src.git-assist24 packages.bridge.src.push-relay25 packages.bridge.src.resume-metrics26 packages.bridge.src.sdk-process27 packages.bridge.src.sessions-index28 repository.mock29 repository.theme30 repository.utils31 packages.bridge.src.session32 repository.services33 packages.bridge.src34 packages.bridge.src.websocket35 repository.providers36 repository.widgets37 repository.features38 repository.router39 repository.screens40 repository
1 functions.src
2 packages.bridge.src.archive-store
3 packages.bridge.src.background-completion-gate
4 packages.bridge.src.cli-args
5 packages.bridge.src.codex-app-server-config
6 packages.bridge.src.codex-permissions
7 packages.bridge.src.codex-transport
8 packages.bridge.src.firebase-auth
9 packages.bridge.src.gallery-store
10 packages.bridge.src.image-store
11 packages.bridge.src.parser
12 packages.bridge.src.prompt-history-store
13 packages.bridge.src.push-i18n
14 packages.bridge.src.recent-session-search
15 packages.bridge.src.usage
16 packages.bridge.src.workspace-store
17 packages.bridge.src.worktree-store
18 repository.l10n
19 repository.models
20 packages.bridge.src.auto-rename1
21 packages.bridge.src.codex-process31
22 packages.bridge.src.debug-trace-store1
23 packages.bridge.src.git-assist1
24 packages.bridge.src.push-relay1
25 packages.bridge.src.resume-metrics1
26 packages.bridge.src.sdk-process4
27 packages.bridge.src.sessions-index1
28 repository.mock1
29 repository.theme1
30 repository.utils2
31 packages.bridge.src.session119112
32 repository.services25625
33 packages.bridge.src1221162142327121142
34 packages.bridge.src.websocket111115111122113
35 repository.providers23
36 repository.widgets779141173
37 repository.features121512020602
38 repository.router1
39 repository.screens17131
40 repository31
Uses a module listed above itPart of a loopThe module itself
1 functions.src2 packages.bridge.src.archive-store3 packages.bridge.src.background-completion-gate4 packages.bridge.src.cli-args5 packages.bridge.src.codex-app-server-config6 packages.bridge.src.codex-permissions7 packages.bridge.src.codex-transport8 packages.bridge.src.firebase-auth9 packages.bridge.src.gallery-store10 packages.bridge.src.image-store11 packages.bridge.src.parser12 packages.bridge.src.prompt-history-store13 packages.bridge.src.push-i18n14 packages.bridge.src.recent-session-search15 packages.bridge.src.usage16 packages.bridge.src.workspace-store17 packages.bridge.src.worktree-store18 repository.l10n19 repository.models20 packages.bridge.src.auto-rename21 packages.bridge.src.codex-process22 packages.bridge.src.debug-trace-store23 packages.bridge.src.git-assist24 packages.bridge.src.push-relay25 packages.bridge.src.resume-metrics26 packages.bridge.src.sdk-process27 packages.bridge.src.sessions-index28 repository.mock29 repository.theme30 repository.utils31 packages.bridge.src.session32 repository.services33 packages.bridge.src34 packages.bridge.src.websocket35 repository.providers36 repository.widgets37 repository.features38 repository.router39 repository.screens40 repositoryfunctions.src1packages.bridge.src.archive-store2packages.bridge.src.background-completion-gate3packages.bridge.src.cli-args4packages.bridge.src.codex-app-server-config5packages.bridge.src.codex-permissions6packages.bridge.src.codex-transport7packages.bridge.src.firebase-auth8packages.bridge.src.gallery-store9packages.bridge.src.image-store10packages.bridge.src.parser11packages.bridge.src.prompt-history-store12packages.bridge.src.push-i18n13packages.bridge.src.recent-session-search14packages.bridge.src.usage15packages.bridge.src.workspace-store16packages.bridge.src.worktree-store17repository.l10n18repository.models19packages.bridge.src.auto-rename20packages.bridge.src.codex-process21packages.bridge.src.debug-trace-store22packages.bridge.src.git-assist23packages.bridge.src.push-relay24packages.bridge.src.resume-metrics25packages.bridge.src.sdk-process26packages.bridge.src.sessions-index27repository.mock28repository.theme29repository.utils30packages.bridge.src.session31repository.services32packages.bridge.src33packages.bridge.src.websocket34repository.providers35repository.widgets36repository.features37repository.router38repository.screens39repository401311111411121191122562512211621423271211421111151111221132377914117312151202060211713131+45 more modules (most-connected shown)

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

At a glance — Architecture · 73% · Adequate · gated by AX7 ·

At a glance — Maturity · 82% · Strong ·

At a glance — Readiness · 67% · Adequate · gated by P3 ·

At a glance — Security · 80% · Adequate · gated by D29 ·

At a glance — Event-Driven · 80% · Strong ·

At a glance — Accessibility · 66% · Adequate · gated by AC3 ·

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
A03:2025 — Software Supply Chain Failures25High / Critical
A05:2025 — Injection23High / Critical
A02:2025 — Security Misconfiguration6High / Critical
A07:2025 — Authentication Failures3High / Critical

Roadmap

Top priorities: Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress; Raise allocation-aware density on the hot paths — currently 25 use(s) across 128,808 production line(s) (~0.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10; Bring the 21 bodies over 60 down to 60 or less in Cognitive Complexity — start with BridgeWebSocketServer.handleClientMessage (cognitive 1347), parser.parseClientMessage (cognitive 648), ChatInputWithOverlays.build (cognitive 276).

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

Do thisHelpsEffortDimension
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.+2.6 ptsMediumAsync & latency hygiene
Raise allocation-aware density on the hot paths — currently 25 use(s) across 128,808 production line(s) (~0.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.+2.6 ptsMediumAllocation hygiene
Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with BridgeWebSocketServer.handleClientMessage (cyclomatic 701), parser.parseClientMessage (cyclomatic 555).+0.9 ptsMediumCyclomatic Complexity
Bring the 21 bodies over 60 down to 60 or less in Cognitive Complexity — start with BridgeWebSocketServer.handleClientMessage (cognitive 1347), parser.parseClientMessage (cognitive 648), ChatInputWithOverlays.build (cognitive 276).+1.2 ptsHighCognitive Complexity
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+1.2 ptsMediumLarge Files
Swallowed exception (empty catch)+1.1 ptsMediumException handling
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+0.9 ptsMediumPage structure
Enforce accessibility in the toolchain: add an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.+0.9 ptsMediumA11y enforcement

File quality

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

FileScoreBandWorst signal
REDACTED1.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.1MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.3MixedSecrets (history): REDACTED: REDACTED
apps/mobile/lib/models/messages.dart4.8MixedCyclomatic Complexity: ServerMessage.fromJson (cyclomatic 94)
apps/mobile/lib/features/session_list/session_list_screen.dart4.8MixedCyclomatic Complexity: _SessionListScreenState._startNewSession (cyclomatic 44)
apps/mobile/lib/widgets/bubbles/assistant_bubble.dart4.8MixedGod Classes: FileTooLong: bubbles/assistant_bubble.dart
REDACTED5.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
apps/mobile/lib/services/bridge_service.dart5.5MixedCyclomatic Complexity: BridgeService.connect (cyclomatic 139)
apps/mobile/lib/widgets/new_session_sheet.dart5.5MixedCyclomatic Complexity: _OptionsSection.build (cyclomatic 63)
apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart5.5MixedCyclomatic Complexity: _MachineEditSheetState._save (cyclomatic 35)
apps/mobile/lib/features/git/git_screen.dart5.5MixedCyclomatic Complexity: _GitScreenBodyState.build (cyclomatic 33)
apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart5.5MixedCyclomatic Complexity: _AskQuestionLayout.build (cyclomatic 17)

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 — 33

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 — 1037

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 — 86

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

This survey 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. All 92 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two 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. 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.

What we checked — 92 dimensions across the health lenses
D1D2D3D4D5D6D7D9D10D12D13D14D15D17D19D20D24D26D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC5AC6AC7AX1AX10AX3AX5AX6AX7AX9ED4GD1IC1M1M2M3M4P1P10P2P3P4P6P7PF2PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X20X21X22X23X24X25X26X27X28X29X3X30X5

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, 1147 of 1156 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 or a scanner, 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
Canine Code Analyzer 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

Every finding is locatable in findings.md. Run 01a1add4-870b-7eab-8eb0-572578cebac3.

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.

  • D8 Code Coverage — not measured this run — We 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. Coverage NOT MEASURED: this repository's production source spans .mts, .ts, .dart, and our analyzer cannot run the .dart test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 79.7% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. In the meantime, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or lcov — `flutter test --coverage` (or `dart test --coverage=coverage` then `dart run coverage:format_coverage --lcov`)) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `flutter test --coverage` (or `dart test --coverage=coverage` then `dart run coverage:format_coverage --lcov`)) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then both halves are read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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 1,520 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 236 test source file(s) (.dart) 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 — not measured this run — We 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. Test reliability NOT SCORED: this repository's production source includes .dart, and the built-in reliability runner cannot re-run the .dart test suite(s) — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in functions/ (15 tests); vitest via `npm ci --ignore-scripts` in packages/bridge/ (1657 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. This repository declares package.json, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (23 contributor(s) across 2605 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 22 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D20 ADR Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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 ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
  • D21 Naming Consistency — not measured this run — We 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. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D21 Naming Consistency — not measured this run — We 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We 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's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We 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.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We 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. `apps/menubar/CCPocketMenubar/Services/DoctorRunner.swift`, `apps/menubar/CCPocketMenubar/ViewModels/AppViewModel.swift`, `apps/menubar/CCPocketMenubar/ViewModels/DoctorViewModel.swift`, `packages/bridge/src/sdk-process.ts`, `REDACTED` 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.
  • AXR1 Runtime accessibility — not measured this run — We 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. User interface: 4 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. Boot: crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:22220: page.goto: net::ERR_INVALID_HTTP_RESPONSE at http://127.0.0.1:22220/ Call log: - navigating to "http://127.0.0.1:22220/", waiting until "load" .
  • C1 Data Protection — not measured this run — We 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. 'package:sqflite_common_ffi' is imported (apps/mobile/lib/services/database_platform_io.dart:5), 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 — We 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. 'package:sqflite_common_ffi' is imported (apps/mobile/lib/services/database_platform_io.dart:5), 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 — We 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. 'package:sqflite_common_ffi' is imported (apps/mobile/lib/services/database_platform_io.dart:5), 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 — We 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. 'package:sqflite_common_ffi' is imported (apps/mobile/lib/services/database_platform_io.dart:5), 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.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 75 further occurrence(s) are not listed individually; the score already reflects all 115.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 102 further occurrence(s) are not listed individually; the score already reflects all 142.
  • X4 Structured logging — not measured this run — We 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

We assess the repository exactly as committed, and only the repository. By design we do 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.
  • 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.
  • 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 REDACTED Scanning: REDACTED 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.
  • 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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • 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.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • 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.
  • 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.
  • 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.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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".
  • 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.

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

183 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was BridgeWebSocketServer.handleClientMessage at 701. A further 2 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.hasValidSessionOptions at 31 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: apps/mobile/lib/theme/markdown_style.dart (_SyntaxHighlightRegistry._syntaxLanguage at 21). 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.

BridgeWebSocketServer.handleClientMessage (cyclomatic 701)REDACTED:3462
parser.parseClientMessage (cyclomatic 555)packages/bridge/src/parser.ts:1464
ChatInputWithOverlays.build (cyclomatic 182)apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:104
BridgeService.connect (cyclomatic 139)apps/mobile/lib/services/bridge_service.dart:782
ChatSessionCubit._applyUpdate (cyclomatic 115)apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:662

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

What to do

  1. Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with BridgeWebSocketServer.handleClientMessage (cyclomatic 701), parser.parseClientMessage (cyclomatic 555). — 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 2 together lifts Cyclomatic Complexity from 2.0 to about 3.6/10, projected with the scoring formula itself and assuming each lands exactly at 240; 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

256 method(s) exceeded the cognitive complexity threshold of 15; the worst was BridgeWebSocketServer.handleClientMessage at 1347.

BridgeWebSocketServer.handleClientMessage (cognitive 1347)REDACTED:3462
parser.parseClientMessage (cognitive 648)packages/bridge/src/parser.ts:1464
ChatInputWithOverlays.build (cognitive 276)apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:104
BridgeService.connect (cognitive 253)apps/mobile/lib/services/bridge_service.dart:782
sessions-index.getCodexSessionHistory (cognitive 235)packages/bridge/src/sessions-index.ts:4224

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

What to do

  1. Bring the 21 bodies over 60 down to 60 or less in Cognitive Complexity — start with BridgeWebSocketServer.handleClientMessage (cognitive 1347), parser.parseClientMessage (cognitive 648), ChatInputWithOverlays.build (cognitive 276). — 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 21 together lifts Cognitive Complexity from 2.0 to about 4.9/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 Classes7.8 / 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 7.8 / 10 · rule-coverage 100% · ceiling Prevented

170 god class(es) detected.

MethodTooLong: BridgeWebSocketServer.handleClientMessage · ×70REDACTED:3462
FileTooLong: REDACTED · ×47REDACTED
ClassTooLong: BridgeWebSocketServer · ×25REDACTED:1083
TooManyMethods: BridgeService · ×18apps/mobile/lib/services/bridge_service.dart:40
FunctionTooLong: sessions-index.getCodexSessionHistory · ×10packages/bridge/src/sessions-index.ts:4224

What to do

  1. Resolve the 70 MethodTooLong finding(s) in God Classes — start with REDACTED (6), REDACTED (6), session_card.dart (4). — One of this dimension's main actionable groups (70 warning-level).
  2. Resolve the 47 FileTooLong finding(s) in God Classes — start with REDACTED, messages.dart, REDACTED. — One of this dimension's main actionable groups (47 warning-level).
  3. Resolve the 25 ClassTooLong finding(s) in God Classes — start with new_session_sheet.dart (2), messages.dart (2), REDACTED. — One of this dimension's main actionable groups (25 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.6 / 10Stronggated by 147 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.6 / 10 · rule-coverage 100% · ceiling Verified

140 duplicated block group(s) detected. A further 7 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 (24% 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.

Duplicated block (10 lines × 2) · ×10apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:745
Duplicated block (8 lines × 2) · ×10apps/mobile/lib/features/claude_session/claude_session_screen.dart:416
Duplicated block (9 lines × 2) · ×9apps/mobile/lib/features/git/widgets/diff_image_widget.dart:162
Duplicated block (13 lines × 2) · ×8apps/mobile/lib/features/claude_session/claude_session_screen.dart:425
Duplicated block (12 lines × 2) · ×8apps/mobile/lib/features/claude_session/claude_session_screen.dart:293

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

What to do

  1. Resolve the 10 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with claude_session_screen.dart (2), chat_input_with_overlays.dart, gallery_image_viewer.dart. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 10 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with git_status_cubit.dart (2), claude_session_screen.dart, supporter_screen.dart. — One of this dimension's main actionable groups (10 warning-level).
  3. Resolve the 9 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with bridge_service.dart (2), session_card.dart (2), diff_image_widget.dart. — One of this dimension's main actionable groups (9 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling8.9 / 10Strong✓ 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 8.9 / 10 · rule-coverage 100% · ceiling Prevented

7 production modules (Gradle+npm+pub+Xcode), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; a workspace's implicit (product-name) dependency is not visible there; 1 module(s) off the main sequence, with abstractness counted on 6 of the 7 (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).

Off the main sequence: ccpocket

What to do

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

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

D6 · Cohesion (LCOM4)9.4 / 10Stronggated by 16 serious findings✓ 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 9.4 / 10 · rule-coverage 100% · ceiling Verified

16 of 310 classes have LCOM4 above 3.

Low cohesion: _SessionListScreenState (LCOM4 14) · ×16apps/mobile/lib/features/session_list/session_list_screen.dart:263

What to do

  1. Resolve the 16 Low cohesion finding(s) in Cohesion (LCOM4) — start with session_list_screen.dart, mock_bridge_service.dart, prompt_history_service.dart. — One of this dimension's main actionable groups (16 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D7 · Architectural Integrity6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Prevented

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

What to do

  1. Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d7_recommendation.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

1541 test methods: 1541 unit, 0 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 1520 `it`/`test` case(s) across 68 test file(s) declaring at least one beside 7 .NET test method(s); its tier split is read from package names and paths only. The Python suite contributes 14 test function(s) across 3 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 Quality10.0 / 10Stronggated by 3 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

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

No assertions: echoes a new project's automatic initial prompt to its Claude client · ×2packages/bridge/src/websocket.test.ts:6351
Fixed-sleep synchronisation: limits concurrent HTTP upload bodies without evicting active uploadspackages/bridge/src/upload-store.test.ts:334
Mock-dominated test: calls stop, disable, deletes file, and daemon-reload · ×9packages/bridge/src/setup-systemd.test.ts:355
Skipped (documented): (unnamed test)packages/bridge/src/websocket.test.ts:6535

What to do

  1. Resolve the 9 Mock-dominated test finding(s) in Test Quality — start with websocket.test.ts (7), setup-systemd.test.ts, startup-info.test.ts. — One of this dimension's main actionable groups (9 recommendation-level).
  2. Resolve the 2 No assertions finding(s) in Test Quality — start with websocket.test.ts (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 Fixed-sleep synchronisation finding(s) in Test Quality — start with upload-store.test.ts. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

1 outdated direct SwiftPM dependencies, 0 pinning defect(s). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question. 1 third-party CocoaPods resolved by a committed Podfile.lock were graded against the CocoaPods trunk (cdn.cocoapods.org): a pod is behind only when the trunk lists a newer release on the same major, which `pod update` reaches under a `~>` requirement. A pod sourced from a path, git URL or local podspec has no trunk release to compare and is not asked about. Carthage dependencies are not graded.

Outdated: Sparkle

✓ On the Gold path — maintain.

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

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.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 105 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 105 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed Gemfile.lock. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. 1 of them publish no licence on rubygems.org; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots4.7 / 10Weak✓ 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 4.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: REDACTED (72×701=50472); packages/bridge/src/parser.ts (37×578=21386); apps/mobile/lib/services/bridge_service.dart (53×139=7367) Repeated repair below the complexity floor: apps/mobile/lib/features/session_list/state/session_list_cubit.dart (4 of 7 changes were fixes); apps/mobile/lib/features/chat_session/widgets/image_attachment_sheet.dart (4 of 5 changes were fixes); apps/mobile/ios/Runner/ImagePasteView.swift (4 of 4 changes were fixes)

Hotspot: REDACTED · ×42REDACTED:3462
Repeated repair: apps/mobile/lib/features/session_list/state/session_list_cubit.dart · ×7apps/mobile/lib/features/session_list/state/session_list_cubit.dart:560

What to do

  1. Resolve the 42 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED, parser.ts, bridge_service.dart. — One of this dimension's main actionable groups (42 warning-level).
  2. Resolve the 7 Repeated repair finding(s) in Churn × Complexity Hotspots — start with session_list_cubit.dart, image_attachment_sheet.dart, ImagePasteView.swift. — One of this dimension's main actionable groups (7 warning-level).

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

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

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

0 deducted task-comment markers across 158240 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.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

1 of 1 documentation facets pass in full. 110 document(s) read across 3 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

0 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D24 · Comment Value8.6 8.5 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 98% · ceiling Documented

8 of 573 judged comments only repeat the code they sit on (1.4 %). 13 comment(s) in another language or script were not judged.

redundant comment · ×8functions/src/index.ts:395

What to do

  1. Resolve the 8 redundant comment finding(s) in Comment Value — start with parser.test.ts (3), index.ts, sessions-index.test.ts. — One of this dimension's main actionable groups (8 recommendation-level).

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

D26 · Project Cohesion6.4 / 10Adequate✓ 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.

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

2 of 11 build units (Bundler, Gradle, Xcode, npm, pub) 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.

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

D29 · Static Analysis (SAST)0.9 / 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.9 / 10 · rule-coverage 100% · ceiling Documented

23 finding(s): 0 critical, 10 high, 13 medium, 0 low. semgrep hit a parse error in 13 file(s) — `.claude/skills/sim-preview/scripts/sim-preview.sh`, `apps/menubar/CCPocketMenubar/ViewModels/AppViewModel.swift` (lines 117–121), `apps/menubar/CCPocketMenubar/ViewModels/DoctorViewModel.swift` (line 276), `apps/mobile/fastlane/screenshots/compose.sh` (line 165, line 289, line 395), `packages/bridge/src/codex-process.test.ts`, … (+8 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 10 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

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

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D30 · Dependency Vulnerabilities0.5 / 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

17 finding(s): 1 critical, 12 high, 4 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security9.0 / 10Adequategated by 2 critical findings✓ 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 9.0 / 10 · rule-coverage 100% · ceiling Documented

6 finding(s): 0 critical, 2 high, 3 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

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

Detailed fixes: d31_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 349 of the 520 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.1 / 10Stronggated by 17 serious 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.1 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: settings_screen.dart↔settings_state.dart 85%; setup-launchd.ts↔setup-systemd.ts 82%; git_screen.dart↔diff_file_header.dart 80%

Change coupling: settings_screen.dart ↔ settings_state.dart · ×14apps/mobile/lib/features/settings/settings_screen.dart:1
Change-coupling hub: streaming_bubble.dart → assistant_bubble.dart, plan_card.dart, result_chip.dart, plan_detail_sheet.dart · ×2apps/mobile/lib/widgets/bubbles/streaming_bubble.dart
Change coupling clique: git_screen.dart, diff_file_header.dart, diff_hunk_widget.dartapps/mobile/lib/features/git/git_screen.dart

What to do

  1. Resolve the 14 Change coupling finding(s) in Change Coupling — start with settings_screen.dart, setup-launchd.ts, session_list_screen.dart. — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with streaming_bubble.dart, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with git_screen.dart. — 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 & Signing7.5 / 10Strong✓ 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 7.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — 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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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 2 platform declaration(s) and 4 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 alternatives10.0 / 10Exemplary○ Nothing flagged

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.

AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged

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.

AC3 · Page structure3.3 / 10Weak✓ 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.

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×2) — scripts/install-banner/template.html:2, scripts/install-banner/template.ja.html:2
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×2) — scripts/install-banner/template.html:2, scripts/install-banner/template.ja.html:2
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — scripts/install-banner/template.html:2, scripts/install-banner/template.ja.html:2, scripts/voice-lab/index.html:1

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.
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.

AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. 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 — no a11y linter (an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have) and no axe/pa11y/Lighthouse in tests or CI. Start by running that check over your rendered pages in CI. What was searched, so you can tell an absence from a miss: the 4 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. — package.json:1

What to do

  • Enforce accessibility in the toolchain: add an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX1 · Captive dependencies10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.

Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.

AX10 · Code composition10.0 / 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.

AX7 · Slice cohesion3.1 / 10Weak✓ Tool-verified

Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.

Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.

  • `_ExploreScreenState` (slice 'explore') depends on `FileBrowserCubit` from slice 'file_browser'. — apps/mobile/lib/features/explore/explore_screen.dart:72
  • `DiffCommentEditing` (slice 'git') depends on `CodeAnchor` from slice 'media_feedback'. — apps/mobile/lib/features/git/widgets/diff_comment_presenter.dart:17
  • `DiffCommentPresenter` (slice 'git') depends on `MediaFeedbackBinding` from slice 'media_feedback'. — apps/mobile/lib/features/git/widgets/diff_comment_presenter.dart:28
  • `DiffCommentCard` (slice 'git') depends on `MediaFeedback` from slice 'media_feedback'. — apps/mobile/lib/features/git/widgets/diff_comment_widgets.dart:8
  • `DiffCommentEditor` (slice 'git') depends on `CodeAnchor` from slice 'media_feedback'. — apps/mobile/lib/features/git/widgets/diff_comment_widgets.dart:96
  • `SessionLinkCubit` (slice 'session_link') depends on `SessionResumeCoordinator` from slice 'session_list'. — apps/mobile/lib/features/session_link/state/session_link_cubit.dart:31
  • `HomeContent` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'. — apps/mobile/lib/features/session_list/widgets/home_content.dart:174
  • `UsageStreamSummary` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'. — apps/mobile/lib/features/session_list/widgets/usage_summary.dart:12
  • `UsageSummary` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'. — apps/mobile/lib/features/session_list/widgets/usage_summary.dart:61
  • `_ProviderUsageLine` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'. — apps/mobile/lib/features/session_list/widgets/usage_summary.dart:154
  • `_UsageMetric` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'. — apps/mobile/lib/features/session_list/widgets/usage_summary.dart:223
  • `WorkspaceShellScreenState` (slice 'session_list') depends on `WorkspaceNavigationCubit` from slice 'workspace'. — apps/mobile/lib/features/session_list/workspace_shell_screen.dart:175
  • `_WorkspaceToolPaneHost` (slice 'session_list') depends on `WorkspaceToolPaneData` from slice 'workspace'. — apps/mobile/lib/features/session_list/workspace_shell_screen.dart:1051
  • `_WorkspaceContentHost` (slice 'session_list') depends on `WorkspaceCenterRoot` from slice 'workspace'. — apps/mobile/lib/features/session_list/workspace_shell_screen.dart:1112

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

ED4 · Outbox / dual-write8.0 / 10Strong✓ Tool-verified

Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.

Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.

  • `SessionResumeCoordinator.resume` performs two independent DURABLE writes — `_codexProfileStore` (a durable store) and `_claudeSettingsStore` (a second durable store) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart:268

What to do

  • Adopt the transactional outbox pattern so DB writes and message publishes commit atomically — no lost or phantom events on a crash.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Dart: methods whose whole body still throws UnimplementedError or a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings 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 & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Dart: methods that only throw UnimplementedError or a "not implemented" exception, methods that take inputs and return a constant or do nothing, 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.

M1 · Documentation (README)9.0 / 10Exemplary✓ 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

  • Add a README to the 2 of 4 project(s) that lack one — worth up to 1 pts.
M2 · Architecture documentation7.0 / 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.

  • 3 ADR-shaped document(s) detected by content — `docs/design/codex-additional-writable-roots-mobile-ui.md`, `docs/design/codex-additional-writable-roots.md`, `docs/design/linux-desktop-support.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
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 accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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's code 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 · Observability6.1 / 10Adequate✓ 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 3/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `apps/menubar`, `apps/mobile/ios`, `apps/mobile_preview`, `apps/mobile_preview/macos`, `packages/bridge`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add OpenTelemetry tracing/metrics (the opentelemetry package) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling3.0 / 10Weak✓ 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 the Dart analyzer's security lints plus `semgrep --config=auto` as a CI step. What was searched, so you can tell an absence from a miss: the 113077 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. — REDACTED:3
  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `gradle`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — REDACTED:2

What to do

  • Add a SAST step to CI running what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — so a security regression fails the build instead of landing.
  • Dependabot is configured but does not watch `gradle` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.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 orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.

What to do

  • Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
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 resilience10.0 / 10Exemplary○ Nothing flagged

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.

PF2 · Allocation hygiene6.1 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 25 use(s) across 128,808 production line(s) (~0.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Dart: on hot paths, hold numbers in dart:typed_data lists (Int32List, Float64List …) instead of boxed List<int>/List<double>, read through views (sublistView, buffer.asInt32List, asByteData) instead of copying, make lists that never grow growable: false, compute in the SIMD types (Float32x4List …), and build bytes with BytesBuilder(copy: false).
  • Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
  • Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
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 each language's code 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.

  • `shell` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — apps/menubar/CCPocketMenubar/Services/BridgeProcessManager.swift:9
  • `runDoctorCLI` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — apps/menubar/CCPocketMenubar/Services/DoctorRunner.swift:26
  • `mkdtempSync` in `runCodexAutoRename` 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. — packages/bridge/src/auto-rename.ts:166
  • `readFileSync` in `runCodexAutoRename` 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. — packages/bridge/src/auto-rename.ts:186
  • `rmSync` in `runCodexAutoRename` 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. — packages/bridge/src/auto-rename.ts:188
  • `existsSync` in `checkCliProviders` 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:194
  • `existsSync` in `checkDataDirectory` 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:413
  • `accessSync` in `checkDataDirectory` 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:421
  • `execSync` in `checkLaunchdService` 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:460
  • `execSync` in `checkSystemdService` 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:510
  • `existsSync` in `checkKeychainAccess` 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:731
  • `execFileSync` in `checkKeychainAccess` 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:742
  • `execFileSync` in `bootstrapProject` 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. — packages/bridge/src/project-bootstrap.ts:56
  • `execFileSync` in `handleClientMessage` 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:6945, REDACTED:6946
  • `existsSync` in `callback to void` 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:7170
  • `existsSync` in `collectImageChanges` 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:11292

What to do

  • Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
  • 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 Safety8.9 / 10Strong✓ 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.6 / 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.

  • REDACTED:3565 · REDACTED:6268 — 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. — REDACTED:3565
  • packages/bridge/src/setup-launchd.ts:47 · packages/bridge/src/setup-systemd.ts:96 — 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. — packages/bridge/src/setup-launchd.ts:47
  • REDACTED:5292 · REDACTED:5383 — 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. — REDACTED:5292
  • REDACTED:8330 · REDACTED:8380 — 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. — REDACTED:8330
  • packages/bridge/src/setup-launchd.ts:92 · packages/bridge/src/setup-systemd.ts:147 — 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. — packages/bridge/src/setup-launchd.ts:92
  • REDACTED:9228 · REDACTED:9281 — 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. — REDACTED:9228
  • REDACTED:5586 · REDACTED:5620 — 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. — REDACTED:5586
  • REDACTED:431 · REDACTED:480 — 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. — REDACTED:431
  • REDACTED:4644 · REDACTED:4737 — 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. — REDACTED:4644
  • packages/bridge/src/claude-usage.ts:80 · packages/bridge/src/sdk-process.ts:198 — the two spans are one implementation copied and then locally edited — 128 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. — packages/bridge/src/claude-usage.ts:80
  • REDACTED:4693 · REDACTED:5342 — 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. — REDACTED:4693
  • packages/bridge/src/debug-trace-store.ts:61 · packages/bridge/src/recording-store.ts:180 — 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. — packages/bridge/src/debug-trace-store.ts:61
  • REDACTED:2980 · REDACTED:3010 — 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. — REDACTED:2980
  • REDACTED:4272 · REDACTED:4299 — 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. — REDACTED:4272
  • REDACTED:4761 · REDACTED:5412 — 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. — REDACTED:4761
  • REDACTED:6950 · REDACTED:6978 — 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. — REDACTED:6950
  • packages/bridge/src/codex-transport.ts:86 · packages/bridge/src/codex-transport.ts:256 — the two spans are one implementation copied and then locally edited — 126 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. — packages/bridge/src/codex-transport.ts:86
  • REDACTED:6382 · REDACTED:6627 — 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. — REDACTED:6382
  • REDACTED:7754 · REDACTED:7782 · REDACTED:7810 · REDACTED:7903 · +5 more site(s) not listed — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — REDACTED:7754
  • REDACTED:8651 · REDACTED:8684 · REDACTED:8722 — all 3 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. — REDACTED:8651
  • REDACTED:7009 · REDACTED:7039 — 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. — REDACTED:7009
  • REDACTED:7893 · REDACTED:8069 — 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. — REDACTED:7893
  • REDACTED:10615 · REDACTED:10746 — 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. — REDACTED:10615
  • packages/bridge/src/parser.ts:1589 · packages/bridge/src/parser.ts:1630 — 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. — packages/bridge/src/parser.ts:1589
  • packages/bridge/src/sessions-index.ts:2153 · packages/bridge/src/sessions-index.ts:2204 — 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. — packages/bridge/src/sessions-index.ts:2153
  • packages/bridge/src/sessions-index.ts:3866 · packages/bridge/src/sessions-index.ts:3987 — 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. — packages/bridge/src/sessions-index.ts:3866
  • REDACTED:3118 · REDACTED:3196 — 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. — REDACTED:3118
  • REDACTED:7800 · REDACTED:7985 · REDACTED:8013 · REDACTED:8041 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — REDACTED:7800
  • REDACTED:11036 · REDACTED:11083 — 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. — REDACTED:11036
  • REDACTED:1483 · REDACTED:1570 — 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. — REDACTED:1483
  • packages/bridge/src/parser.ts:1839 · packages/bridge/src/parser.ts:1876 — 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. — packages/bridge/src/parser.ts:1839
  • packages/bridge/src/parser.ts:2354 · packages/bridge/src/parser.ts:2411 — 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. — packages/bridge/src/parser.ts:2354
  • REDACTED:4836 · REDACTED:6859 — 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. — REDACTED:4836
  • REDACTED:5051 · REDACTED:5085 — 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. — REDACTED:5051
  • packages/bridge/src/parser.ts:1953 · packages/bridge/src/parser.ts:1973 — 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. — packages/bridge/src/parser.ts:1953
  • packages/bridge/src/parser.ts:2182 · packages/bridge/src/parser.ts:2200 — 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. — packages/bridge/src/parser.ts:2182
  • REDACTED:7733 · REDACTED:7764 · REDACTED:7792 · REDACTED:7820 · +7 more site(s) not listed — all 11 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. — REDACTED:7733
  • REDACTED:3641 · REDACTED:3899 — 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. — REDACTED:3641
  • REDACTED:3778 · REDACTED:3963 — 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. — REDACTED:3778
  • packages/bridge/src/parser.ts:1693 · packages/bridge/src/parser.ts:2092 — 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. — packages/bridge/src/parser.ts:1693

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 Boundaries7.6 / 10Strong✓ 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.

  • scripts/benchmark-desktop.mts:15 reaches into another package with a relative path (../packages/bridge/src/media-store.js) — import the package by name instead. — scripts/benchmark-desktop.mts:15
  • scripts/benchmark-desktop.mts:16 reaches into another package with a relative path (../packages/bridge/src/text-preview.js) — import the package by name instead. — scripts/benchmark-desktop.mts:16
  • scripts/verify-finder-sandbox.mts:12 reaches into another package with a relative path (../packages/bridge/src/finder-reveal.js) — import the package by name instead. — scripts/verify-finder-sandbox.mts:12

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity6.0 / 10Adequate✓ 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.

  • handleClientMessage has cyclomatic complexity 649 and cognitive complexity 1131; 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:3462
  • parseClientMessage has cyclomatic complexity 553 and cognitive complexity 671; 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. — packages/bridge/src/parser.ts:1464
  • (anonymous) has cyclomatic complexity 93 and cognitive complexity 152; 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. — packages/bridge/src/session.ts:502
  • parseCodexSessionJsonl has cyclomatic complexity 79 and cognitive complexity 167; 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. — packages/bridge/src/sessions-index.ts:1559
  • parseFromChunks has cyclomatic complexity 68 and cognitive complexity 152; 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. — packages/bridge/src/sessions-index.ts:560
  • getCodexSessionHistory has cyclomatic complexity 66 and cognitive complexity 227; 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. — packages/bridge/src/sessions-index.ts:4224
  • codexThreadToSessionHistory has cyclomatic complexity 58 and cognitive complexity 125; 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. — packages/bridge/src/sessions-index.ts:2845
  • buildSessionCreatedMessage has cyclomatic complexity 54 and cognitive complexity 61; 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:1713
  • getSessionHistory has cyclomatic complexity 43 and cognitive complexity 82; 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. — packages/bridge/src/sessions-index.ts:3618
  • maybeSendPushNotification has cyclomatic complexity 43 and cognitive complexity 79; 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:10547
  • convertSdkMessage has cyclomatic complexity 40 and cognitive complexity 72; 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. — packages/bridge/src/sdk-process.ts:644
  • setupSystemd has cyclomatic complexity 39 and cognitive complexity 33; 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. — packages/bridge/src/setup-systemd.ts:96
  • setupLaunchd has cyclomatic complexity 38 and cognitive complexity 32; 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. — packages/bridge/src/setup-launchd.ts:47
  • getAllRecentSessions has cyclomatic complexity 36 and cognitive complexity 49; 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. — packages/bridge/src/sessions-index.ts:1119
  • hydrateClaudeIndexedEntry has cyclomatic complexity 34 and cognitive complexity 29; 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. — packages/bridge/src/sessions-index.ts:864
  • hasValidSessionOptions has cyclomatic complexity 31 and cognitive complexity 12; 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. — packages/bridge/src/parser.ts:1362
  • rewindInPlace has cyclomatic complexity 30 and cognitive complexity 43; 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. — packages/bridge/src/session.ts:1947
  • normalizeCodexMcpResult has cyclomatic complexity 27 and cognitive complexity 50; 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. — packages/bridge/src/sessions-index.ts:3288
  • (anonymous) has cyclomatic complexity 27 and cognitive complexity 39; 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:7168
  • listAllowedDirectories has cyclomatic complexity 27 and cognitive complexity 31; 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. — packages/bridge/src/directory-listing.ts:81

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files4.5 / 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.

  • REDACTED has 11055 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 5459 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
  • packages/bridge/src/sessions-index.ts has 4137 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/bridge/src/sessions-index.ts:1
  • packages/bridge/src/parser.ts has 2409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/bridge/src/parser.ts:1
  • packages/bridge/src/session.ts has 2246 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/bridge/src/session.ts:1
  • packages/bridge/src/sdk-process.ts has 2036 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/bridge/src/sdk-process.ts:1
  • REDACTED has 985 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 857 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
  • packages/bridge/src/upload-store.ts has 750 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/bridge/src/upload-store.ts:1
  • REDACTED has 414 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
  • packages/bridge/src/prompt-history-store.ts has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/bridge/src/prompt-history-store.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.9 / 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. (×9) — scripts/release-card/generate.mjs:1, tmp/verification/codex-app-server-effort-probe.mjs:1, scripts/store-preview/capture.mjs:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness9.7 / 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 package.json 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: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.6 / 10Exemplary✓ 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 22 application, 5 tooling and 69 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (22 application, 5 tooling, 69 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 (×3) — scripts/benchmark-desktop.mts, scripts/verify-finder-sandbox.mts, packages/bridge/test-client.mjs
  • Nothing imports this binding — it is safe to review for removal. — packages/bridge/src/sessions-index.ts:1870
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×2) — REDACTED:4804, REDACTED:468

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 Hygiene8.0 / 10Strong✓ 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.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. — scripts/voice-lab/server.mjs:8

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports10.0 / 10Exemplary✓ 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.

S1 · Web-Security Posture8.5 / 10Strong✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

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.

  • Set: Content-Security-Policy. Missing: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−1.5 on this card.) — firebase.json:1

What to do

  • Add Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options beside the headers already set; Content-Security-Policy is the one that pays for itself first, then Strict-Transport-Security, then nosniff and a frame policy.
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 document4.3 / 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.

  • `ServerMessage.fromJson` is public and takes `Map<String, dynamic> json` from its caller, and it calls itself at line 979 (`ServerMessage.fromJson`) with a piece of `json` — and nowhere in `ServerMessage.fromJson` 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. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `ServerMessage.fromJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — apps/mobile/lib/models/messages.dart:979

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 correctness7.6 / 10Strong✓ Tool-verified

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.

  • `BridgeService` carries a disposal duty — it declares its own release — and it creates `_recordingListController` itself (line 91, `StreamController.broadcast`), which makes that instance its own. Nothing in the class releases it — no `_recordingListController.close()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `StreamController.broadcast` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_recordingListController.close();` in `dispose()` before `super.dispose()`. — apps/mobile/lib/services/bridge_service.dart:91
  • `BridgeService` carries a disposal duty — it declares its own release — and it creates `_recordingContentController` itself (line 93, `StreamController.broadcast`), which makes that instance its own. Nothing in the class releases it — no `_recordingContentController.close()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `StreamController.broadcast` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_recordingContentController.close();` in `dispose()` before `super.dispose()`. — apps/mobile/lib/services/bridge_service.dart:93
  • `BridgeService` carries a disposal duty — it declares its own release — and it creates `_fileContentController` itself (line 107, `StreamController.broadcast`), which makes that instance its own. Nothing in the class releases it — no `_fileContentController.close()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `StreamController.broadcast` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_fileContentController.close();` in `dispose()` before `super.dispose()`. — apps/mobile/lib/services/bridge_service.dart:107

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
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 propagation10.0 / 10Exemplary○ Nothing flagged

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.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

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. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`.

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 materialisation10.0 / 10Exemplary○ Nothing flagged

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.

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. Whether a `for … in` loop leaves the `List`, `Map` or `Set` it is walking alone — Dart's collection iterators check that the collection has not changed since the loop began, so a body that adds to or removes from the very collection the loop is walking (or the map whose `keys`, `values` or `entries` it walks) makes the next step throw `ConcurrentModificationError` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements 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 guard2.0 / 10Critical✓ Tool-verified

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.

  • This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`. — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1485
  • This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[1]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 1 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`. — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1486
  • This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[2]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 2 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`. — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1487
  • This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[3]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 3 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`. — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1488

What to do

  • Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
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 handling4.9 / 10Weak✓ 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.

  • `.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. (×15) — scripts/verify-finder-sandbox.mts:33, scripts/voice-lab/server.mjs:64, REDACTED:645, …
  • `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. (×2) — scripts/voice-lab/server.mjs:54, scripts/voice-lab/server.mjs:76
  • 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. (×23) — scripts/release/monitor.mjs:252, scripts/release/monitor.mjs:278, packages/bridge/src/claude-usage.ts:102, …

What to do

  • Swallowed exception (empty catch)
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 types9.2 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Dart's sound null safety is on and is not undermined by null assertions — a package whose `environment: sdk:` lower bound is 2.12 or above is null safe, so `String` cannot hold null and `String?` must be checked before use, and each postfix `!` is a run-time `Null check operator used on a null value` the author has told the analyzer cannot happen.

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

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
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
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.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 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 Health63%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture73%Adequate — gated by AX7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity82%StrongStrongest area.
Readiness67%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security80%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven80%StrongSolid.
Accessibility66%Adequate — gated by AC3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateLargest drag on the score — prioritise here.
Unscored — 3 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 — 14 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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 'package:sqflite_common_ffi' (apps/mobile/lib/services/database_platform_io.dart:5) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table 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 'package:sqflite_common_ffi' (apps/mobile/lib/services/database_platform_io.dart:5) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table 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 'package:sqflite_common_ffi' (apps/mobile/lib/services/database_platform_io.dart:5) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table 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.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 36 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.

  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. 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. No class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Dart isolates share no mutable memory, so no two requests write one object at the same instant. 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 vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — The runtime tier booted this repository's service, but crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:22220: page.goto: net::ERR_INVALID_HTTP_RESPONSE at http://127.0.0.1:22220/ Call log: - navigating to "http://127.0.0.1:22220/", waiting until "load" . This repository also has a user interface (4 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates) that the booted service does not serve, and this scan has no strategy that reaches it — so no WCAG success criterion was verified in a rendered page on this run. That is a gap in OUR tooling, not a finding about your application: nothing here says the interface is inaccessible. The static accessibility checks still ran.
  • AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: this repository stores data through 'package:sqflite_common_ffi' (apps/mobile/lib/services/database_platform_io.dart:5) but declares no persisted model this check reads (Drift tables, Isar/ObjectBox/Floor/Hive entities, Serverpod table 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.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository stands up no server another machine can reach (no HttpServer or shelf server bound beyond loopback, no dart_frog route, no Serverpod endpoint, no Conduit, Alfred or Angel application) and keeps no data in a hosted backend. Access control is therefore N/A here — a Flutter app or pub package is authorized by the server it calls, not by itself; hiding a screen authorizes nothing. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half has no runner
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • 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.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; Dart, JavaScript, Kotlin, Python, Ruby, Swift not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed TypeScript surface was not measured.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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"]`.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.dart), 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.
  • D32 Data Compliance (PII/GDPR) — 5 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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.
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 value object(s))
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
  • 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 66 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 classes extending benchmark_harness's `BenchmarkBase`, `AsyncBenchmarkBase` or `PerfBenchmarkBase` (directly or through a base of your own), `benchmark(…)` calls under the pub `benchmark` package, Flutter's `benchmarkWidgets`, `watchPerformance` or `traceAction` in a test importing flutter_test, integration_test or flutter_driver, or benchmark_harness, benchmark or web_benchmarks in a pubspec.yaml, 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.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

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 — 33 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×2
  • <html> without a lang scripts/install-banner/template.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang scripts/install-banner/template.ja.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure · Document without a <title> · ×2
  • Document without a <title> scripts/install-banner/template.html:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
  • Document without a <title> scripts/install-banner/template.ja.html:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
ED4 · Outbox / dual-write · Dual write (no outbox) · ×1
  • Dual write (no outbox): SessionResumeCoordinator.resume apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart:268 — `SessionResumeCoordinator.resume` performs two independent DURABLE writes — `_codexProfileStore` (a durable store) and `_claudeSettingsStore` (a second durable store) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
R8 · Dependency Hygiene · Unlisted import 'ws' · ×1
  • Unlisted import 'ws' scripts/voice-lab/server.mjs:8 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Serious — 1037 finding(s)
D3 · God Classes · MethodTooLong · ×70
  • MethodTooLong: BridgeWebSocketServer.handleClientMessage REDACTED:3462 — MethodTooLong — handleClientMessage runs 4140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4040 over it, 41.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.
  • MethodTooLong: ChatInputWithOverlays.build apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:104 — MethodTooLong — build runs 896 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 796 over it, 8.96× 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: _CodexChatBody.build apps/mobile/lib/features/codex_session/codex_session_screen.dart:664 — MethodTooLong — build runs 738 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 638 over it, 7.38× 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: _ChatScreenBody.build apps/mobile/lib/features/claude_session/claude_session_screen.dart:604 — MethodTooLong — build runs 650 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 550 over it, 6.50× 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: ServerMessage.fromJson apps/mobile/lib/models/messages.dart:807 — MethodTooLong — fromJson runs 649 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 549 over it, 6.49× 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: HomeContentState._buildContent apps/mobile/lib/features/session_list/widgets/home_content.dart:573 — MethodTooLong — _buildContent runs 483 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 383 over it, 4.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.
  • MethodTooLong: BridgeService.connect apps/mobile/lib/services/bridge_service.dart:782 — MethodTooLong — connect runs 454 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 354 over it, 4.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.
  • MethodTooLong: _MachineEditSheetState.build apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:405 — MethodTooLong — build runs 427 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 327 over it, 4.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.
  • MethodTooLong: ChatSessionCubit._applyUpdate apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:662 — MethodTooLong — _applyUpdate runs 403 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 303 over it, 4.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: _RunningSessionCardState.build apps/mobile/lib/widgets/session_card.dart:98 — MethodTooLong — build runs 380 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 280 over it, 3.80× 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: _OptionsSection.build apps/mobile/lib/widgets/new_session_sheet.dart:2819 — MethodTooLong — build runs 369 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 269 over it, 3.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: WorkspaceShellScreenState.build apps/mobile/lib/features/session_list/workspace_shell_screen.dart:663 — MethodTooLong — build runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× 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: CodexProcess.bootstrap REDACTED:2051 — MethodTooLong — bootstrap runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.26× 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: _SessionListScreenState._buildBodyContent apps/mobile/lib/features/session_list/session_list_screen.dart:2109 — MethodTooLong — _buildBodyContent runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× 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: CodexProcess.processItemCompleted REDACTED:3729 — MethodTooLong — processItemCompleted runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.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: RecentSessionCard.build apps/mobile/lib/widgets/session_card.dart:2822 — MethodTooLong — build runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× 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: CodexProcess.handleNotification REDACTED:3149 — MethodTooLong — handleNotification 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.
  • MethodTooLong: _NewSessionSheetContentState._buildPage apps/mobile/lib/widgets/new_session_sheet.dart:1639 — MethodTooLong — _buildPage runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× 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: BridgeWebSocketServer.buildSessionCreatedMessage REDACTED:1713 — MethodTooLong — buildSessionCreatedMessage 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: _ChatMessageListState.build apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:584 — MethodTooLong — build 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: FilePeekContentState.build apps/mobile/lib/features/file_peek/file_peek_sheet.dart:420 — MethodTooLong — build runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× 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: CodexProcess.handleServerRequest REDACTED:2943 — MethodTooLong — handleServerRequest runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× 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: _AskUserQuestionWidgetState.build apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:328 — MethodTooLong — build runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: _RecentAdvancedSearchSheetState.build apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart:592 — MethodTooLong — build runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.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: BridgeService._routeProjectRequestError apps/mobile/lib/services/bridge_service.dart:1349 — MethodTooLong — _routeProjectRequestError runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× 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.
  • + 45 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×47
  • FileTooLong: REDACTED REDACTED — FileTooLong — 8822 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: BridgeWebSocketServer (1083-11625). The bar is 500 significant lines; this is 8322 over it, 17.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: models/messages.dart apps/mobile/lib/models/messages.dart — FileTooLong — 4771 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4271 over it, 9.54× 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 — 4296 significant lines (blank, comment-only and punctuation-only lines excluded), about 66% of them inside a single declaration: CodexProcess (331-4243). The bar is 500 significant lines; this is 3796 over it, 8.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: services/bridge_service.dart apps/mobile/lib/services/bridge_service.dart — FileTooLong — 3953 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: BridgeService (40-5129). The bar is 500 significant lines; this is 3453 over it, 7.91× 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: widgets/new_session_sheet.dart apps/mobile/lib/widgets/new_session_sheet.dart — FileTooLong — 3373 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2873 over it, 6.75× 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/sessions-index.ts packages/bridge/src/sessions-index.ts — FileTooLong — 3123 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2623 over it, 6.25× 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: widgets/session_card.dart apps/mobile/lib/widgets/session_card.dart — FileTooLong — 2414 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1914 over it, 4.83× 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: mock/mock_scenarios.dart apps/mobile/lib/mock/mock_scenarios.dart — FileTooLong — 2388 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1888 over it, 4.78× 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: state/chat_session_cubit.dart apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart — FileTooLong — 2274 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ChatSessionCubit (25-3069). The bar is 500 significant lines; this is 1774 over it, 4.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: session_list/session_list_screen.dart apps/mobile/lib/features/session_list/session_list_screen.dart — FileTooLong — 2234 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: _SessionListScreenState (263-2832). The bar is 500 significant lines; this is 1734 over it, 4.47× 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: src/parser.ts packages/bridge/src/parser.ts — FileTooLong — 2086 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1586 over it, 4.17× 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/session.ts packages/bridge/src/session.ts — FileTooLong — 1716 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: SessionManager (344-2402). The bar is 500 significant lines; this is 1216 over it, 3.43× 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: codex_session/codex_session_screen.dart apps/mobile/lib/features/codex_session/codex_session_screen.dart — FileTooLong — 1655 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1155 over it, 3.31× 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: claude_session/claude_session_screen.dart apps/mobile/lib/features/claude_session/claude_session_screen.dart — FileTooLong — 1462 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 962 over it, 2.92× 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/sdk-process.ts packages/bridge/src/sdk-process.ts — FileTooLong — 1440 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 940 over it, 2.88× 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: widgets/home_content.dart apps/mobile/lib/features/session_list/widgets/home_content.dart — FileTooLong — 1435 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 935 over it, 2.87× 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: widgets/chat_input_with_overlays.dart apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart — FileTooLong — 1252 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: ChatInputWithOverlays (64-1374). The bar is 500 significant lines; this is 752 over it, 2.50× 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: services/store_screenshot_extension.dart apps/mobile/lib/services/store_screenshot_extension.dart — FileTooLong — 1213 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 713 over it, 2.43× 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: widgets/chat_input_bar.dart apps/mobile/lib/widgets/chat_input_bar.dart — FileTooLong — 1147 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 647 over it, 2.29× 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: screens/mock_preview_screen.dart apps/mobile/lib/screens/mock_preview_screen.dart — FileTooLong — 1093 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 593 over it, 2.19× 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: services/prompt_history_service.dart apps/mobile/lib/services/prompt_history_service.dart — FileTooLong — 1052 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: PromptHistoryService (230-1387). The bar is 500 significant lines; this is 552 over it, 2.10× 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: widgets/session_mode_bar.dart apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart — FileTooLong — 1023 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 523 over it, 2.05× 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: session_list/workspace_shell_screen.dart apps/mobile/lib/features/session_list/workspace_shell_screen.dart — FileTooLong — 1000 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 500 over it, 2.00× 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: git/git_screen.dart apps/mobile/lib/features/git/git_screen.dart — FileTooLong — 944 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 444 over it, 1.89× 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: widgets/machine_edit_sheet.dart apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart — FileTooLong — 845 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: _MachineEditSheetState (80-1008). The bar is 500 significant lines; this is 345 over it, 1.69× 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.
  • + 22 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×42
  • Hotspot: REDACTED REDACTED:3462 — REDACTED changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 701 in BridgeWebSocketServer.handleClientMessage at line 3462. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09: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: packages/bridge/src/parser.ts packages/bridge/src/parser.ts:1464 — packages/bridge/src/parser.ts changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 578 in parser.parseClientMessage at line 1464. 11 of those changes were fix/bug commits, and the other 26 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- packages/bridge/src/parser.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: apps/mobile/lib/services/bridge_service.dart apps/mobile/lib/services/bridge_service.dart:782 — apps/mobile/lib/services/bridge_service.dart changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in BridgeService.connect at line 782. 31 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/services/bridge_service.dart`: 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: apps/mobile/lib/models/messages.dart apps/mobile/lib/models/messages.dart:807 — apps/mobile/lib/models/messages.dart changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in ServerMessage.fromJson at line 807. 20 of those changes were fix/bug commits, and the other 28 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/models/messages.dart`: 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: apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:662 — apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 115 in ChatSessionCubit._applyUpdate at line 662. 21 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart`: 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: apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:104 — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 182 in ChatInputWithOverlays.build at line 104. 11 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart`: 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: packages/bridge/src/session.ts packages/bridge/src/session.ts:398 — packages/bridge/src/session.ts changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 132 in SessionManager.create at line 398. 17 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- packages/bridge/src/session.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: apps/mobile/lib/features/codex_session/codex_session_screen.dart apps/mobile/lib/features/codex_session/codex_session_screen.dart:664 — apps/mobile/lib/features/codex_session/codex_session_screen.dart changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in _CodexChatBody.build at line 664. 11 of those changes were fix/bug commits, and the other 16 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/codex_session/codex_session_screen.dart`: 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:2051 — REDACTED changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in CodexProcess.bootstrap at line 2051. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09: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: apps/mobile/lib/features/claude_session/claude_session_screen.dart apps/mobile/lib/features/claude_session/claude_session_screen.dart:604 — apps/mobile/lib/features/claude_session/claude_session_screen.dart changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in _ChatScreenBody.build at line 604. 10 of those changes were fix/bug commits, and the other 15 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/claude_session/claude_session_screen.dart`: 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: packages/bridge/src/sdk-process.ts packages/bridge/src/sdk-process.ts:1733 — packages/bridge/src/sdk-process.ts changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in SdkProcess.processMessages at line 1733. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- packages/bridge/src/sdk-process.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: apps/mobile/lib/widgets/message_bubble.dart apps/mobile/lib/widgets/message_bubble.dart:245 — apps/mobile/lib/widgets/message_bubble.dart changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in ServerMessageWidget.build 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/widgets/message_bubble.dart`: 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: packages/bridge/src/sessions-index.ts packages/bridge/src/sessions-index.ts:1559 — packages/bridge/src/sessions-index.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in sessions-index.parseCodexSessionJsonl at line 1559. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- packages/bridge/src/sessions-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: apps/mobile/lib/features/session_list/session_list_screen.dart apps/mobile/lib/features/session_list/session_list_screen.dart:926 — apps/mobile/lib/features/session_list/session_list_screen.dart changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in _SessionListScreenState._startNewSession at line 926. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/session_list/session_list_screen.dart`: 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: apps/mobile/lib/widgets/new_session_sheet.dart apps/mobile/lib/widgets/new_session_sheet.dart:2819 — apps/mobile/lib/widgets/new_session_sheet.dart changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in _OptionsSection.build at line 2819. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/widgets/new_session_sheet.dart`: 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: apps/mobile/lib/features/session_list/widgets/home_content.dart apps/mobile/lib/features/session_list/widgets/home_content.dart:573 — apps/mobile/lib/features/session_list/widgets/home_content.dart changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in HomeContentState._buildContent at line 573. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/session_list/widgets/home_content.dart`: 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: apps/mobile/lib/services/chat_message_handler.dart apps/mobile/lib/services/chat_message_handler.dart:644 — apps/mobile/lib/services/chat_message_handler.dart changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ChatMessageHandler._handleHistory at line 644. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/services/chat_message_handler.dart`: 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: apps/mobile/lib/features/file_peek/file_peek_sheet.dart apps/mobile/lib/features/file_peek/file_peek_sheet.dart:420 — apps/mobile/lib/features/file_peek/file_peek_sheet.dart changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in FilePeekContentState.build at line 420. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/file_peek/file_peek_sheet.dart`: 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: apps/mobile/lib/features/session_list/workspace_shell_screen.dart apps/mobile/lib/features/session_list/workspace_shell_screen.dart:663 — apps/mobile/lib/features/session_list/workspace_shell_screen.dart changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in WorkspaceShellScreenState.build at line 663. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/session_list/workspace_shell_screen.dart`: 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: apps/mobile/lib/widgets/session_card.dart apps/mobile/lib/widgets/session_card.dart:98 — apps/mobile/lib/widgets/session_card.dart changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in _RunningSessionCardState.build at line 98. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/widgets/session_card.dart`: 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: apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:584 — apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in _ChatMessageListState.build at line 584. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart`: 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: apps/mobile/lib/services/mock_bridge_service.dart apps/mobile/lib/services/mock_bridge_service.dart:149 — apps/mobile/lib/services/mock_bridge_service.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in MockBridgeService.send 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/services/mock_bridge_service.dart`: 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: apps/mobile/lib/widgets/chat_input_bar.dart apps/mobile/lib/widgets/chat_input_bar.dart:862 — apps/mobile/lib/widgets/chat_input_bar.dart changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in _InputTextFieldState.didChangeAppLifecycleState at line 862. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/widgets/chat_input_bar.dart`: 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: apps/mobile/lib/features/git/git_screen.dart apps/mobile/lib/features/git/git_screen.dart:323 — apps/mobile/lib/features/git/git_screen.dart changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in _GitScreenBodyState.build at line 323. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/git/git_screen.dart`: 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: apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart:155 — apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in SessionResumeCoordinator.resume at line 155. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart`: 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.
  • + 17 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×38
  • Swallowed exception (empty catch) scripts/verify-finder-sandbox.mts:33 — `.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) scripts/voice-lab/server.mjs:64 — `.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) scripts/release/monitor.mjs:252 — 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) scripts/release/monitor.mjs:278 — 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) packages/bridge/src/claude-usage.ts:102 — 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) REDACTED:645 — `.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) REDACTED:1468 — `.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) REDACTED:2728 — `.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) REDACTED:2829 — `.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) REDACTED:3594 — `.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) REDACTED:5460 — 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) packages/bridge/src/codex-recovery.ts:96 — 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) packages/bridge/src/codex-recovery.ts:115 — 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) packages/bridge/src/debug-trace-store.ts:63 — `.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) packages/bridge/src/debug-trace-store.ts:69 — `.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) packages/bridge/src/directory-listing.ts:57 — 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) packages/bridge/src/directory-listing.ts:175 — 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) REDACTED:282 — 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) REDACTED:332 — 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) REDACTED:717 — 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) REDACTED:748 — 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) REDACTED:65 — 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) REDACTED:85 — `.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) REDACTED:96 — `.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) REDACTED:260 — 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.
  • + 13 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×25
  • ClassTooLong: BridgeWebSocketServer REDACTED:1083 — ClassTooLong — 7996 significant lines (blank, comment-only and punctuation-only lines excluded), 164 methods. The bar is 400 significant lines; this is 7596 over it, 19.99× 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: BridgeService apps/mobile/lib/services/bridge_service.dart:40 — ClassTooLong — 3845 significant lines (blank, comment-only and punctuation-only lines excluded), 294 methods. The bar is 400 significant lines; this is 3445 over it, 9.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: CodexProcess REDACTED:331 — ClassTooLong — 2814 significant lines (blank, comment-only and punctuation-only lines excluded), 106 methods. The bar is 400 significant lines; this is 2414 over it, 7.04× 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: ChatSessionCubit apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:20 — ClassTooLong — 2222 significant lines (blank, comment-only and punctuation-only lines excluded), 114 methods. The bar is 400 significant lines; this is 1822 over it, 5.56× 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: _SessionListScreenState apps/mobile/lib/features/session_list/session_list_screen.dart:263 — ClassTooLong — 1953 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 400 significant lines; this is 1553 over it, 4.88× 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: SessionManager packages/bridge/src/session.ts:344 — ClassTooLong — 1446 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 1046 over it, 3.62× 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: _NewSessionSheetContentState apps/mobile/lib/widgets/new_session_sheet.dart:569 — ClassTooLong — 1042 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 642 over it, 2.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: ChatInputWithOverlays apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:58 — ClassTooLong — 921 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 521 over it, 2.30× 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: ClientMessage apps/mobile/lib/models/messages.dart:4944 — ClassTooLong — 907 significant lines (blank, comment-only and punctuation-only lines excluded), 95 methods. The bar is 400 significant lines; this is 507 over it, 2.27× 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: PromptHistoryService apps/mobile/lib/services/prompt_history_service.dart:226 — ClassTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 479 over it, 2.20× 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: SdkProcess packages/bridge/src/sdk-process.ts:889 — ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 453 over it, 2.13× 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: _CodexChatBody apps/mobile/lib/features/codex_session/codex_session_screen.dart:645 — ClassTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 354 over it, 1.89× 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: HomeContentState apps/mobile/lib/features/session_list/widgets/home_content.dart:248 — ClassTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 312 over it, 1.78× 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: MachineManagerService apps/mobile/lib/services/machine_manager_service.dart:29 — ClassTooLong — 708 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 308 over it, 1.77× 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: _MachineEditSheetState apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:80 — ClassTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 290 over it, 1.73× 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: ChatMessageHandler apps/mobile/lib/services/chat_message_handler.dart:200 — ClassTooLong — 681 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 281 over it, 1.70× 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: _ChatScreenBody apps/mobile/lib/features/claude_session/claude_session_screen.dart:585 — ClassTooLong — 666 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 266 over it, 1.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.
  • ClassTooLong: ServerMessage apps/mobile/lib/models/messages.dart:806 — ClassTooLong — 650 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 250 over it, 1.63× 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: WorkspaceShellScreenState apps/mobile/lib/features/session_list/workspace_shell_screen.dart:174 — ClassTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 179 over it, 1.45× 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: GitViewCubit apps/mobile/lib/features/git/state/git_view_cubit.dart:12 — ClassTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 162 over it, 1.41× 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: _ChatMessageListState apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:243 — ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 147 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.
  • ClassTooLong: SettingsCubit apps/mobile/lib/features/settings/state/settings_cubit.dart:28 — ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 131 over it, 1.33× 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: _OptionsSection apps/mobile/lib/widgets/new_session_sheet.dart:2680 — ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 100 over it, 1.25× 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: _RunningSessionCardState apps/mobile/lib/widgets/session_card.dart:61 — ClassTooLong — 416 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 16 over it, 1.04× 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: SshStartupService apps/mobile/lib/services/ssh_startup_service.dart:410 — ClassTooLong — 412 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 12 over it, 1.03× 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.
D3 · God Classes · TooManyMethods · ×18
  • TooManyMethods: BridgeService apps/mobile/lib/services/bridge_service.dart:40 — TooManyMethods — 294 methods. The bar is 30 methods; this is 264 over it, 9.80× 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: BridgeWebSocketServer REDACTED:1083 — TooManyMethods — 164 methods. The bar is 30 methods; this is 134 over it, 5.47× 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: ChatSessionCubit apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:20 — TooManyMethods — 114 methods. The bar is 30 methods; this is 84 over it, 3.80× 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: CodexProcess REDACTED:331 — TooManyMethods — 106 methods. The bar is 30 methods; this is 76 over it, 3.53× 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: ClientMessage apps/mobile/lib/models/messages.dart:4944 — TooManyMethods — 95 methods. The bar is 30 methods; this is 65 over it, 3.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: _SessionListScreenState apps/mobile/lib/features/session_list/session_list_screen.dart:263 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× 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 packages/bridge/src/session.ts:344 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× 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: _NewSessionSheetContentState apps/mobile/lib/widgets/new_session_sheet.dart:569 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: PromptHistoryService apps/mobile/lib/services/prompt_history_service.dart:226 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: MockBridgeService apps/mobile/lib/services/mock_bridge_service.dart:11 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× 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: WorkspaceShellScreenState apps/mobile/lib/features/session_list/workspace_shell_screen.dart:174 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.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: SettingsCubit apps/mobile/lib/features/settings/state/settings_cubit.dart:28 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.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: GitViewCubit apps/mobile/lib/features/git/state/git_view_cubit.dart:12 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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: SdkProcess packages/bridge/src/sdk-process.ts:889 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× 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: MachineManagerService apps/mobile/lib/services/machine_manager_service.dart:29 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: MachineManagerCubit apps/mobile/lib/providers/machine_manager_cubit.dart:47 — 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: SessionListCubit apps/mobile/lib/features/session_list/state/session_list_cubit.dart:109 — 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: _AskUserQuestionWidgetState apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:33 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×17
  • Sync-over-async blocking apps/menubar/CCPocketMenubar/Services/BridgeProcessManager.swift:9 — `shell` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking apps/menubar/CCPocketMenubar/Services/DoctorRunner.swift:26 — `runDoctorCLI` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking packages/bridge/src/auto-rename.ts:166 — `mkdtempSync` in `runCodexAutoRename` 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 packages/bridge/src/auto-rename.ts:186 — `readFileSync` in `runCodexAutoRename` 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 packages/bridge/src/auto-rename.ts:188 — `rmSync` in `runCodexAutoRename` 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:194 — `existsSync` in `checkCliProviders` 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:413 — `existsSync` in `checkDataDirectory` 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:421 — `accessSync` in `checkDataDirectory` 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:460 — `execSync` in `checkLaunchdService` 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:510 — `execSync` in `checkSystemdService` 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:731 — `existsSync` in `checkKeychainAccess` 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:742 — `execFileSync` in `checkKeychainAccess` 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 packages/bridge/src/project-bootstrap.ts:56 — `execFileSync` in `bootstrapProject` 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:6945 — `execFileSync` in `handleClientMessage` 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:6946 — `execFileSync` in `handleClientMessage` 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:7170 — `existsSync` in `callback to void` 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:11292 — `existsSync` in `collectImageChanges` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×16
  • Low cohesion: _SessionListScreenState (LCOM4 14) apps/mobile/lib/features/session_list/session_list_screen.dart:263 — _SessionListScreenState's methods fall into 14 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MockBridgeService (LCOM4 11) apps/mobile/lib/services/mock_bridge_service.dart:11 — MockBridgeService's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PromptHistoryService (LCOM4 9) apps/mobile/lib/services/prompt_history_service.dart:226 — PromptHistoryService's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ReplayBridgeService (LCOM4 8) apps/mobile/lib/services/replay_bridge_service.dart:27 — ReplayBridgeService's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ToolResultBubbleState (LCOM4 8) apps/mobile/lib/widgets/bubbles/tool_result_bubble.dart:51 — ToolResultBubbleState's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SessionListCubit (LCOM4 7) apps/mobile/lib/features/session_list/state/session_list_cubit.dart:109 — SessionListCubit's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ExploreCubit (LCOM4 6) apps/mobile/lib/features/explore/state/explore_cubit.dart:9 — ExploreCubit's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PermissionRequestMessage (LCOM4 6) apps/mobile/lib/models/messages.dart:2083 — PermissionRequestMessage's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _NewSessionSheetContentState (LCOM4 6) apps/mobile/lib/widgets/new_session_sheet.dart:569 — _NewSessionSheetContentState's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: WorkspacePaneChrome (LCOM4 6) apps/mobile/lib/widgets/workspace_pane_chrome.dart:82 — WorkspacePaneChrome's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _MachineEditSheetState (LCOM4 5) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:80 — _MachineEditSheetState's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BridgeService (LCOM4 4) apps/mobile/lib/services/bridge_service.dart:40 — BridgeService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PurchasesRevenueCatGateway (LCOM4 4) apps/mobile/lib/services/revenuecat_service.dart:238 — PurchasesRevenueCatGateway's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _AskUserQuestionWidgetState (LCOM4 4) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:33 — _AskUserQuestionWidgetState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _ToolUseTileState (LCOM4 4) apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:335 — _ToolUseTileState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _ClaudeSettingsPanelState (LCOM4 4) apps/mobile/lib/widgets/claude_settings_panel.dart:132 — _ClaudeSettingsPanelState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AX7 · Slice cohesion · Cross-slice coupling · ×14
  • Cross-slice coupling: explore → file_browser apps/mobile/lib/features/explore/explore_screen.dart:72 — `_ExploreScreenState` (slice 'explore') depends on `FileBrowserCubit` from slice 'file_browser'.
  • Cross-slice coupling: git → media_feedback apps/mobile/lib/features/git/widgets/diff_comment_presenter.dart:17 — `DiffCommentEditing` (slice 'git') depends on `CodeAnchor` from slice 'media_feedback'.
  • Cross-slice coupling: git → media_feedback apps/mobile/lib/features/git/widgets/diff_comment_presenter.dart:28 — `DiffCommentPresenter` (slice 'git') depends on `MediaFeedbackBinding` from slice 'media_feedback'.
  • Cross-slice coupling: git → media_feedback apps/mobile/lib/features/git/widgets/diff_comment_widgets.dart:8 — `DiffCommentCard` (slice 'git') depends on `MediaFeedback` from slice 'media_feedback'.
  • Cross-slice coupling: git → media_feedback apps/mobile/lib/features/git/widgets/diff_comment_widgets.dart:96 — `DiffCommentEditor` (slice 'git') depends on `CodeAnchor` from slice 'media_feedback'.
  • Cross-slice coupling: session_link → session_list apps/mobile/lib/features/session_link/state/session_link_cubit.dart:31 — `SessionLinkCubit` (slice 'session_link') depends on `SessionResumeCoordinator` from slice 'session_list'.
  • Cross-slice coupling: session_list → settings apps/mobile/lib/features/session_list/widgets/home_content.dart:174 — `HomeContent` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'.
  • Cross-slice coupling: session_list → settings apps/mobile/lib/features/session_list/widgets/usage_summary.dart:12 — `UsageStreamSummary` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'.
  • Cross-slice coupling: session_list → settings apps/mobile/lib/features/session_list/widgets/usage_summary.dart:61 — `UsageSummary` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'.
  • Cross-slice coupling: session_list → settings apps/mobile/lib/features/session_list/widgets/usage_summary.dart:154 — `_ProviderUsageLine` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'.
  • Cross-slice coupling: session_list → settings apps/mobile/lib/features/session_list/widgets/usage_summary.dart:223 — `_UsageMetric` (slice 'session_list') depends on `UsageDisplayMode` from slice 'settings'.
  • Cross-slice coupling: session_list → workspace apps/mobile/lib/features/session_list/workspace_shell_screen.dart:175 — `WorkspaceShellScreenState` (slice 'session_list') depends on `WorkspaceNavigationCubit` from slice 'workspace'.
  • Cross-slice coupling: session_list → workspace apps/mobile/lib/features/session_list/workspace_shell_screen.dart:1051 — `_WorkspaceToolPaneHost` (slice 'session_list') depends on `WorkspaceToolPaneData` from slice 'workspace'.
  • Cross-slice coupling: session_list → workspace apps/mobile/lib/features/session_list/workspace_shell_screen.dart:1112 — `_WorkspaceContentHost` (slice 'session_list') depends on `WorkspaceCenterRoot` from slice 'workspace'.
D35 · Change Coupling · Change coupling · ×14
  • Change coupling: settings_screen.dart ↔ settings_state.dart apps/mobile/lib/features/settings/settings_screen.dart:1 — `apps/mobile/lib/features/settings/settings_screen.dart` and `apps/mobile/lib/features/settings/state/settings_state.dart` change together 85% of the time (11 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 11 shared commits counted here, the most recent 3 are `5072c61d` fix(mobile): preserve text when using voice input; `b12d68bb` feat(settings): add compact text density setting; `b5278467` feat(mobile): add scroll-first git diff mode — run `git show` on any of them.
  • Change coupling: setup-launchd.ts ↔ setup-systemd.ts packages/bridge/src/setup-launchd.ts:1 — `packages/bridge/src/setup-launchd.ts` and `packages/bridge/src/setup-systemd.ts` change together 82% of the time (9 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 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 9 shared commits counted here, the most recent 3 are `041ecfa1` fix(bridge): support absolute downloads and opt-in all-path sharing; `ccb06ab7` feat(bridge): configure Codex assist model; `69ac2dbe` fix(bridge): validate server port before startup (#166) — run `git show` on any of them.
  • Change coupling: session_list_screen.dart ↔ machine_manager_service.dart apps/mobile/lib/features/session_list/session_list_screen.dart:1 — `apps/mobile/lib/features/session_list/session_list_screen.dart` and `apps/mobile/lib/services/machine_manager_service.dart` change together 75% of the time (9 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 9 shared commits counted here, the most recent 3 are `544b0c84` fix(mobile): clear stale machine error after the bridge reconnects; `6e5151be` fix(app): handle IPv6 bridge endpoints consistently (#162); `07512e2f` fix(mobile): preserve saved ssh private keys — run `git show` on any of them.
  • Change coupling: mock_scenarios.dart ↔ mock_sessions.dart apps/mobile/lib/mock/mock_scenarios.dart:1 — `apps/mobile/lib/mock/mock_scenarios.dart` and `apps/mobile/lib/mock/mock_sessions.dart` change together 67% of the time (8 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 8 shared commits counted here, the most recent 3 are `5fc0babf` feat(codex): support always allow for mcp approvals; `bc0ebf1f` feat(mobile): align codex approval ui with cli; `5b5be1f8` fix(session): prevent duplicate screen on session restart and rewind — run `git show` on any of them.
  • Change coupling: plan_card.dart ↔ plan_detail_sheet.dart apps/mobile/lib/widgets/bubbles/plan_card.dart:1 — `apps/mobile/lib/widgets/bubbles/plan_card.dart` and `apps/mobile/lib/widgets/plan_detail_sheet.dart` change together 64% of the time (7 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 7 shared commits counted here, the most recent 3 are `e0aec96a` feat(app): underline markdown links on hover; `3d60c6df` fix(app): autolink localhost URLs in chat markdown; `8c075b33` fix(mobile): improve long session performance — run `git show` on any of them.
  • Change coupling: chat_session_state.dart ↔ chat_message_handler.dart apps/mobile/lib/features/chat_session/state/chat_session_state.dart:1 — `apps/mobile/lib/features/chat_session/state/chat_session_state.dart` and `apps/mobile/lib/services/chat_message_handler.dart` change together 59% of the time (13 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) 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 13 shared commits counted here, the most recent 3 are `e75169d4` feat(mobile): change Claude model, effort and fast mode in session; `e1c2e339` feat(codex): add opt-in bounded usage-limit recovery; `5e3f8d07` feat(codex): align effort and speed settings UI — run `git show` on any of them.
  • Change coupling: mock_sessions.dart ↔ session_card.dart apps/mobile/lib/mock/mock_sessions.dart:1 — `apps/mobile/lib/mock/mock_sessions.dart` and `apps/mobile/lib/widgets/session_card.dart` 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 `5fc0babf` feat(codex): support always allow for mcp approvals; `bc0ebf1f` feat(mobile): align codex approval ui with cli; `156895de` feat(mobile): unify button colors with statusColor and add mock scena… — run `git show` on any of them.
  • Change coupling: REDACTED ↔ parser.ts REDACTED:1 — `REDACTED` and `packages/bridge/src/parser.ts` change together 56% of the time (9 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) 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 9 shared commits counted here, the most recent 3 are `7b878a2d` feat(files): improve explorer and file peek; `9a51d012` perf(bridge): limit client file list payloads (#164); `941f37a5` feat(git): show dirty status badge in sessions — run `git show` on any of them.
  • Change coupling: session_list_app_bar.dart ↔ workspace_shell_screen.dart apps/mobile/lib/features/session_list/widgets/session_list_app_bar.dart:1 — `apps/mobile/lib/features/session_list/widgets/session_list_app_bar.dart` and `apps/mobile/lib/features/session_list/workspace_shell_screen.dart` change together 55% of the time (12 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) 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 12 shared commits counted here, the most recent 3 are `6fee4a1f` feat(mobile): jump to the app update card from the settings badge; `18c8a3f5` feat(mobile): let the iPhone Duo strip follow the touched pane when u…; `b901d36f` feat(workspace): preserve navigation and state across adaptive layouts — run `git show` on any of them.
  • Change coupling: status_indicator.dart ↔ claude_session_screen.dart apps/mobile/lib/features/chat_session/widgets/status_indicator.dart:1 — `apps/mobile/lib/features/chat_session/widgets/status_indicator.dart` and `apps/mobile/lib/features/claude_session/claude_session_screen.dart` 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 `937fa407` refactor(session): move debug bundle button to status indicator long …; `16ad3a0e` refactor(bridge): move clearContext handling from sdk-process to webs… (at that commit the files were still `apps/mobile/lib/features/claude_code_session/widgets/status_indicator.dart` and `apps/mobile/lib/features/claude_code_session/claude_code_session_screen.dart`); `20d7071a` refactor(mobile): UI細かい調整4件 (at that commit the files were still `apps/mobile/lib/features/claude_code_session/widgets/status_indicator.dart` and `apps/mobile/lib/features/claude_code_session/claude_code_session_screen.dart`) — run `git show` on any of them.
  • Change coupling: assistant_bubble.dart ↔ tool_result_bubble.dart apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:1 — `apps/mobile/lib/widgets/bubbles/assistant_bubble.dart` and `apps/mobile/lib/widgets/bubbles/tool_result_bubble.dart` 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 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 7 shared commits counted here, the most recent 3 are `e7c8cd77` perf(mobile): reduce long chat rendering work; `d341e05b` feat(mobile): add Google search selection menu; `28034f38` feat(codex): support image generation results — run `git show` on any of them.
  • Change coupling: git_view_state.dart ↔ diff_content_list.dart apps/mobile/lib/features/git/state/git_view_state.dart:1 — `apps/mobile/lib/features/git/state/git_view_state.dart` and `apps/mobile/lib/features/git/widgets/diff_content_list.dart` 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 `32a96486` refactor(git): remove legacy diff selection flow; `b96081eb` fix(git): make wrapped diff the default view; `bc1d442c` fix(git): improve hunk actions in git screen — run `git show` on any of them.
  • Change coupling: approval_bar.dart ↔ session_card.dart apps/mobile/lib/widgets/approval_bar.dart:1 — `apps/mobile/lib/widgets/approval_bar.dart` and `apps/mobile/lib/widgets/session_card.dart` change together 50% of the time (14 of the 28 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 14 shared commits counted here, the most recent 3 are `b3db042f` fix(mobile): improve MCP approval presentation; `d8a6d603` fix(mobile): dedupe codex approval why copy; `7effa5f0` fix(mobile): soften codex plan continue label — run `git show` on any of them.
  • Change coupling: messages.dart ↔ REDACTED apps/mobile/lib/models/messages.dart:1 — `apps/mobile/lib/models/messages.dart` and `REDACTED` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `7b878a2d` feat(files): improve explorer and file peek; `9a51d012` perf(bridge): limit client file list payloads (#164); `941f37a5` feat(git): show dirty status badge in sessions — run `git show` on any of them.
D3 · God Classes · FunctionTooLong · ×10
  • FunctionTooLong: sessions-index.getCodexSessionHistory packages/bridge/src/sessions-index.ts:4224 — FunctionTooLong — getCodexSessionHistory runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× 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.startServer packages/bridge/src/index.ts:38 — FunctionTooLong — startServer runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× 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: sessions-index.parseCodexSessionJsonl packages/bridge/src/sessions-index.ts:1559 — FunctionTooLong — parseCodexSessionJsonl runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× 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: sessions-index.codexThreadToSessionHistory packages/bridge/src/sessions-index.ts:2845 — FunctionTooLong — codexThreadToSessionHistory runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× 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: generate.renderHtml scripts/release-card/generate.mjs:139 — FunctionTooLong — renderHtml runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× 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: sessions-index.parseFromChunks packages/bridge/src/sessions-index.ts:560 — FunctionTooLong — parseFromChunks runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: codex-process.createElicitationInput REDACTED:5467 — FunctionTooLong — createElicitationInput runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.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: sdk-process.convertSdkMessage packages/bridge/src/sdk-process.ts:644 — FunctionTooLong — convertSdkMessage runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× 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: setup-launchd.setupLaunchd packages/bridge/src/setup-launchd.ts:47 — FunctionTooLong — setupLaunchd runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× 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: setup-systemd.setupSystemd packages/bridge/src/setup-systemd.ts:96 — FunctionTooLong — setupSystemd 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:745 — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:745-754 | apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1083-1092 — 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.
  • Duplicated block (10 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:359 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:359-368 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:424-433 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 2) apps/mobile/lib/features/gallery/widgets/gallery_image_viewer.dart:226 — apps/mobile/lib/features/gallery/widgets/gallery_image_viewer.dart:226-235 | apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:767-776 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) apps/mobile/lib/features/session_list/session_list_screen.dart:2746 — apps/mobile/lib/features/session_list/session_list_screen.dart:2746-2755 | apps/mobile/lib/widgets/new_session_sheet.dart:1467-1476 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) apps/mobile/lib/features/settings/supporter_screen.dart:143 — apps/mobile/lib/features/settings/supporter_screen.dart:143-152 | apps/mobile/lib/features/settings/supporter_screen.dart:196-205 — 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.
  • Duplicated block (10 lines × 2) apps/mobile/lib/features/setup_guide/widgets/guide_page_about.dart:23 — apps/mobile/lib/features/setup_guide/widgets/guide_page_about.dart:23-32 | apps/mobile/lib/features/setup_guide/widgets/guide_page_autostart.dart:63-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) apps/mobile/lib/features/setup_guide/widgets/guide_page_autostart.dart:91 — apps/mobile/lib/features/setup_guide/widgets/guide_page_autostart.dart:91-101 | apps/mobile/lib/features/setup_guide/widgets/guide_page_bridge_setup.dart:50-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) apps/mobile/lib/theme/app_theme.dart:192 — apps/mobile/lib/theme/app_theme.dart:192-201 | apps/mobile/lib/widgets/new_session_sheet.dart:1623-1632 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:102 — apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:102-111 | apps/mobile/lib/widgets/session_card.dart:1447-1456 — before extracting anything, compare `apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart` and `apps/mobile/lib/widgets/session_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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 × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:306 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:306-315 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:326-335 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×10
  • Duplicated block (8 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:416 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:416-423 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:452-459 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 2) apps/mobile/lib/features/git/state/git_status_cubit.dart:84 — apps/mobile/lib/features/git/state/git_status_cubit.dart:84-91 | apps/mobile/lib/models/messages.dart:4845-4855 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) apps/mobile/lib/features/git/state/git_status_cubit.dart:85 — apps/mobile/lib/features/git/state/git_status_cubit.dart:85-92 | apps/mobile/lib/widgets/new_session_sheet.dart:200-207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) apps/mobile/lib/features/settings/supporter_screen.dart:601 — apps/mobile/lib/features/settings/supporter_screen.dart:601-608 | apps/mobile/lib/features/settings/supporter_screen.dart:671-678 — 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.
  • Duplicated block (8 lines × 2) apps/mobile/lib/features/settings/widgets/settings_category_body.dart:199 — apps/mobile/lib/features/settings/widgets/settings_category_body.dart:199-206 | apps/mobile/lib/features/setup_guide/setup_guide_screen.dart:34-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) apps/mobile/lib/models/messages.dart:985 — apps/mobile/lib/models/messages.dart:985-992 | apps/mobile/lib/models/messages.dart:996-1003 — 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.
  • Duplicated block (8 lines × 2) apps/mobile/lib/widgets/bubbles/error_bubble.dart:381 — apps/mobile/lib/widgets/bubbles/error_bubble.dart:381-388 | apps/mobile/lib/widgets/bubbles/error_bubble.dart:482-489 — 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.
  • Duplicated block (8 lines × 2) apps/mobile/lib/widgets/bubbles/image_preview.dart:62 — apps/mobile/lib/widgets/bubbles/image_preview.dart:62-69 | apps/mobile/lib/widgets/bubbles/image_preview.dart:124-131 — 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.
  • Duplicated block (8 lines × 2) apps/mobile/lib/widgets/worktree_list_sheet.dart:225 — apps/mobile/lib/widgets/worktree_list_sheet.dart:225-232 | apps/mobile/lib/widgets/worktree_list_sheet.dart:273-280 — 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.
  • Duplicated block (8 lines × 2) apps/mobile/lib/widgets/file_mention_overlay.dart:32 — apps/mobile/lib/widgets/file_mention_overlay.dart:32-39 | apps/mobile/lib/widgets/slash_command_overlay.dart:28-35 — before extracting anything, compare `apps/mobile/lib/widgets/file_mention_overlay.dart` and `apps/mobile/lib/widgets/slash_command_overlay.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×9
  • Duplicated block (9 lines × 2) apps/mobile/lib/features/git/widgets/diff_image_widget.dart:162 — apps/mobile/lib/features/git/widgets/diff_image_widget.dart:162-170 | apps/mobile/lib/features/git/widgets/diff_image_widget.dart:202-210 — 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.
  • Duplicated block (9 lines × 2) apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart:206 — apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart:206-214 | apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart:299-307 — 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.
  • Duplicated block (9 lines × 2) apps/mobile/lib/services/bridge_service.dart:1803 — apps/mobile/lib/services/bridge_service.dart:1803-1811 | apps/mobile/lib/services/bridge_service.dart:1824-1832 — 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.
  • Duplicated block (9 lines × 2) apps/mobile/lib/services/bridge_service.dart:3411 — apps/mobile/lib/services/bridge_service.dart:3411-3419 | apps/mobile/lib/services/bridge_service.dart:3422-3430 — 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.
  • Duplicated block (9 lines × 2) apps/mobile/lib/theme/app_theme.dart:681 — apps/mobile/lib/theme/app_theme.dart:681-692 | apps/mobile/lib/widgets/new_session_sheet.dart:236-244 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:138 — apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:138-146 | apps/mobile/lib/widgets/session_card.dart:1564-1572 — before extracting anything, compare `apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart` and `apps/mobile/lib/widgets/session_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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 × 2) apps/mobile/lib/widgets/session_card.dart:793 — apps/mobile/lib/widgets/session_card.dart:793-801 | apps/mobile/lib/widgets/session_card.dart:1247-1255 — 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.
  • Duplicated block (9 lines × 2) apps/mobile/lib/widgets/session_card.dart:2710 — apps/mobile/lib/widgets/session_card.dart:2710-2718 | apps/mobile/lib/widgets/session_card.dart:2725-2733 — 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.
  • Duplicated block (9 lines × 2) apps/mobile/lib/services/store_screenshot_extension.dart:1043 — apps/mobile/lib/screens/mock_preview_screen.dart:1461-1469 | apps/mobile/lib/services/store_screenshot_extension.dart:1043-1051 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
R4 · Test Coverage · No test reaches this file · ×9
  • No test reaches this file scripts/release-card/generate.mjs: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 tmp/verification/codex-app-server-effort-probe.mjs: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/store-preview/capture.mjs: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/verify-finder-sandbox.mts: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 packages/bridge/test-client.mjs: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/voice-lab/server.mjs: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 tools/ssh-jump-smoke/bridge-smoke-server.mjs: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/landing-preview/serve.mjs: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/voice-lab/capture.js: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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×8
  • Duplicated block (13 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:425 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:425-437 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:463-475 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (13 lines × 2) apps/mobile/lib/features/git/state/branch_cubit.dart:197 — apps/mobile/lib/features/git/state/branch_cubit.dart:197-209 | apps/mobile/lib/features/git/state/commit_cubit.dart:154-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:924 — apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:924-936 | apps/mobile/lib/features/git/widgets/diff_image_widget.dart:427-439 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) apps/mobile/lib/models/messages.dart:5061 — apps/mobile/lib/models/messages.dart:5061-5073 | apps/mobile/lib/models/messages.dart:5494-5506 — 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.
  • Duplicated block (13 lines × 2) apps/mobile/lib/services/store_screenshot_extension.dart:599 — apps/mobile/lib/services/store_screenshot_extension.dart:599-611 | apps/mobile/lib/services/store_screenshot_extension.dart:1136-1148 — 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.
  • Duplicated block (13 lines × 2) apps/mobile/lib/widgets/approval_bar.dart:374 — apps/mobile/lib/widgets/approval_bar.dart:374-386 | apps/mobile/lib/widgets/approval_bar.dart:406-418 — 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.
  • Duplicated block (13 lines × 2) apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:717 — apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:717-729 | apps/mobile/lib/widgets/bubbles/tool_result_bubble.dart:455-467 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) apps/mobile/lib/widgets/session_card.dart:1836 — apps/mobile/lib/widgets/session_card.dart:1836-1848 | apps/mobile/lib/widgets/session_card.dart:1900-1912 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×8
  • Duplicated block (12 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:293 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:293-304 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:313-324 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:335 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:335-346 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:392-403 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) apps/mobile/lib/features/gallery/widgets/gallery_filter_chips.dart:27 — apps/mobile/lib/features/gallery/widgets/gallery_filter_chips.dart:27-38 | apps/mobile/lib/widgets/horizontal_chip_bar.dart:64-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) apps/mobile/lib/features/session_list/session_list_screen.dart:1941 — apps/mobile/lib/features/session_list/session_list_screen.dart:1941-1952 | apps/mobile/lib/features/session_list/session_list_screen.dart:2111-2122 — 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.
  • Duplicated block (12 lines × 2) apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart:178 — apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart:178-189 | apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart:610-621 — 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.
  • Duplicated block (12 lines × 2) apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:84 — apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:84-95 | apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart:89-100 — before extracting anything, compare `apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart` and `apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:97 — apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:97-108 | apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart:102-113 — before extracting anything, compare `apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart` and `apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) apps/mobile/lib/services/bridge_service.dart:3848 — apps/mobile/lib/services/bridge_service.dart:3848-3859 | apps/mobile/lib/services/session_runtime_store.dart:179-190 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D15 · Churn × Complexity Hotspots · Repeated repair · ×7
  • Repeated repair: apps/mobile/lib/features/session_list/state/session_list_cubit.dart apps/mobile/lib/features/session_list/state/session_list_cubit.dart:560 — apps/mobile/lib/features/session_list/state/session_list_cubit.dart changed 7 times in last 90 days and 4 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 SessionListCubit._requestWithCurrentFilters at line 560), 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(mobile): keep recent session filters across reconnects and day changes”; “fix(mobile): keep pinned sessions visible across filters and pages”; “fix(projects): preserve workspace identity across sessions”; “fix(sessions): correlate recent session requests”. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/session_list/state/session_list_cubit.dart`: 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: apps/mobile/lib/features/chat_session/widgets/image_attachment_sheet.dart apps/mobile/lib/features/chat_session/widgets/image_attachment_sheet.dart:24 — apps/mobile/lib/features/chat_session/widgets/image_attachment_sheet.dart changed 5 times in last 90 days and 4 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 ImageAttachmentSheet.build at line 24), 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(ios): restore plain attachment menu appearance”; “fix(ios): paste directly from attachment menu”; “fix(ios): preserve clipboard attachment menu appearance”; “fix(ios): paste clipboard images with native control”. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/chat_session/widgets/image_attachment_sheet.dart`: 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: apps/mobile/ios/Runner/ImagePasteView.swift apps/mobile/ios/Runner/ImagePasteView.swift:115 — apps/mobile/ios/Runner/ImagePasteView.swift changed 4 times in last 90 days and 4 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 ImagePasteReader.read at line 115), 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(ios): expand paste control across attachment row”; “fix(ios): align native paste control to menu leading edge”; “fix(ios): paste directly from attachment menu”; “fix(ios): paste images directly from native context menu”. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/ios/Runner/ImagePasteView.swift`: 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: apps/mobile/lib/features/file_peek/widgets/file_peek_media_controls.dart apps/mobile/lib/features/file_peek/widgets/file_peek_media_controls.dart:355 — apps/mobile/lib/features/file_peek/widgets/file_peek_media_controls.dart changed 4 times in last 90 days and 3 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 FilePeekPlaybackRateMenu.build at line 355), 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(mobile): rebuild video controls so play button never overlaps seek bar”; “fix(mobile): apply playback speed after video controls hide”; “fix(mobile): improve video control contrast on bright and dark frames”. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/file_peek/widgets/file_peek_media_controls.dart`: 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: apps/mobile/lib/services/session_runtime_store.dart apps/mobile/lib/services/session_runtime_store.dart:96 — apps/mobile/lib/services/session_runtime_store.dart changed 4 times in last 90 days and 3 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 SessionRuntimeStore.applyServerMessage at line 96), 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: keep fork and Claude settings state consistent”; “fix(session): hydrate notification-opened sessions”; “fix(session): preserve completion display order”. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/services/session_runtime_store.dart`: 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: apps/mobile/lib/features/chat_session/widgets/ios_image_paste_button.dart apps/mobile/lib/features/chat_session/widgets/ios_image_paste_button.dart:60 — apps/mobile/lib/features/chat_session/widgets/ios_image_paste_button.dart changed 4 times in last 90 days and 3 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 _IOSImagePasteButtonState._handleMethodCall at line 60), 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(ios): expand paste control across attachment row”; “fix(ios): restore plain attachment menu appearance”; “fix(ios): paste directly from attachment menu”. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/features/chat_session/widgets/ios_image_paste_button.dart`: 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: apps/mobile/lib/services/session_pending_input_state.dart apps/mobile/lib/services/session_pending_input_state.dart:47 — apps/mobile/lib/services/session_pending_input_state.dart changed 3 times in last 90 days and 3 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 PendingUserInputQueue.apply at line 47), 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(mobile): track actionable prompts independently of chat history”; “fix(chat): queue pending user prompts in arrival order”; “fix(mobile): preserve approval queue ordering”. 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-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 07:24:22 +09:00' --until='2026-11-06 07:24:22 +09:00' --full-history --no-merges -- apps/mobile/lib/services/session_pending_input_state.dart`: 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×6
  • Duplicated block (19 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:233 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:233-251 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:254-272 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (19 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1204 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1204-1222 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1335-1353 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (19 lines × 2) apps/mobile/lib/features/gallery/widgets/gallery_image_viewer.dart:177 — apps/mobile/lib/features/gallery/widgets/gallery_image_viewer.dart:177-195 | apps/mobile/lib/widgets/bubbles/image_preview.dart:308-326 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (19 lines × 2) apps/mobile/lib/features/git/widgets/diff_file_header.dart:59 — apps/mobile/lib/features/git/widgets/diff_file_header.dart:59-77 | apps/mobile/lib/features/git/widgets/diff_stats_badge.dart:18-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (19 lines × 2) apps/mobile/lib/features/session_list/session_list_screen.dart:2426 — apps/mobile/lib/features/session_list/session_list_screen.dart:2426-2444 | apps/mobile/lib/features/session_list/session_list_screen.dart:2813-2831 — 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.
  • Duplicated block (19 lines × 2) apps/mobile/lib/widgets/chat_input_bar.dart:343 — apps/mobile/lib/widgets/chat_input_bar.dart:343-361 | apps/mobile/lib/widgets/chat_input_bar.dart:419-437 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×6
  • Duplicated block (17 lines × 2) apps/mobile/lib/features/codex_session/widgets/tool_suggestion_card.dart:37 — apps/mobile/lib/features/codex_session/widgets/tool_suggestion_card.dart:37-53 | apps/mobile/lib/widgets/approval_bar.dart:56-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) apps/mobile/lib/features/file_browser/state/file_browser_cubit.dart:365 — apps/mobile/lib/features/file_browser/state/file_browser_cubit.dart:365-381 | apps/mobile/lib/features/file_browser/state/file_browser_cubit.dart:391-407 — 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.
  • Duplicated block (17 lines × 2) apps/mobile/lib/features/session_list/session_list_screen.dart:2408 — apps/mobile/lib/features/session_list/session_list_screen.dart:2408-2424 | apps/mobile/lib/features/session_list/session_list_screen.dart:2795-2811 — 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.
  • Duplicated block (17 lines × 2) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:622 — apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:622-638 | apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:780-796 — 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.
  • Duplicated block (17 lines × 2) apps/mobile/lib/widgets/file_mention_overlay.dart:47 — apps/mobile/lib/widgets/file_mention_overlay.dart:47-63 | apps/mobile/lib/widgets/slash_command_overlay.dart:43-59 — before extracting anything, compare `apps/mobile/lib/widgets/file_mention_overlay.dart` and `apps/mobile/lib/widgets/slash_command_overlay.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) apps/mobile/lib/widgets/file_mention_overlay.dart:166 — apps/mobile/lib/widgets/file_mention_overlay.dart:166-182 | apps/mobile/lib/widgets/slash_command_overlay.dart:91-107 — before extracting anything, compare `apps/mobile/lib/widgets/file_mention_overlay.dart` and `apps/mobile/lib/widgets/slash_command_overlay.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×6
  • Duplicated block (11 lines × 2) apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1136 — apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1136-1146 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1241-1251 — 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.
  • Duplicated block (11 lines × 2) apps/mobile/lib/features/gallery/widgets/gallery_empty_state.dart:17 — apps/mobile/lib/features/gallery/widgets/gallery_empty_state.dart:17-27 | apps/mobile/lib/features/session_list/widgets/session_list_empty_state.dart:21-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) apps/mobile/lib/models/messages.dart:4530 — apps/mobile/lib/models/messages.dart:4530-4540 | apps/mobile/lib/models/messages.dart:4886-4896 — 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.
  • Duplicated block (11 lines × 2) apps/mobile/lib/models/messages.dart:4542 — apps/mobile/lib/models/messages.dart:4542-4552 | apps/mobile/lib/models/messages.dart:4909-4919 — 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.
  • Duplicated block (11 lines × 2) apps/mobile/lib/models/messages.dart:5417 — apps/mobile/lib/models/messages.dart:5417-5427 | apps/mobile/lib/models/messages.dart:5492-5502 — 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.
  • Duplicated block (11 lines × 2) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:384 — apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:384-394 | apps/mobile/lib/widgets/bubbles/question_answer_transcript_bubble.dart:26-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×5
  • Duplicated block (7 lines × 2) apps/mobile/lib/features/claude_session/widgets/rewind_action_sheet.dart:149 — apps/mobile/lib/features/claude_session/widgets/rewind_action_sheet.dart:149-155 | apps/mobile/lib/features/session_list/session_list_screen.dart:663-669 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) apps/mobile/lib/widgets/chat_input_bar.dart:1142 — apps/mobile/lib/widgets/chat_input_bar.dart:1142-1148 | apps/mobile/lib/widgets/chat_input_bar.dart:1204-1210 — 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.
  • Duplicated block (7 lines × 2) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:314 — apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:314-320 | apps/mobile/lib/widgets/session_card.dart:1654-1660 — before extracting anything, compare `apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart` and `apps/mobile/lib/widgets/session_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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 × 2) apps/mobile/macos/Runner/AppDelegate.swift:6 — apps/mobile/macos/Runner/AppDelegate.swift:6-12 | apps/mobile_preview/macos/Runner/AppDelegate.swift:6-12 — before extracting anything, compare `apps/mobile/macos/Runner/AppDelegate.swift` and `apps/mobile_preview/macos/Runner/AppDelegate.swift` 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 1 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 × 2) apps/menubar/CCPocketMenubar/ViewModels/DoctorViewModel.swift:396 — apps/menubar/CCPocketMenubar/ViewModels/DoctorViewModel.swift:396-402 | apps/menubar/CCPocketMenubar/ViewModels/UsageViewModel.swift:34-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×5
  • Duplicated block (17 lines × 2 locations) packages/bridge/src/parser.ts:1589 — packages/bridge/src/parser.ts:1589 · packages/bridge/src/parser.ts:1630 — 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.
  • Duplicated block (17 lines × 2 locations) packages/bridge/src/sessions-index.ts:2153 — packages/bridge/src/sessions-index.ts:2153 · packages/bridge/src/sessions-index.ts:2204 — 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.
  • Duplicated block (17 lines × 2 locations) packages/bridge/src/sessions-index.ts:3866 — packages/bridge/src/sessions-index.ts:3866 · packages/bridge/src/sessions-index.ts:3987 — 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.
  • Duplicated block (17 lines × 2 locations) REDACTED:3118 — REDACTED:3118 · REDACTED:3196 — 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.
  • Duplicated block (17 lines × 2 locations) REDACTED:11036 — REDACTED:11036 · REDACTED:11083 — 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 (16 lines × 2 locations) · ×5
  • Duplicated block (16 lines × 2 locations) REDACTED:1483 — REDACTED:1483 · REDACTED:1570 — 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.
  • Duplicated block (16 lines × 2 locations) packages/bridge/src/parser.ts:1839 — packages/bridge/src/parser.ts:1839 · packages/bridge/src/parser.ts:1876 — 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.
  • Duplicated block (16 lines × 2 locations) packages/bridge/src/parser.ts:2354 — packages/bridge/src/parser.ts:2354 · packages/bridge/src/parser.ts:2411 — 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.
  • Duplicated block (16 lines × 2 locations) REDACTED:4836 — REDACTED:4836 · REDACTED:6859 — 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.
  • Duplicated block (16 lines × 2 locations) REDACTED:5051 — REDACTED:5051 · REDACTED:5085 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X28 · Index access outside its own emptiness guard · Index access outside its own emptiness guard · ×4
  • Index access outside its own emptiness guard apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1485 — This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`.
  • Index access outside its own emptiness guard apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1486 — This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[1]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 1 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`.
  • Index access outside its own emptiness guard apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1487 — This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[2]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 2 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`.
  • Index access outside its own emptiness guard apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1488 — This condition tests `bytes` for emptiness and then indexes it on a branch that test does not reach. `bytes[3]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `bytes` being empty — so an empty `bytes` indexes position 3 of nothing and throws. This same condition already shows the intended bracketing at line 1490: `bytes[8]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `bytes` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `bytes`.
AC3 · Page structure · Page without a main landmark · ×3
  • Page without a main landmark scripts/install-banner/template.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 scripts/install-banner/template.ja.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 scripts/voice-lab/index.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D31 · IaC & Container Security · Medium IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:466 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:466-486 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:507-527 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (21 lines × 2) apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:556 — apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:556-576 | apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:642-662 — 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.
  • Duplicated block (21 lines × 2) apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:545 — apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:545-565 | apps/mobile/lib/widgets/bubbles/tool_result_bubble.dart:313-333 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×3
  • Duplicated block (15 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:947 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:947-961 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1049-1063 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (15 lines × 2) apps/mobile/lib/widgets/file_mention_overlay.dart:88 — apps/mobile/lib/widgets/file_mention_overlay.dart:88-102 | apps/mobile/lib/widgets/slash_command_overlay.dart:65-79 — before extracting anything, compare `apps/mobile/lib/widgets/file_mention_overlay.dart` and `apps/mobile/lib/widgets/slash_command_overlay.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) apps/mobile/lib/widgets/new_session_sheet.dart:3266 — apps/mobile/lib/widgets/new_session_sheet.dart:3266-3280 | apps/mobile/lib/widgets/new_session_sheet.dart:3570-3584 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) apps/mobile/lib/features/git/git_screen.dart:565 — apps/mobile/lib/features/git/git_screen.dart:565-578 | apps/mobile/lib/features/git/git_screen.dart:654-667 — 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.
  • Duplicated block (14 lines × 2) apps/mobile/lib/features/session_list/session_list_screen.dart:1317 — apps/mobile/lib/features/session_list/session_list_screen.dart:1317-1330 | apps/mobile/lib/features/session_list/session_list_screen.dart:1360-1373 — 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.
  • Duplicated block (14 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:370 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:370-383 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:435-448 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×3
  • Duplicated block (5 lines × 2) apps/mobile/lib/services/app_icon_service.dart:52 — apps/mobile/lib/services/app_icon_service.dart:52-56 | apps/mobile/lib/services/revenuecat_service.dart:446-450 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:81 — apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:81-85 | apps/mobile/lib/widgets/session_card.dart:1427-1431 — before extracting anything, compare `apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart` and `apps/mobile/lib/widgets/session_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 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 × 2) apps/mobile/lib/features/settings/widgets/prompt_history_section.dart:373 — apps/mobile/lib/features/settings/widgets/prompt_history_section.dart:373-377 | apps/mobile/lib/features/settings/widgets/prompt_history_section.dart:422-426 — 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 (18 lines × 2 locations) · ×3
  • Duplicated block (18 lines × 2 locations) REDACTED:7009 — REDACTED:7009 · REDACTED:7039 — 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.
  • Duplicated block (18 lines × 2 locations) REDACTED:7893 — REDACTED:7893 · REDACTED:8069 — 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.
  • Duplicated block (18 lines × 2 locations) REDACTED:10615 — REDACTED:10615 · REDACTED:10746 — 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 (14 lines × 2 locations) · ×3
  • Duplicated block (14 lines × 2 locations) REDACTED:3641 — REDACTED:3641 · REDACTED:3899 — 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.
  • Duplicated block (14 lines × 2 locations) REDACTED:3778 — REDACTED:3778 · REDACTED:3963 — 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.
  • Duplicated block (14 lines × 2 locations) packages/bridge/src/parser.ts:1693 — packages/bridge/src/parser.ts:1693 · packages/bridge/src/parser.ts:2092 — 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.
R11 · Import Boundaries · Boundary violation [package · ×3
  • Boundary violation [package:relative-cross-package] scripts/benchmark-desktop.mts:15 — scripts/benchmark-desktop.mts:15 reaches into another package with a relative path (../packages/bridge/src/media-store.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] scripts/benchmark-desktop.mts:16 — scripts/benchmark-desktop.mts:16 reaches into another package with a relative path (../packages/bridge/src/text-preview.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] scripts/verify-finder-sandbox.mts:12 — scripts/verify-finder-sandbox.mts:12 reaches into another package with a relative path (../packages/bridge/src/finder-reveal.js) — import the package by name instead.
X18 · Disposal-pattern correctness · Owned disposable field is never released · ×3
  • Owned disposable field is never released apps/mobile/lib/services/bridge_service.dart:91 — `BridgeService` carries a disposal duty — it declares its own release — and it creates `_recordingListController` itself (line 91, `StreamController.broadcast`), which makes that instance its own. Nothing in the class releases it — no `_recordingListController.close()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `StreamController.broadcast` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_recordingListController.close();` in `dispose()` before `super.dispose()`.
  • Owned disposable field is never released apps/mobile/lib/services/bridge_service.dart:93 — `BridgeService` carries a disposal duty — it declares its own release — and it creates `_recordingContentController` itself (line 93, `StreamController.broadcast`), which makes that instance its own. Nothing in the class releases it — no `_recordingContentController.close()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `StreamController.broadcast` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_recordingContentController.close();` in `dispose()` before `super.dispose()`.
  • Owned disposable field is never released apps/mobile/lib/services/bridge_service.dart:107 — `BridgeService` carries a disposal duty — it declares its own release — and it creates `_fileContentController` itself (line 107, `StreamController.broadcast`), which makes that instance its own. Nothing in the class releases it — no `_fileContentController.close()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `StreamController.broadcast` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_fileContentController.close();` in `dispose()` before `super.dispose()`.
D10 · Test Quality · No assertions · ×2
  • No assertions: echoes a new project's automatic initial prompt to its Claude client packages/bridge/src/websocket.test.ts:6351 — 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: converts dollar skills in a Claude initial prompt once skills arrive packages/bridge/src/websocket.test.ts:6361 — 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 · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×2
  • Change-coupling hub: streaming_bubble.dart → assistant_bubble.dart, plan_card.dart, result_chip.dart, plan_detail_sheet.dart apps/mobile/lib/widgets/bubbles/streaming_bubble.dart — `apps/mobile/lib/widgets/bubbles/streaming_bubble.dart` changes together with 4 other files — `apps/mobile/lib/widgets/bubbles/assistant_bubble.dart`, `apps/mobile/lib/widgets/bubbles/plan_card.dart`, `apps/mobile/lib/widgets/bubbles/result_chip.dart`, `apps/mobile/lib/widgets/plan_detail_sheet.dart` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
  • Change-coupling hub: REDACTED → chat_session_state.dart, mock_bridge_service.dart, message_bubble.dart REDACTED — `REDACTED` changes together with 3 other files — `apps/mobile/lib/features/chat_session/state/chat_session_state.dart`, `apps/mobile/lib/services/mock_bridge_service.dart`, `apps/mobile/lib/widgets/message_bubble.dart` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) apps/mobile/lib/services/store_screenshot_extension.dart:663 — apps/mobile/lib/services/store_screenshot_extension.dart:663-690 | apps/mobile/lib/services/store_screenshot_extension.dart:818-847 | apps/mobile/lib/services/store_screenshot_extension.dart:963-989 | apps/mobile/lib/services/store_screenshot_extension.dart:1719-1753 — These 4 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 4 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 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) apps/menubar/CCPocketMenubar/Views/DoctorPage/DoctorPageView.swift:201 — apps/menubar/CCPocketMenubar/Views/DoctorPage/DoctorPageView.swift:201-261 | apps/menubar/CCPocketMenubar/Views/OnboardingView.swift:44-120 | apps/menubar/CCPocketMenubar/Views/QRCodePage/QRCodePageView.swift:6-120 | apps/menubar/CCPocketMenubar/Views/UsagePage/UsagePageView.swift:44-77 — These 4 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 4 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 4 times.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1150 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1150-1180 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1273-1303 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (31 lines × 2) apps/mobile/lib/features/session_list/session_list_screen.dart:2649 — apps/mobile/lib/features/session_list/session_list_screen.dart:2649-2679 | apps/mobile/lib/features/settings/settings_screen.dart:344-374 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×2
  • Duplicated block (30 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1358 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1358-1387 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1504-1533 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (30 lines × 2) apps/mobile/lib/models/messages.dart:5445 — apps/mobile/lib/models/messages.dart:5445-5474 | apps/mobile/lib/services/bridge_service.dart:3680-3709 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) apps/mobile/lib/features/chat_session/widgets/codex_settings_sheet.dart:220 — apps/mobile/lib/features/chat_session/widgets/codex_settings_sheet.dart:220-241 | apps/mobile/lib/widgets/claude_settings_panel.dart:311-332 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (22 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1288 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1288-1309 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1410-1431 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1155 — apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1155-1174 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1269-1288 — 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.
  • Duplicated block (20 lines × 2) apps/mobile/lib/widgets/session_card.dart:1862 — apps/mobile/lib/widgets/session_card.dart:1862-1881 | apps/mobile/lib/widgets/session_card.dart:1933-1952 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:928 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:928-945 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1030-1047 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (18 lines × 2) apps/mobile/lib/widgets/bubbles/plan_card.dart:187 — apps/mobile/lib/widgets/bubbles/plan_card.dart:187-204 | apps/mobile/lib/widgets/bubbles/streaming_bubble.dart:159-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) apps/mobile/lib/features/git/widgets/diff_content_list.dart:248 — apps/mobile/lib/features/git/widgets/diff_content_list.dart:248-265 | apps/mobile/lib/features/git/widgets/diff_hunk_widget.dart:514-529 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16–18 lines × 2) apps/mobile/lib/widgets/codex_effort_slider.dart:374 — apps/mobile/lib/widgets/codex_effort_slider.dart:374-389 | apps/mobile/lib/widgets/codex_effort_slider.dart:438-455 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:216 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:216-231 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:237-252 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (16 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1135 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1135-1150 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1256-1271 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) apps/mobile/lib/models/messages.dart:5005 — apps/mobile/lib/models/messages.dart:5005-5019 | apps/mobile/lib/models/messages.dart:5447-5461 | apps/mobile/lib/services/bridge_service.dart:3682-3696 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (15 lines × 3) apps/mobile/lib/widgets/bubbles/result_chip.dart:79 — apps/mobile/lib/widgets/bubbles/result_chip.dart:79-93 | apps/mobile/lib/widgets/bubbles/user_bubble.dart:336-350 | apps/mobile/lib/widgets/bubbles/user_bubble.dart:478-492 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
R10 · Code Duplication · Duplicated block (35 lines × 2 locations) · ×2
  • Duplicated block (35 lines × 2 locations) REDACTED:5292 — REDACTED:5292 · REDACTED:5383 — 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.
  • Duplicated block (35 lines × 2 locations) REDACTED:8330 — REDACTED:8330 · REDACTED:8380 — 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 (34 lines × 2 locations) · ×2
  • Duplicated block (34 lines × 2 locations) packages/bridge/src/setup-launchd.ts:92 — packages/bridge/src/setup-launchd.ts:92 · packages/bridge/src/setup-systemd.ts:147 — 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.
  • Duplicated block (34 lines × 2 locations) REDACTED:9228 — REDACTED:9228 · REDACTED:9281 — 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.
R10 · Code Duplication · Duplicated block (25 lines × 2 locations) · ×2
  • Duplicated block (25 lines × 2 locations) REDACTED:2980 — REDACTED:2980 · REDACTED:3010 — 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.
  • Duplicated block (25 lines × 2 locations) REDACTED:4272 — REDACTED:4272 · REDACTED:4299 — 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 (24 lines × 2 locations) · ×2
  • Duplicated block (24 lines × 2 locations) REDACTED:4761 — REDACTED:4761 · REDACTED:5412 — 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.
  • Duplicated block (24 lines × 2 locations) REDACTED:6950 — REDACTED:6950 · REDACTED:6978 — 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 (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) packages/bridge/src/parser.ts:1953 — packages/bridge/src/parser.ts:1953 · packages/bridge/src/parser.ts:1973 — 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.
  • Duplicated block (15 lines × 2 locations) packages/bridge/src/parser.ts:2182 — packages/bridge/src/parser.ts:2182 · packages/bridge/src/parser.ts:2200 — 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) scripts/voice-lab/server.mjs:54 — `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) scripts/voice-lab/server.mjs:76 — `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.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung package.json:1 — No accessibility enforcement found — no a11y linter (an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have) and no axe/pa11y/Lighthouse in tests or CI. Start by running that check over your rendered pages in CI. What was searched, so you can tell an absence from a miss: the 4 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 · BridgeWebSocketServer.handleClientMessage (cyclomatic 701) · ×1
  • BridgeWebSocketServer.handleClientMessage (cyclomatic 701) REDACTED:3462 — BridgeWebSocketServer.handleClientMessage has cyclomatic complexity 701 (threshold 15). Of this number, 550 points are the body's own statements and 151 belong to 48 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 · parser.parseClientMessage (cyclomatic 555) · ×1
  • parser.parseClientMessage (cyclomatic 555) packages/bridge/src/parser.ts:1464 — parser.parseClientMessage has cyclomatic complexity 555 (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. This shape REPEATS in the file: one other method here (parser.parseClientMessage::isPromptHistoryEntry) 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.
D1 · Cyclomatic Complexity · ChatInputWithOverlays.build (cyclomatic 182) · ×1
  • ChatInputWithOverlays.build (cyclomatic 182) apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:104 — ChatInputWithOverlays.build has cyclomatic complexity 182 (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 · BridgeService.connect (cyclomatic 139) · ×1
  • BridgeService.connect (cyclomatic 139) apps/mobile/lib/services/bridge_service.dart:782 — BridgeService.connect has cyclomatic complexity 139 (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 · ChatSessionCubit._applyUpdate (cyclomatic 115) · ×1
  • ChatSessionCubit._applyUpdate (cyclomatic 115) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:662 — ChatSessionCubit._applyUpdate has cyclomatic complexity 115 (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 · _CodexChatBody.build (cyclomatic 107) · ×1
  • _CodexChatBody.build (cyclomatic 107) apps/mobile/lib/features/codex_session/codex_session_screen.dart:664 — _CodexChatBody.build has cyclomatic complexity 107 (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 · HomeContentState._buildContent (cyclomatic 101) · ×1
  • HomeContentState._buildContent (cyclomatic 101) apps/mobile/lib/features/session_list/widgets/home_content.dart:573 — HomeContentState._buildContent has cyclomatic complexity 101 (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 · ServerMessage.fromJson (cyclomatic 94) · ×1
  • ServerMessage.fromJson (cyclomatic 94) apps/mobile/lib/models/messages.dart:807 — ServerMessage.fromJson has cyclomatic complexity 94 (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 · ServerMessageWidget.build (cyclomatic 88) · ×1
  • ServerMessageWidget.build (cyclomatic 88) apps/mobile/lib/widgets/message_bubble.dart:245 — ServerMessageWidget.build has cyclomatic complexity 88 (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 · _ChatScreenBody.build (cyclomatic 85) · ×1
  • _ChatScreenBody.build (cyclomatic 85) apps/mobile/lib/features/claude_session/claude_session_screen.dart:604 — _ChatScreenBody.build has cyclomatic complexity 85 (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 · sessions-index.parseCodexSessionJsonl (cyclomatic 81) · ×1
  • sessions-index.parseCodexSessionJsonl (cyclomatic 81) packages/bridge/src/sessions-index.ts:1559 — sessions-index.parseCodexSessionJsonl has cyclomatic complexity 81 (threshold 15). Of this number, 79 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 · SessionManager.create · ×1
  • SessionManager.create::processMessage (cyclomatic 80) packages/bridge/src/session.ts:502 — SessionManager.create::processMessage 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. This shape REPEATS in the file: one other method here (SessionManager.create) 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.
D1 · Cyclomatic Complexity · CodexProcess.bootstrap (cyclomatic 72) · ×1
  • CodexProcess.bootstrap (cyclomatic 72) REDACTED:2051 — CodexProcess.bootstrap has cyclomatic complexity 72 (threshold 15). Of this number, 71 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 · sessions-index.parseFromChunks (cyclomatic 68) · ×1
  • sessions-index.parseFromChunks (cyclomatic 68) packages/bridge/src/sessions-index.ts:560 — sessions-index.parseFromChunks has cyclomatic complexity 68 (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 · sessions-index.getCodexSessionHistory (cyclomatic 67) · ×1
  • sessions-index.getCodexSessionHistory (cyclomatic 67) packages/bridge/src/sessions-index.ts:4224 — sessions-index.getCodexSessionHistory has cyclomatic complexity 67 (threshold 15). Of this number, 65 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 · _OptionsSection.build (cyclomatic 63) · ×1
  • _OptionsSection.build (cyclomatic 63) apps/mobile/lib/widgets/new_session_sheet.dart:2819 — _OptionsSection.build has cyclomatic complexity 63 (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 · sessions-index.getAllRecentSessions (cyclomatic 60) · ×1
  • sessions-index.getAllRecentSessions (cyclomatic 60) packages/bridge/src/sessions-index.ts:1119 — sessions-index.getAllRecentSessions has cyclomatic complexity 60 (threshold 15). Of this number, 32 points are the body's own statements and 28 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 · SdkProcess.processMessages (cyclomatic 59) · ×1
  • SdkProcess.processMessages (cyclomatic 59) packages/bridge/src/sdk-process.ts:1733 — SdkProcess.processMessages has cyclomatic complexity 59 (threshold 15). 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, separate the cases: extract each independent 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 · CodexProcess.handleNotification (cyclomatic 54) · ×1
  • CodexProcess.handleNotification (cyclomatic 54) REDACTED:3149 — CodexProcess.handleNotification has cyclomatic complexity 54 (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 · CodexProcess.processItemCompleted (cyclomatic 53) · ×1
  • CodexProcess.processItemCompleted (cyclomatic 53) REDACTED:3729 — CodexProcess.processItemCompleted has cyclomatic complexity 53 (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 · ChatMessageHandler._handleHistory (cyclomatic 49) · ×1
  • ChatMessageHandler._handleHistory (cyclomatic 49) apps/mobile/lib/services/chat_message_handler.dart:644 — ChatMessageHandler._handleHistory has cyclomatic complexity 49 (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 · WorkspaceShellScreenState.build (cyclomatic 48) · ×1
  • WorkspaceShellScreenState.build (cyclomatic 48) apps/mobile/lib/features/session_list/workspace_shell_screen.dart:663 — WorkspaceShellScreenState.build has cyclomatic complexity 48 (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 · sessions-index.codexThreadToSessionHistory (cyclomatic 48) · ×1
  • sessions-index.codexThreadToSessionHistory (cyclomatic 48) packages/bridge/src/sessions-index.ts:2845 — sessions-index.codexThreadToSessionHistory has cyclomatic complexity 48 (threshold 15). Of this number, 43 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 · _RunningSessionCardState.build (cyclomatic 47) · ×1
  • _RunningSessionCardState.build (cyclomatic 47) apps/mobile/lib/widgets/session_card.dart:98 — _RunningSessionCardState.build has cyclomatic complexity 47 (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 · BridgeWebSocketServer.buildSessionCreatedMessage (cyclomatic 46) · ×1
  • BridgeWebSocketServer.buildSessionCreatedMessage (cyclomatic 46) REDACTED:1713 — BridgeWebSocketServer.buildSessionCreatedMessage has cyclomatic complexity 46 (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 · FilePeekContentState.build (cyclomatic 45) · ×1
  • FilePeekContentState.build (cyclomatic 45) apps/mobile/lib/features/file_peek/file_peek_sheet.dart:420 — FilePeekContentState.build has cyclomatic complexity 45 (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 · _SessionListScreenState._startNewSession (cyclomatic 44) · ×1
  • _SessionListScreenState._startNewSession (cyclomatic 44) apps/mobile/lib/features/session_list/session_list_screen.dart:926 — _SessionListScreenState._startNewSession has cyclomatic complexity 44 (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 · _SessionListScreenState._resumeSessionWithParams (cyclomatic 44) · ×1
  • _SessionListScreenState._resumeSessionWithParams (cyclomatic 44) apps/mobile/lib/features/session_list/session_list_screen.dart:1589 — _SessionListScreenState._resumeSessionWithParams has cyclomatic complexity 44 (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 · sdk-process.convertSdkMessage (cyclomatic 44) · ×1
  • sdk-process.convertSdkMessage (cyclomatic 44) packages/bridge/src/sdk-process.ts:644 — sdk-process.convertSdkMessage has cyclomatic complexity 44 (threshold 15). Of this number, 39 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 · sessions-index.getSessionHistory (cyclomatic 42) · ×1
  • sessions-index.getSessionHistory (cyclomatic 42) packages/bridge/src/sessions-index.ts:3618 — sessions-index.getSessionHistory has cyclomatic complexity 42 (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 · ChatMessageHandler._handleSystem (cyclomatic 40) · ×1
  • ChatMessageHandler._handleSystem (cyclomatic 40) apps/mobile/lib/services/chat_message_handler.dart:802 — ChatMessageHandler._handleSystem 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 · performance-mode.performanceMessage (cyclomatic 39) · ×1
  • performance-mode.performanceMessage (cyclomatic 39) packages/bridge/src/performance-mode.ts:6 — performance-mode.performanceMessage has cyclomatic complexity 39 (threshold 15). Of this number, 25 points are the body's own statements and 14 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 · BridgeWebSocketServer.maybeSendPushNotification (cyclomatic 39) · ×1
  • BridgeWebSocketServer.maybeSendPushNotification (cyclomatic 39) REDACTED:10547 — BridgeWebSocketServer.maybeSendPushNotification has cyclomatic complexity 39 (threshold 15). Of this number, 38 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 · _SessionListScreenState.initState (cyclomatic 38) · ×1
  • _SessionListScreenState.initState (cyclomatic 38) apps/mobile/lib/features/session_list/session_list_screen.dart:320 — _SessionListScreenState.initState 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 · MockBridgeService.send (cyclomatic 38) · ×1
  • MockBridgeService.send (cyclomatic 38) apps/mobile/lib/services/mock_bridge_service.dart:149 — MockBridgeService.send has cyclomatic complexity 38 (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 · ChatSessionCubit.sendMessage (cyclomatic 37) · ×1
  • ChatSessionCubit.sendMessage (cyclomatic 37) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1817 — ChatSessionCubit.sendMessage has cyclomatic complexity 37 (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 · server.wss.on("connection") (cyclomatic 37) · ×1
  • server.wss.on("connection") (cyclomatic 37) scripts/voice-lab/server.mjs:27 — server.wss.on("connection") has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 6 of the 37 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 75, a function literal at line 53, cleanup, …). 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 · _SessionListScreenState._connectWithParams (cyclomatic 36) · ×1
  • _SessionListScreenState._connectWithParams (cyclomatic 36) apps/mobile/lib/features/session_list/session_list_screen.dart:539 — _SessionListScreenState._connectWithParams 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 · _MachineEditSheetState._save (cyclomatic 35) · ×1
  • _MachineEditSheetState._save (cyclomatic 35) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:282 — _MachineEditSheetState._save has cyclomatic complexity 35 (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 · ChatMessageHandler.handle (cyclomatic 35) · ×1
  • ChatMessageHandler.handle (cyclomatic 35) apps/mobile/lib/services/chat_message_handler.dart:213 — ChatMessageHandler.handle has cyclomatic complexity 35 (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 · _NewSessionSheetContentState._buildParams (cyclomatic 34) · ×1
  • _NewSessionSheetContentState._buildParams (cyclomatic 34) apps/mobile/lib/widgets/new_session_sheet.dart:1524 — _NewSessionSheetContentState._buildParams 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 · CodexProcess.runInputLoop (cyclomatic 34) · ×1
  • CodexProcess.runInputLoop (cyclomatic 34) REDACTED:2697 — CodexProcess.runInputLoop has cyclomatic complexity 34 (threshold 15). Of this number, 16 points are the body's own statements and 18 belong to 5 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 · _GitScreenBodyState.build (cyclomatic 33) · ×1
  • _GitScreenBodyState.build (cyclomatic 33) apps/mobile/lib/features/git/git_screen.dart:323 — _GitScreenBodyState.build has cyclomatic complexity 33 (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 · SessionResumeCoordinator.resume (cyclomatic 33) · ×1
  • SessionResumeCoordinator.resume (cyclomatic 33) apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart:155 — SessionResumeCoordinator.resume has cyclomatic complexity 33 (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 · ChatSessionCubit._onMessage (cyclomatic 32) · ×1
  • ChatSessionCubit._onMessage (cyclomatic 32) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:442 — ChatSessionCubit._onMessage has cyclomatic complexity 32 (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 · MachineManagerService.checkHealth (cyclomatic 32) · ×1
  • MachineManagerService.checkHealth (cyclomatic 32) apps/mobile/lib/services/machine_manager_service.dart:703 — MachineManagerService.checkHealth 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 · SessionManager.rewindInPlace (cyclomatic 32) · ×1
  • SessionManager.rewindInPlace (cyclomatic 32) packages/bridge/src/session.ts:1947 — SessionManager.rewindInPlace has cyclomatic complexity 32 (threshold 15). Of this number, 25 points are the body's own statements and 7 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 · _ChatMessageListState.build (cyclomatic 29) · ×1
  • _ChatMessageListState.build (cyclomatic 29) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:584 — _ChatMessageListState.build has cyclomatic complexity 29 (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 · _NewSessionSheetContentState._allProjectChoices (cyclomatic 29) · ×1
  • _NewSessionSheetContentState._allProjectChoices (cyclomatic 29) apps/mobile/lib/widgets/new_session_sheet.dart:762 — _NewSessionSheetContentState._allProjectChoices 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 · sdk-process.buildAskUserAnswers (cyclomatic 29) · ×1
  • sdk-process.buildAskUserAnswers (cyclomatic 29) packages/bridge/src/sdk-process.ts:297 — sdk-process.buildAskUserAnswers has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 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 · _MachineEditSheetState.build (cyclomatic 28) · ×1
  • _MachineEditSheetState.build (cyclomatic 28) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:405 — _MachineEditSheetState.build has cyclomatic complexity 28 (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 · CodexProcess.readThread (cyclomatic 28) · ×1
  • CodexProcess.readThread (cyclomatic 28) REDACTED:725 — CodexProcess.readThread has cyclomatic complexity 28 (threshold 15). Of this number, 23 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 · project-bootstrap.bootstrapProject (cyclomatic 28) · ×1
  • project-bootstrap.bootstrapProject (cyclomatic 28) packages/bridge/src/project-bootstrap.ts:12 — project-bootstrap.bootstrapProject has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 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 · SdkProcess.startSdkQuery (cyclomatic 27) · ×1
  • SdkProcess.startSdkQuery (cyclomatic 27) packages/bridge/src/sdk-process.ts:1072 — SdkProcess.startSdkQuery has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 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 · sessions-index.hydrateClaudeIndexedEntry (cyclomatic 27) · ×1
  • sessions-index.hydrateClaudeIndexedEntry (cyclomatic 27) packages/bridge/src/sessions-index.ts:864 — sessions-index.hydrateClaudeIndexedEntry 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 · sessions-index.normalizeCodexMcpResult (cyclomatic 27) · ×1
  • sessions-index.normalizeCodexMcpResult (cyclomatic 27) packages/bridge/src/sessions-index.ts:3288 — sessions-index.normalizeCodexMcpResult 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 · directory-listing.listAllowedDirectories (cyclomatic 27) · ×1
  • directory-listing.listAllowedDirectories (cyclomatic 27) packages/bridge/src/directory-listing.ts:81 — directory-listing.listAllowedDirectories 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 · index.startServer (cyclomatic 27) · ×1
  • index.startServer (cyclomatic 27) packages/bridge/src/index.ts:38 — index.startServer has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 164, a function literal at line 256, shutdown). 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 · BridgeService._routeProjectRequestError (cyclomatic 26) · ×1
  • BridgeService._routeProjectRequestError (cyclomatic 26) apps/mobile/lib/services/bridge_service.dart:1349 — BridgeService._routeProjectRequestError 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 · BridgeService._flushMessageQueueAsync (cyclomatic 26) · ×1
  • BridgeService._flushMessageQueueAsync (cyclomatic 26) apps/mobile/lib/services/bridge_service.dart:2316 — BridgeService._flushMessageQueueAsync 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 · BridgeService.resolveSessionLink (cyclomatic 26) · ×1
  • BridgeService.resolveSessionLink (cyclomatic 26) apps/mobile/lib/services/bridge_service.dart:2957 — BridgeService.resolveSessionLink 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 · BridgeWebSocketServer.applyCodexCanonicalHistoryBaseline (cyclomatic 26) · ×1
  • BridgeWebSocketServer.applyCodexCanonicalHistoryBaseline (cyclomatic 26) REDACTED:2558 — BridgeWebSocketServer.applyCodexCanonicalHistoryBaseline has cyclomatic complexity 26 (threshold 15). Of this number, 22 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 · codex-recovery.rateLimitFailure · ×1
  • codex-recovery.rateLimitFailure::visit (cyclomatic 25) packages/bridge/src/codex-recovery.ts:16 — codex-recovery.rateLimitFailure::visit 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 · sessions-index.extractMissingFieldsStreaming (cyclomatic 25) · ×1
  • sessions-index.extractMissingFieldsStreaming (cyclomatic 25) packages/bridge/src/sessions-index.ts:922 — sessions-index.extractMissingFieldsStreaming has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 949, 937, 984, …). 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 · CodexProcess._fetchCompletionEntitiesInternal (cyclomatic 25) · ×1
  • CodexProcess._fetchCompletionEntitiesInternal (cyclomatic 25) REDACTED:2487 — CodexProcess._fetchCompletionEntitiesInternal has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 2572, a function literal at line 2622, a function literal at line 2605, …). 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 · FileBrowserCubit._onMessage (cyclomatic 24) · ×1
  • FileBrowserCubit._onMessage (cyclomatic 24) apps/mobile/lib/features/file_browser/state/file_browser_cubit.dart:313 — FileBrowserCubit._onMessage 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.parseRelayBody (cyclomatic 24) · ×1
  • index.parseRelayBody (cyclomatic 24) functions/src/index.ts:158 — index.parseRelayBody 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 · sessions-index.claudeAbandonedBranchUuids (cyclomatic 24) · ×1
  • sessions-index.claudeAbandonedBranchUuids (cyclomatic 24) packages/bridge/src/sessions-index.ts:3551 — sessions-index.claudeAbandonedBranchUuids 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 · SessionManager.create (cyclomatic 24) · ×1
  • SessionManager.create (cyclomatic 24) packages/bridge/src/session.ts:398 — SessionManager.create 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. This shape REPEATS in the file: one other method here (SessionManager.create::processMessage) 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.
D1 · Cyclomatic Complexity · BridgeWebSocketServer.sendCompletionPush (cyclomatic 24) · ×1
  • BridgeWebSocketServer.sendCompletionPush (cyclomatic 24) REDACTED:10694 — BridgeWebSocketServer.sendCompletionPush 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, 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 · _ChatMessageListState._entryKeyBase (cyclomatic 23) · ×1
  • _ChatMessageListState._entryKeyBase (cyclomatic 23) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:932 — _ChatMessageListState._entryKeyBase has cyclomatic complexity 23 (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 · _FileBrowserViewState.build (cyclomatic 23) · ×1
  • _FileBrowserViewState.build (cyclomatic 23) apps/mobile/lib/features/file_browser/file_browser_view.dart:95 — _FileBrowserViewState.build has cyclomatic complexity 23 (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 · PermissionPresentation.from (cyclomatic 23) · ×1
  • PermissionPresentation.from (cyclomatic 23) apps/mobile/lib/models/messages.dart:2214 — PermissionPresentation.from 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 · ConnectionUrlParser.parse (cyclomatic 23) · ×1
  • ConnectionUrlParser.parse (cyclomatic 23) apps/mobile/lib/services/connection_url_parser.dart:18 — ConnectionUrlParser.parse 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 · MachineManagerService.updateMachine (cyclomatic 23) · ×1
  • MachineManagerService.updateMachine (cyclomatic 23) apps/mobile/lib/services/machine_manager_service.dart:581 — MachineManagerService.updateMachine has cyclomatic complexity 23 (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 · _InputTextFieldState._handleKeyEvent (cyclomatic 23) · ×1
  • _InputTextFieldState._handleKeyEvent (cyclomatic 23) apps/mobile/lib/widgets/chat_input_bar.dart:968 — _InputTextFieldState._handleKeyEvent has cyclomatic complexity 23 (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 · CodexProcess.handleServerRequest (cyclomatic 23) · ×1
  • CodexProcess.handleServerRequest (cyclomatic 23) REDACTED:2943 — CodexProcess.handleServerRequest 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 · codex-process.normalizeMcpToolResult (cyclomatic 23) · ×1
  • codex-process.normalizeMcpToolResult (cyclomatic 23) REDACTED:4947 — codex-process.normalizeMcpToolResult 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 · SessionManager.isSameUserInput (cyclomatic 23) · ×1
  • SessionManager.isSameUserInput (cyclomatic 23) packages/bridge/src/session.ts:1298 — SessionManager.isSameUserInput has cyclomatic complexity 23 (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 · setup-systemd.setupSystemd (cyclomatic 23) · ×1
  • setup-systemd.setupSystemd (cyclomatic 23) packages/bridge/src/setup-systemd.ts:96 — setup-systemd.setupSystemd has cyclomatic complexity 23 (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 · MachineManagerService._migrateIfNeeded (cyclomatic 22) · ×1
  • MachineManagerService._migrateIfNeeded (cyclomatic 22) apps/mobile/lib/services/machine_manager_service.dart:108 — MachineManagerService._migrateIfNeeded 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 · recent-session-search.transcriptLineMessageTexts (cyclomatic 22) · ×1
  • recent-session-search.transcriptLineMessageTexts (cyclomatic 22) REDACTED:137 — recent-session-search.transcriptLineMessageTexts 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 · sessions-index.getCodexSessionIndexMetadata (cyclomatic 22) · ×1
  • sessions-index.getCodexSessionIndexMetadata (cyclomatic 22) packages/bridge/src/sessions-index.ts:2602 — sessions-index.getCodexSessionIndexMetadata has cyclomatic complexity 22 (threshold 15). Of this number, 16 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 · CodexProcess.listAvailableModelMetadata (cyclomatic 22) · ×1
  • CodexProcess.listAvailableModelMetadata (cyclomatic 22) REDACTED:1025 — CodexProcess.listAvailableModelMetadata 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 · skill-triggers.convertSkillTriggers (cyclomatic 22) · ×1
  • skill-triggers.convertSkillTriggers (cyclomatic 22) packages/bridge/src/skill-triggers.ts:129 — skill-triggers.convertSkillTriggers 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 · BridgeWebSocketServer.listRecentSessions (cyclomatic 22) · ×1
  • BridgeWebSocketServer.listRecentSessions (cyclomatic 22) REDACTED:9548 — BridgeWebSocketServer.listRecentSessions has cyclomatic complexity 22 (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 · setup-launchd.setupLaunchd (cyclomatic 22) · ×1
  • setup-launchd.setupLaunchd (cyclomatic 22) packages/bridge/src/setup-launchd.ts:47 — setup-launchd.setupLaunchd 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 · ChatSessionCubit._applySessionContext (cyclomatic 21) · ×1
  • ChatSessionCubit._applySessionContext (cyclomatic 21) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:571 — ChatSessionCubit._applySessionContext 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 · ChatSessionCubit._userEntryMatchIndex (cyclomatic 21) · ×1
  • ChatSessionCubit._userEntryMatchIndex (cyclomatic 21) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1439 — ChatSessionCubit._userEntryMatchIndex 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 · _FilePeekModelPreviewState._load (cyclomatic 21) · ×1
  • _FilePeekModelPreviewState._load (cyclomatic 21) apps/mobile/lib/features/file_peek/widgets/file_peek_model_preview.dart:48 — _FilePeekModelPreviewState._load 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 · BridgeUpdateStatusTile.build (cyclomatic 21) · ×1
  • BridgeUpdateStatusTile.build (cyclomatic 21) apps/mobile/lib/features/settings/widgets/bridge_update_status_tile.dart:95 — BridgeUpdateStatusTile.build 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 · sessions-index.buildClaudeMessageImageIndex (cyclomatic 21) · ×1
  • sessions-index.buildClaudeMessageImageIndex (cyclomatic 21) packages/bridge/src/sessions-index.ts:3870 — sessions-index.buildClaudeMessageImageIndex 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 · SessionManager.buildSessionSummary (cyclomatic 21) · ×1
  • SessionManager.buildSessionSummary (cyclomatic 21) packages/bridge/src/session.ts:1052 — SessionManager.buildSessionSummary has cyclomatic complexity 21 (threshold 15). Of this number, 18 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 · SessionManager.backfillUserUuidsFromDisk (cyclomatic 21) · ×1
  • SessionManager.backfillUserUuidsFromDisk (cyclomatic 21) packages/bridge/src/session.ts:2219 — SessionManager.backfillUserUuidsFromDisk 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 · GalleryScreen.build (cyclomatic 20) · ×1
  • GalleryScreen.build (cyclomatic 20) apps/mobile/lib/features/gallery/gallery_screen.dart:31 — GalleryScreen.build 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 · GalleryImageViewer.build (cyclomatic 20) · ×1
  • GalleryImageViewer.build (cyclomatic 20) apps/mobile/lib/features/gallery/widgets/gallery_image_viewer.dart:31 — GalleryImageViewer.build 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 · _GitScreenContent.build (cyclomatic 20) · ×1
  • _GitScreenContent.build (cyclomatic 20) apps/mobile/lib/features/git/git_screen.dart:900 — _GitScreenContent.build 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 · _NewProjectSheetState.build (cyclomatic 20) · ×1
  • _NewProjectSheetState.build (cyclomatic 20) apps/mobile/lib/features/project_setup/widgets/new_project_sheet.dart:138 — _NewProjectSheetState.build 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 · parser.parseClientMessage · ×1
  • parser.parseClientMessage::isPromptHistoryEntry (cyclomatic 20) packages/bridge/src/parser.ts:1479 — parser.parseClientMessage::isPromptHistoryEntry has cyclomatic complexity 20 (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. This shape REPEATS in the file: one other method here (parser.parseClientMessage) 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. This is NOT this file's highest cyclomatic complexity: parser.hasValidSessionOptions (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · recent-session-search.searchTranscriptFile (cyclomatic 20) · ×1
  • recent-session-search.searchTranscriptFile (cyclomatic 20) REDACTED:230 — recent-session-search.searchTranscriptFile has cyclomatic complexity 20 (threshold 15). Of this number, 15 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 · recent-session-search.searchRecentSessionContent (cyclomatic 20) · ×1
  • recent-session-search.searchRecentSessionContent (cyclomatic 20) REDACTED:355 — recent-session-search.searchRecentSessionContent has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 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 · sessions-index.getPinnedCodexSessions (cyclomatic 20) · ×1
  • sessions-index.getPinnedCodexSessions (cyclomatic 20) packages/bridge/src/sessions-index.ts:2394 — sessions-index.getPinnedCodexSessions has cyclomatic complexity 20 (threshold 15). Of this number, 16 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 · CodexProcess.handleTurnCompleted (cyclomatic 20) · ×1
  • CodexProcess.handleTurnCompleted (cyclomatic 20) REDACTED:3431 — CodexProcess.handleTurnCompleted 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 · codex-process.coerceElicitationValue (cyclomatic 20) · ×1
  • codex-process.coerceElicitationValue (cyclomatic 20) REDACTED:5350 — codex-process.coerceElicitationValue 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 · MediaStore.register (cyclomatic 20) · ×1
  • MediaStore.register (cyclomatic 20) packages/bridge/src/media-store.ts:103 — MediaStore.register has cyclomatic complexity 20 (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 · MediaStore.serveEntry (cyclomatic 20) · ×1
  • MediaStore.serveEntry (cyclomatic 20) packages/bridge/src/media-store.ts:209 — MediaStore.serveEntry 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 · BridgeWebSocketServer.collectImageChanges (cyclomatic 20) · ×1
  • BridgeWebSocketServer.collectImageChanges (cyclomatic 20) REDACTED:11213 — BridgeWebSocketServer.collectImageChanges 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 · doctor.printReport (cyclomatic 20) · ×1
  • doctor.printReport (cyclomatic 20) REDACTED:865 — doctor.printReport 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 · ChatSessionCubit._restorePendingInputMessages (cyclomatic 19) · ×1
  • ChatSessionCubit._restorePendingInputMessages (cyclomatic 19) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:335 — ChatSessionCubit._restorePendingInputMessages 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 · _ClaudeSessionScreenState._listenForSessionCreated (cyclomatic 19) · ×1
  • _ClaudeSessionScreenState._listenForSessionCreated (cyclomatic 19) apps/mobile/lib/features/claude_session/claude_session_screen.dart:253 — _ClaudeSessionScreenState._listenForSessionCreated 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 · _CodexSessionScreenState._listenForSessionCreated (cyclomatic 19) · ×1
  • _CodexSessionScreenState._listenForSessionCreated (cyclomatic 19) apps/mobile/lib/features/codex_session/codex_session_screen.dart:274 — _CodexSessionScreenState._listenForSessionCreated 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 · BridgeService.send (cyclomatic 19) · ×1
  • BridgeService.send (cyclomatic 19) apps/mobile/lib/services/bridge_service.dart:1927 — BridgeService.send 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 · BridgeService._sendRecentSessionsRequest (cyclomatic 19) · ×1
  • BridgeService._sendRecentSessionsRequest (cyclomatic 19) apps/mobile/lib/services/bridge_service.dart:3240 — BridgeService._sendRecentSessionsRequest 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 · BridgeService._clearTransportScopedRequestState (cyclomatic 19) · ×1
  • BridgeService._clearTransportScopedRequestState (cyclomatic 19) apps/mobile/lib/services/bridge_service.dart:3486 — BridgeService._clearTransportScopedRequestState 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 · ChatMessageHandler._buildCommandList (cyclomatic 19) · ×1
  • ChatMessageHandler._buildCommandList (cyclomatic 19) apps/mobile/lib/services/chat_message_handler.dart:1033 — ChatMessageHandler._buildCommandList 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 · PromptHistoryService.matchesFilters (cyclomatic 19) · ×1
  • PromptHistoryService.matchesFilters (cyclomatic 19) apps/mobile/lib/services/prompt_history_service.dart:674 — PromptHistoryService.matchesFilters 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 · _InputTextFieldState.didChangeAppLifecycleState (cyclomatic 19) · ×1
  • _InputTextFieldState.didChangeAppLifecycleState (cyclomatic 19) apps/mobile/lib/widgets/chat_input_bar.dart:862 — _InputTextFieldState.didChangeAppLifecycleState 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 · _StripPrimaryAction.build (cyclomatic 19) · ×1
  • _StripPrimaryAction.build (cyclomatic 19) apps/mobile/lib/widgets/chat_input_bar.dart:1524 — _StripPrimaryAction.build 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 · _ToolApprovalArea.build (cyclomatic 19) · ×1
  • _ToolApprovalArea.build (cyclomatic 19) apps/mobile/lib/widgets/session_card.dart:852 — _ToolApprovalArea.build 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 · RecentSessionCard.build (cyclomatic 19) · ×1
  • RecentSessionCard.build (cyclomatic 19) apps/mobile/lib/widgets/session_card.dart:2822 — RecentSessionCard.build 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 · SdkProcess.updateSettings (cyclomatic 19) · ×1
  • SdkProcess.updateSettings (cyclomatic 19) packages/bridge/src/sdk-process.ts:1480 — SdkProcess.updateSettings 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 · sessions-index.appendImageGenerationResult (cyclomatic 19) · ×1
  • sessions-index.appendImageGenerationResult (cyclomatic 19) packages/bridge/src/sessions-index.ts:3153 — sessions-index.appendImageGenerationResult 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 · CodexBackgroundTracker.observe (cyclomatic 19) · ×1
  • CodexBackgroundTracker.observe (cyclomatic 19) packages/bridge/src/codex-background-tracker.ts:37 — CodexBackgroundTracker.observe 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 · CodexProcess.installToolSuggestion (cyclomatic 19) · ×1
  • CodexProcess.installToolSuggestion (cyclomatic 19) REDACTED:1641 — CodexProcess.installToolSuggestion 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 · BridgeWebSocketServer.registerPastUserMessageImages (cyclomatic 19) · ×1
  • BridgeWebSocketServer.registerPastUserMessageImages (cyclomatic 19) REDACTED:3098 — BridgeWebSocketServer.registerPastUserMessageImages 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 · BridgeWebSocketServer.collectGitDiff (cyclomatic 19) · ×1
  • BridgeWebSocketServer.collectGitDiff (cyclomatic 19) REDACTED:10996 — BridgeWebSocketServer.collectGitDiff has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 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 · websocket.buildCodexHistoryPrefix (cyclomatic 19) · ×1
  • websocket.buildCodexHistoryPrefix (cyclomatic 19) REDACTED:400 — websocket.buildCodexHistoryPrefix has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 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 · ChatSessionCubit._entriesEquivalent (cyclomatic 18) · ×1
  • ChatSessionCubit._entriesEquivalent (cyclomatic 18) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1515 — ChatSessionCubit._entriesEquivalent 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 · FileTransferCubit.start (cyclomatic 18) · ×1
  • FileTransferCubit.start (cyclomatic 18) apps/mobile/lib/features/file_transfer/state/file_transfer_cubit.dart:63 — FileTransferCubit.start 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 · FileUploadCubit.start (cyclomatic 18) · ×1
  • FileUploadCubit.start (cyclomatic 18) apps/mobile/lib/features/file_upload/state/file_upload_cubit.dart:61 — FileUploadCubit.start 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 · DiffImageViewer.build (cyclomatic 18) · ×1
  • DiffImageViewer.build (cyclomatic 18) apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:42 — DiffImageViewer.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 · _SessionListScreenState._buildScaffoldBody (cyclomatic 18) · ×1
  • _SessionListScreenState._buildScaffoldBody (cyclomatic 18) apps/mobile/lib/features/session_list/session_list_screen.dart:1938 — _SessionListScreenState._buildScaffoldBody 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 · _MachineEditSheetState._testConnection (cyclomatic 18) · ×1
  • _MachineEditSheetState._testConnection (cyclomatic 18) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:212 — _MachineEditSheetState._testConnection 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 · SketchDocument.decode (cyclomatic 18) · ×1
  • SketchDocument.decode (cyclomatic 18) apps/mobile/lib/features/sketch/sketch_document.dart:64 — SketchDocument.decode 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 · BridgeService._clearPendingSessionActionFor (cyclomatic 18) · ×1
  • BridgeService._clearPendingSessionActionFor (cyclomatic 18) apps/mobile/lib/services/bridge_service.dart:2585 — BridgeService._clearPendingSessionActionFor 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 · BridgeService._restoreOfflinePendingMessages (cyclomatic 18) · ×1
  • BridgeService._restoreOfflinePendingMessages (cyclomatic 18) apps/mobile/lib/services/bridge_service.dart:2805 — BridgeService._restoreOfflinePendingMessages 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 · ChatMessageHandler._handleAssistant (cyclomatic 18) · ×1
  • ChatMessageHandler._handleAssistant (cyclomatic 18) apps/mobile/lib/services/chat_message_handler.dart:464 — ChatMessageHandler._handleAssistant 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 · ResultChip.build (cyclomatic 18) · ×1
  • ResultChip.build (cyclomatic 18) apps/mobile/lib/widgets/bubbles/result_chip.dart:26 — ResultChip.build 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 · deliver-ios.main (cyclomatic 18) · ×1
  • deliver-ios.main (cyclomatic 18) scripts/store-review/apps/deliver-ios.py:42 — deliver-ios.main 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 · sessions-index.extractCodexUserMessagePayloadImages (cyclomatic 18) · ×1
  • sessions-index.extractCodexUserMessagePayloadImages (cyclomatic 18) packages/bridge/src/sessions-index.ts:4053 — sessions-index.extractCodexUserMessagePayloadImages 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 · CodexProcess.processItemStarted (cyclomatic 18) · ×1
  • CodexProcess.processItemStarted (cyclomatic 18) REDACTED:3598 — CodexProcess.processItemStarted 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 · BridgeWebSocketServer.codexHistoryMessageToServerMessage (cyclomatic 18) · ×1
  • BridgeWebSocketServer.codexHistoryMessageToServerMessage (cyclomatic 18) REDACTED:2978 — BridgeWebSocketServer.codexHistoryMessageToServerMessage 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 · monitor.monitorRuns (cyclomatic 18) · ×1
  • monitor.monitorRuns (cyclomatic 18) scripts/release/monitor.mjs:288 — monitor.monitorRuns 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 · ChatSessionCubit.setClaudeSettings (cyclomatic 17) · ×1
  • ChatSessionCubit.setClaudeSettings (cyclomatic 17) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:2612 — ChatSessionCubit.setClaudeSettings has cyclomatic complexity 17 (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 · StatusIndicator.build (cyclomatic 17) · ×1
  • StatusIndicator.build (cyclomatic 17) apps/mobile/lib/features/chat_session/widgets/status_indicator.dart:22 — StatusIndicator.build 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 · LocalMediaSnapshot._prepare (cyclomatic 17) · ×1
  • LocalMediaSnapshot._prepare (cyclomatic 17) apps/mobile/lib/features/file_peek/playback/local_media_snapshot_io.dart:26 — LocalMediaSnapshot._prepare has cyclomatic complexity 17 (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 · GitViewCubit._onDiffImageResult (cyclomatic 17) · ×1
  • GitViewCubit._onDiffImageResult (cyclomatic 17) apps/mobile/lib/features/git/state/git_view_cubit.dart:383 — GitViewCubit._onDiffImageResult 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 · ProjectSetupCubit.request (cyclomatic 17) · ×1
  • ProjectSetupCubit.request (cyclomatic 17) apps/mobile/lib/features/project_setup/state/project_setup_cubit.dart:22 — ProjectSetupCubit.request 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 · _SessionListScreenState._showRecentSessionActions (cyclomatic 17) · ×1
  • _SessionListScreenState._showRecentSessionActions (cyclomatic 17) apps/mobile/lib/features/session_list/session_list_screen.dart:1358 — _SessionListScreenState._showRecentSessionActions 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 · _CompactWindowRow.build (cyclomatic 17) · ×1
  • _CompactWindowRow.build (cyclomatic 17) apps/mobile/lib/features/settings/widgets/usage_section.dart:708 — _CompactWindowRow.build 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 · _AskQuestionLayout.build (cyclomatic 17) · ×1
  • _AskQuestionLayout.build (cyclomatic 17) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:603 — _AskQuestionLayout.build 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 · _NewSessionSheetContentState.initState (cyclomatic 17) · ×1
  • _NewSessionSheetContentState.initState (cyclomatic 17) apps/mobile/lib/widgets/new_session_sheet.dart:861 — _NewSessionSheetContentState.initState 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 · _NewSessionSheetContentState._refreshModelCatalogs (cyclomatic 17) · ×1
  • _NewSessionSheetContentState._refreshModelCatalogs (cyclomatic 17) apps/mobile/lib/widgets/new_session_sheet.dart:1042 — _NewSessionSheetContentState._refreshModelCatalogs 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 · upload-duo-screenshots.main (cyclomatic 17) · ×1
  • upload-duo-screenshots.main (cyclomatic 17) scripts/store-review/upload-duo-screenshots.py:74 — upload-duo-screenshots.main 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 · worktree.parseGtrConfig (cyclomatic 17) · ×1
  • worktree.parseGtrConfig (cyclomatic 17) REDACTED:30 — worktree.parseGtrConfig 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 · sessions-index.findCodexSessionJsonlPath (cyclomatic 17) · ×1
  • sessions-index.findCodexSessionJsonlPath (cyclomatic 17) packages/bridge/src/sessions-index.ts:3465 — sessions-index.findCodexSessionJsonlPath has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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 · CodexProcess.forkThreadAtUserTurn (cyclomatic 17) · ×1
  • CodexProcess.forkThreadAtUserTurn (cyclomatic 17) REDACTED:929 — CodexProcess.forkThreadAtUserTurn 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 · git-operations.listGitFilesWithArgsForClient (cyclomatic 17) · ×1
  • git-operations.listGitFilesWithArgsForClient (cyclomatic 17) REDACTED:380 — git-operations.listGitFilesWithArgsForClient has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 452, 418, 434, …). 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 · BridgeWebSocketServer.rewindCodexConversation (cyclomatic 17) · ×1
  • BridgeWebSocketServer.rewindCodexConversation (cyclomatic 17) REDACTED:2055 — BridgeWebSocketServer.rewindCodexConversation has cyclomatic complexity 17 (threshold 15). Of this number, 16 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 · websocket.buildRecentSessionPredicate.<returned closure> (cyclomatic 17) · ×1
  • websocket.buildRecentSessionPredicate.<returned closure> (cyclomatic 17) REDACTED:984 — websocket.buildRecentSessionPredicate.<returned closure> 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 · ChatSessionCubit._extractCodexStructuredInputs (cyclomatic 16) · ×1
  • ChatSessionCubit._extractCodexStructuredInputs (cyclomatic 16) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:2947 — ChatSessionCubit._extractCodexStructuredInputs 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 · _DiffBottomBar.build (cyclomatic 16) · ×1
  • _DiffBottomBar.build (cyclomatic 16) apps/mobile/lib/features/git/git_screen.dart:998 — _DiffBottomBar.build 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 · _SessionListScreenState._connectToMachineConfig (cyclomatic 16) · ×1
  • _SessionListScreenState._connectToMachineConfig (cyclomatic 16) apps/mobile/lib/features/session_list/session_list_screen.dart:2452 — _SessionListScreenState._connectToMachineConfig 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 · _RecentAdvancedSearchSheetState.build (cyclomatic 16) · ×1
  • _RecentAdvancedSearchSheetState.build (cyclomatic 16) apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart:592 — _RecentAdvancedSearchSheetState.build 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 · _SupportStatusTile.build (cyclomatic 16) · ×1
  • _SupportStatusTile.build (cyclomatic 16) apps/mobile/lib/features/settings/supporter_screen.dart:487 — _SupportStatusTile.build 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 · _CategoryList._summary (cyclomatic 16) · ×1
  • _CategoryList._summary (cyclomatic 16) apps/mobile/lib/features/settings/widgets/settings_home.dart:255 — _CategoryList._summary has cyclomatic complexity 16 (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 · BridgeService._canSendCodexServiceTier (cyclomatic 16) · ×1
  • BridgeService._canSendCodexServiceTier (cyclomatic 16) apps/mobile/lib/services/bridge_service.dart:1983 — BridgeService._canSendCodexServiceTier 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 · MachineManagerService._mergeStoredMachines (cyclomatic 16) · ×1
  • MachineManagerService._mergeStoredMachines (cyclomatic 16) apps/mobile/lib/services/machine_manager_service.dart:261 — MachineManagerService._mergeStoredMachines 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 · MachineManagerService.addMachine (cyclomatic 16) · ×1
  • MachineManagerService.addMachine (cyclomatic 16) apps/mobile/lib/services/machine_manager_service.dart:507 — MachineManagerService.addMachine 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 · PromptHistoryService.performPromptHistorySyncHandshake (cyclomatic 16) · ×1
  • PromptHistoryService.performPromptHistorySyncHandshake (cyclomatic 16) apps/mobile/lib/services/prompt_history_service.dart:533 — PromptHistoryService.performPromptHistorySyncHandshake 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 · _ApprovalButtons.build (cyclomatic 16) · ×1
  • _ApprovalButtons.build (cyclomatic 16) apps/mobile/lib/widgets/approval_bar.dart:353 — _ApprovalButtons.build 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 · ChatEntryWidget.build (cyclomatic 16) · ×1
  • ChatEntryWidget.build (cyclomatic 16) apps/mobile/lib/widgets/message_bubble.dart:75 — ChatEntryWidget.build 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.relay (cyclomatic 16) · ×1
  • index.relay (cyclomatic 16) functions/src/index.ts:361 — index.relay 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 · SdkProcess.updateStatusFromMessage (cyclomatic 16) · ×1
  • SdkProcess.updateStatusFromMessage (cyclomatic 16) packages/bridge/src/sdk-process.ts:2095 — SdkProcess.updateStatusFromMessage 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 · sessions-index.parseClaudeJsonlFileFast (cyclomatic 16) · ×1
  • sessions-index.parseClaudeJsonlFileFast (cyclomatic 16) packages/bridge/src/sessions-index.ts:781 — sessions-index.parseClaudeJsonlFileFast 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 · session.mergeCodexSettings (cyclomatic 16) · ×1
  • session.mergeCodexSettings (cyclomatic 16) packages/bridge/src/session.ts:237 — session.mergeCodexSettings 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 · media-store.parseByteRange (cyclomatic 16) · ×1
  • media-store.parseByteRange (cyclomatic 16) packages/bridge/src/media-store.ts:53 — media-store.parseByteRange 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 · RecordingStore.extractInfoFromJsonl (cyclomatic 16) · ×1
  • RecordingStore.extractInfoFromJsonl (cyclomatic 16) packages/bridge/src/recording-store.ts:121 — RecordingStore.extractInfoFromJsonl 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 · BridgeWebSocketServer.prepareFileDownload (cyclomatic 16) · ×1
  • BridgeWebSocketServer.prepareFileDownload (cyclomatic 16) REDACTED:1419 — BridgeWebSocketServer.prepareFileDownload 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 · BridgeWebSocketServer.prepareFileUpload (cyclomatic 16) · ×1
  • BridgeWebSocketServer.prepareFileUpload (cyclomatic 16) REDACTED:1561 — BridgeWebSocketServer.prepareFileUpload 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 · BridgeWebSocketServer.forkClaudeSession (cyclomatic 16) · ×1
  • BridgeWebSocketServer.forkClaudeSession (cyclomatic 16) REDACTED:2240 — BridgeWebSocketServer.forkClaudeSession has cyclomatic complexity 16 (threshold 15). 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: 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 · BridgeWebSocketServer.registerPastToolResultImages (cyclomatic 16) · ×1
  • BridgeWebSocketServer.registerPastToolResultImages (cyclomatic 16) REDACTED:3168 — BridgeWebSocketServer.registerPastToolResultImages 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 · doctor.checkCliProviders (cyclomatic 16) · ×1
  • doctor.checkCliProviders (cyclomatic 16) REDACTED:111 — doctor.checkCliProviders has cyclomatic complexity 16 (threshold 15). 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: 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×1
  • Fixed-sleep synchronisation: limits concurrent HTTP upload bodies without evicting active uploads packages/bridge/src/upload-store.test.ts:334 — This test starts work it did not wait for (`active`, 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.
D2 · Cognitive Complexity · BridgeWebSocketServer.handleClientMessage (cognitive 1347) · ×1
  • BridgeWebSocketServer.handleClientMessage (cognitive 1347) REDACTED:3462 — BridgeWebSocketServer.handleClientMessage has cognitive complexity 1347 (threshold 15). Drivers by points: if/else 315 (702 pts), ternaries 162 (437 pts), error handling 46 (102 pts), boolean chains 81, loops 8 (24 pts), match/switch 1 (nesting depth added 734). Of this number, 967 points are the body's own statements and 380 belong to 48 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 · parser.parseClientMessage (cognitive 648) · ×1
  • parser.parseClientMessage (cognitive 648) packages/bridge/src/parser.ts:1464 — parser.parseClientMessage has cognitive complexity 648 (threshold 15). Drivers by points: if/else 230 (471 pts), boolean chains 172, loops 8 (22 pts), error handling 1, match/switch 1 (nesting depth added 255). To reduce it, split the body into named stages: move each independent 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 (parser.parseClientMessage::isPromptHistoryEntry) 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 · ChatInputWithOverlays.build (cognitive 276) · ×1
  • ChatInputWithOverlays.build (cognitive 276) apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:104 — ChatInputWithOverlays.build has cognitive complexity 276 (threshold 15). Drivers by points: if/else 102 (166 pts), boolean chains 41, ternaries 24 (36 pts), error handling 7 (17 pts), loops 8 (14 pts), match/switch 2 (nesting depth added 92). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BridgeService.connect (cognitive 253) · ×1
  • BridgeService.connect (cognitive 253) apps/mobile/lib/services/bridge_service.dart:782 — BridgeService.connect has cognitive complexity 253 (threshold 15). Drivers by points: if/else 63 (201 pts), ternaries 6 (28 pts), boolean chains 18, error handling 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 163). 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 · sessions-index.getCodexSessionHistory (cognitive 235) · ×1
  • sessions-index.getCodexSessionHistory (cognitive 235) packages/bridge/src/sessions-index.ts:4224 — sessions-index.getCodexSessionHistory has cognitive complexity 235 (threshold 15). Drivers by points: ternaries 31 (133 pts), if/else 30 (95 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 168). Of this number, 233 points are the body's own statements and 2 belong to 2 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 · HomeContentState._buildContent (cognitive 197) · ×1
  • HomeContentState._buildContent (cognitive 197) apps/mobile/lib/features/session_list/widgets/home_content.dart:573 — HomeContentState._buildContent has cognitive complexity 197 (threshold 15). Drivers by points: ternaries 22 (67 pts), if/else 31 (66 pts), boolean chains 35, loops 13 (28 pts), match/switch 1 (nesting depth added 95). 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 · ChatSessionCubit._applyUpdate (cognitive 175) · ×1
  • ChatSessionCubit._applyUpdate (cognitive 175) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:662 — ChatSessionCubit._applyUpdate has cognitive complexity 175 (threshold 15). Drivers by points: if/else 65 (109 pts), boolean chains 33, ternaries 15 (24 pts), loops 4 (9 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions-index.parseCodexSessionJsonl (cognitive 168) · ×1
  • sessions-index.parseCodexSessionJsonl (cognitive 168) packages/bridge/src/sessions-index.ts:1559 — sessions-index.parseCodexSessionJsonl has cognitive complexity 168 (threshold 15). Drivers by points: if/else 45 (139 pts), boolean chains 21, ternaries 5, error handling 1 (2 pts), loops 1 (nesting depth added 95). Of this number, 166 points are the body's own statements and 2 belong to 2 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 · sessions-index.parseFromChunks (cognitive 152) · ×1
  • sessions-index.parseFromChunks (cognitive 152) packages/bridge/src/sessions-index.ts:560 — sessions-index.parseFromChunks has cognitive complexity 152 (threshold 15). Drivers by points: if/else 40 (116 pts), boolean chains 17, loops 4 (9 pts), error handling 2 (6 pts), ternaries 4 (nesting depth added 85). 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 · SessionManager.create · ×1
  • SessionManager.create::processMessage (cognitive 138) packages/bridge/src/session.ts:502 — SessionManager.create::processMessage has cognitive complexity 138 (threshold 15). Drivers by points: if/else 41 (99 pts), boolean chains 22, loops 3 (11 pts), error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 69). 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. This shape REPEATS in the file: one other method here (SessionManager.create) 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 · sessions-index.codexThreadToSessionHistory (cognitive 127) · ×1
  • sessions-index.codexThreadToSessionHistory (cognitive 127) packages/bridge/src/sessions-index.ts:2845 — sessions-index.codexThreadToSessionHistory has cognitive complexity 127 (threshold 15). Drivers by points: ternaries 19 (80 pts), if/else 10 (37 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 91). Of this number, 113 points are the body's own statements and 14 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 · _CodexChatBody.build (cognitive 114) · ×1
  • _CodexChatBody.build (cognitive 114) apps/mobile/lib/features/codex_session/codex_session_screen.dart:664 — _CodexChatBody.build has cognitive complexity 114 (threshold 15). Drivers by points: if/else 49 (58 pts), boolean chains 30, ternaries 14 (18 pts), error handling 3 (6 pts), match/switch 2 (nesting depth added 16). 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 · SdkProcess.processMessages (cognitive 97) · ×1
  • SdkProcess.processMessages (cognitive 97) packages/bridge/src/sdk-process.ts:1733 — SdkProcess.processMessages has cognitive complexity 97 (threshold 15). Drivers by points: if/else 30 (76 pts), boolean chains 20, loops 1 (nesting depth added 46). Of this number, 92 points are the body's own statements and 5 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 · _ChatScreenBody.build (cognitive 91) · ×1
  • _ChatScreenBody.build (cognitive 91) apps/mobile/lib/features/claude_session/claude_session_screen.dart:604 — _ChatScreenBody.build has cognitive complexity 91 (threshold 15). Drivers by points: if/else 39 (46 pts), ternaries 16 (20 pts), boolean chains 17, error handling 3 (6 pts), match/switch 2 (nesting depth added 14). 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 · ChatMessageHandler._handleHistory (cognitive 87) · ×1
  • ChatMessageHandler._handleHistory (cognitive 87) apps/mobile/lib/services/chat_message_handler.dart:644 — ChatMessageHandler._handleHistory has cognitive complexity 87 (threshold 15). Drivers by points: if/else 19 (50 pts), boolean chains 22, ternaries 7 (14 pts), loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions-index.getAllRecentSessions (cognitive 83) · ×1
  • sessions-index.getAllRecentSessions (cognitive 83) packages/bridge/src/sessions-index.ts:1119 — sessions-index.getAllRecentSessions has cognitive complexity 83 (threshold 15). Drivers by points: if/else 25 (45 pts), ternaries 11 (19 pts), boolean chains 11, error handling 3 (4 pts), loops 3 (4 pts) (nesting depth added 30). Of this number, 43 points are the body's own statements and 40 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 · sessions-index.getSessionHistory (cognitive 80) · ×1
  • sessions-index.getSessionHistory (cognitive 80) packages/bridge/src/sessions-index.ts:3618 — sessions-index.getSessionHistory has cognitive complexity 80 (threshold 15). Drivers by points: if/else 17 (35 pts), ternaries 9 (30 pts), boolean chains 9, error handling 2 (3 pts), loops 2 (3 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 · sdk-process.convertSdkMessage (cognitive 78) · ×1
  • sdk-process.convertSdkMessage (cognitive 78) packages/bridge/src/sdk-process.ts:644 — sdk-process.convertSdkMessage has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 13 (35 pts), if/else 15 (34 pts), boolean chains 8, match/switch 1 (nesting depth added 41). Of this number, 70 points are the body's own statements and 8 belong to one function literal inside it that branches. 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 · CodexProcess.bootstrap (cognitive 73) · ×1
  • CodexProcess.bootstrap (cognitive 73) REDACTED:2051 — CodexProcess.bootstrap has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (33 pts), ternaries 24 (26 pts), boolean chains 13, error handling 1 (nesting depth added 7). Of this number, 72 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, 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 · CodexProcess.processItemCompleted (cognitive 69) · ×1
  • CodexProcess.processItemCompleted (cognitive 69) REDACTED:3729 — CodexProcess.processItemCompleted has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 21 (42 pts), if/else 9 (19 pts), boolean chains 7, match/switch 1 (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 · MachineManagerService.checkHealth (cognitive 66) · ×1
  • MachineManagerService.checkHealth (cognitive 66) apps/mobile/lib/services/machine_manager_service.dart:703 — MachineManagerService.checkHealth has cognitive complexity 66 (threshold 15). Drivers by points: if/else 14 (36 pts), ternaries 7 (19 pts), boolean chains 8, error handling 3 (nesting depth added 34). 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 · CodexProcess.handleNotification (cognitive 59) · ×1
  • CodexProcess.handleNotification (cognitive 59) REDACTED:3149 — CodexProcess.handleNotification has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 7 (18 pts), boolean chains 6, error handling 1 (2 pts), match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BridgeService._flushMessageQueueAsync (cognitive 57) · ×1
  • BridgeService._flushMessageQueueAsync (cognitive 57) apps/mobile/lib/services/bridge_service.dart:2316 — BridgeService._flushMessageQueueAsync has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (37 pts), boolean chains 8, loops 3 (7 pts), error handling 1 (5 pts) (nesting depth added 32). 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 · sessions-index.normalizeCodexMcpResult (cognitive 57) · ×1
  • sessions-index.normalizeCodexMcpResult (cognitive 57) packages/bridge/src/sessions-index.ts:3288 — sessions-index.normalizeCodexMcpResult has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 11 (37 pts), if/else 10 (15 pts), boolean chains 4, loops 1 (nesting depth added 31). 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 · CodexProcess.listAvailableModelMetadata (cognitive 57) · ×1
  • CodexProcess.listAvailableModelMetadata (cognitive 57) REDACTED:1025 — CodexProcess.listAvailableModelMetadata has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 7 (29 pts), if/else 6 (18 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BridgeWebSocketServer.maybeSendPushNotification (cognitive 56) · ×1
  • BridgeWebSocketServer.maybeSendPushNotification (cognitive 56) REDACTED:10547 — BridgeWebSocketServer.maybeSendPushNotification has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 8 (21 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 22). Of this number, 53 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 · MachineManagerService._migrateIfNeeded (cognitive 55) · ×1
  • MachineManagerService._migrateIfNeeded (cognitive 55) apps/mobile/lib/services/machine_manager_service.dart:108 — MachineManagerService._migrateIfNeeded has cognitive complexity 55 (threshold 15). Drivers by points: if/else 9 (26 pts), ternaries 3 (14 pts), loops 2 (6 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexProcess.runInputLoop (cognitive 55) · ×1
  • CodexProcess.runInputLoop (cognitive 55) REDACTED:2697 — CodexProcess.runInputLoop has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 9, ternaries 3 (9 pts), loops 1 (nesting depth added 25). Of this number, 24 points are the body's own statements and 31 belong to 5 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 · _SessionListScreenState._connectWithParams (cognitive 54) · ×1
  • _SessionListScreenState._connectWithParams (cognitive 54) apps/mobile/lib/features/session_list/session_list_screen.dart:539 — _SessionListScreenState._connectWithParams has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (23 pts), ternaries 8 (23 pts), boolean chains 5, match/switch 1 (3 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 · _MachineEditSheetState.build (cognitive 54) · ×1
  • _MachineEditSheetState.build (cognitive 54) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:405 — _MachineEditSheetState.build has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 12 (23 pts), boolean chains 6 (nesting depth added 25). 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 · _RunningSessionCardState.build (cognitive 54) · ×1
  • _RunningSessionCardState.build (cognitive 54) apps/mobile/lib/widgets/session_card.dart:98 — _RunningSessionCardState.build has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 16 (25 pts), if/else 16, boolean chains 10, match/switch 2 (3 pts) (nesting depth added 10). 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 · performance-mode.performanceMessage (cognitive 53) · ×1
  • performance-mode.performanceMessage (cognitive 53) packages/bridge/src/performance-mode.ts:6 — performance-mode.performanceMessage has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 12 (18 pts), boolean chains 13 (nesting depth added 17). Of this number, 33 points are the body's own statements and 20 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 · _SessionListScreenState.initState (cognitive 52) · ×1
  • _SessionListScreenState.initState (cognitive 52) apps/mobile/lib/features/session_list/session_list_screen.dart:320 — _SessionListScreenState.initState has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 19, ternaries 2 (4 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 · FilePeekContentState.build (cognitive 51) · ×1
  • FilePeekContentState.build (cognitive 51) apps/mobile/lib/features/file_peek/file_peek_sheet.dart:420 — FilePeekContentState.build has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 21, ternaries 13 (18 pts), if/else 10 (12 pts) (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 · WorkspaceShellScreenState.build (cognitive 49) · ×1
  • WorkspaceShellScreenState.build (cognitive 49) apps/mobile/lib/features/session_list/workspace_shell_screen.dart:663 — WorkspaceShellScreenState.build has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 24, if/else 17 (18 pts), ternaries 7 (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 · ChatMessageHandler._handleSystem (cognitive 49) · ×1
  • ChatMessageHandler._handleSystem (cognitive 49) apps/mobile/lib/services/chat_message_handler.dart:802 — ChatMessageHandler._handleSystem has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 21, ternaries 4 (5 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 · _OptionsSection.build (cognitive 47) · ×1
  • _OptionsSection.build (cognitive 47) apps/mobile/lib/widgets/new_session_sheet.dart:2819 — _OptionsSection.build has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 17 (24 pts), match/switch 8, if/else 7, loops 3 (5 pts), boolean chains 3 (nesting depth added 9). 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 · recent-session-search.searchRecentSessionContent (cognitive 47) · ×1
  • recent-session-search.searchRecentSessionContent (cognitive 47) REDACTED:355 — recent-session-search.searchRecentSessionContent has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 27). Of this number, 37 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 · _MachineEditSheetState._save (cognitive 46) · ×1
  • _MachineEditSheetState._save (cognitive 46) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:282 — _MachineEditSheetState._save has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 10 (21 pts), boolean chains 18, if/else 3 (5 pts), match/switch 1 (2 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 · BridgeService._restoreOfflinePendingMessages (cognitive 46) · ×1
  • BridgeService._restoreOfflinePendingMessages (cognitive 46) apps/mobile/lib/services/bridge_service.dart:2805 — BridgeService._restoreOfflinePendingMessages has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (33 pts), error handling 2 (4 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (2 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 · sessions-index.extractCodexUserMessagePayloadImages (cognitive 46) · ×1
  • sessions-index.extractCodexUserMessagePayloadImages (cognitive 46) packages/bridge/src/sessions-index.ts:4053 — sessions-index.extractCodexUserMessagePayloadImages has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 5 (19 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 29). 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 · SessionManager.rewindInPlace (cognitive 46) · ×1
  • SessionManager.rewindInPlace (cognitive 46) packages/bridge/src/session.ts:1947 — SessionManager.rewindInPlace has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 8, ternaries 5 (8 pts), loops 2 (3 pts) (nesting depth added 13). Of this number, 38 points are the body's own statements and 8 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 · ChatSessionCubit.sendMessage (cognitive 45) · ×1
  • ChatSessionCubit.sendMessage (cognitive 45) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1817 — ChatSessionCubit.sendMessage has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 12, ternaries 7 (12 pts), match/switch 1 (2 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 · _SessionListScreenState._resumeSessionWithParams (cognitive 44) · ×1
  • _SessionListScreenState._resumeSessionWithParams (cognitive 44) apps/mobile/lib/features/session_list/session_list_screen.dart:1589 — _SessionListScreenState._resumeSessionWithParams has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 29, boolean chains 11, if/else 4. 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 · _FilePeekModelPreviewState._load (cognitive 43) · ×1
  • _FilePeekModelPreviewState._load (cognitive 43) apps/mobile/lib/features/file_peek/widgets/file_peek_model_preview.dart:48 — _FilePeekModelPreviewState._load has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 7, loops 2 (7 pts), ternaries 1 (3 pts), error handling 1 (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 · _SessionListScreenState._startNewSession (cognitive 43) · ×1
  • _SessionListScreenState._startNewSession (cognitive 43) apps/mobile/lib/features/session_list/session_list_screen.dart:926 — _SessionListScreenState._startNewSession has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 29, boolean chains 12, if/else 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 · BridgeWebSocketServer.applyCodexCanonicalHistoryBaseline (cognitive 43) · ×1
  • BridgeWebSocketServer.applyCodexCanonicalHistoryBaseline (cognitive 43) REDACTED:2558 — BridgeWebSocketServer.applyCodexCanonicalHistoryBaseline has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 6 (10 pts), boolean chains 5, ternaries 3 (4 pts) (nesting depth added 17). Of this number, 37 points are the body's own statements and 6 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 · server.wss.on("connection") (cognitive 43) · ×1
  • server.wss.on("connection") (cognitive 43) scripts/voice-lab/server.mjs:27 — server.wss.on("connection") has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 9, error handling 4, ternaries 2 (4 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 43 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 75, a function literal at line 53, cleanup, …). 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 · ConnectionUrlParser.parse (cognitive 39) · ×1
  • ConnectionUrlParser.parse (cognitive 39) apps/mobile/lib/services/connection_url_parser.dart:18 — ConnectionUrlParser.parse has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 3 (8 pts), boolean chains 6, error handling 1 (2 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 · BridgeWebSocketServer.buildSessionCreatedMessage (cognitive 39) · ×1
  • BridgeWebSocketServer.buildSessionCreatedMessage (cognitive 39) REDACTED:1713 — BridgeWebSocketServer.buildSessionCreatedMessage has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 21, if/else 9 (17 pts), boolean chains 1 (nesting depth added 8). 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 · BridgeWebSocketServer.collectImageChanges (cognitive 39) · ×1
  • BridgeWebSocketServer.collectImageChanges (cognitive 39) REDACTED:11213 — BridgeWebSocketServer.collectImageChanges has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (27 pts), error handling 2 (6 pts), loops 3 (4 pts), boolean chains 2 (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 · _NewSessionSheetContentState._allProjectChoices (cognitive 38) · ×1
  • _NewSessionSheetContentState._allProjectChoices (cognitive 38) apps/mobile/lib/widgets/new_session_sheet.dart:762 — _NewSessionSheetContentState._allProjectChoices has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 7 (9 pts), loops 5 (7 pts), boolean chains 5 (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 · ChatSessionCubit._onMessage (cognitive 37) · ×1
  • ChatSessionCubit._onMessage (cognitive 37) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:442 — ChatSessionCubit._onMessage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 10, error handling 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 · PromptHistoryService.performPromptHistorySyncHandshake (cognitive 37) · ×1
  • PromptHistoryService.performPromptHistorySyncHandshake (cognitive 37) apps/mobile/lib/services/prompt_history_service.dart:533 — PromptHistoryService.performPromptHistorySyncHandshake has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 6 (21 pts), if/else 5 (12 pts), boolean chains 3, loops 1 (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 · index.parseRelayBody (cognitive 37) · ×1
  • index.parseRelayBody (cognitive 37) functions/src/index.ts:158 — index.parseRelayBody has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 6, loops 1 (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 · monitor.monitorRuns (cognitive 37) · ×1
  • monitor.monitorRuns (cognitive 37) scripts/release/monitor.mjs:288 — monitor.monitorRuns has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 4 (12 pts), loops 2 (4 pts), boolean chains 2, error handling 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 · _GitScreenBodyState.build (cognitive 36) · ×1
  • _GitScreenBodyState.build (cognitive 36) apps/mobile/lib/features/git/git_screen.dart:323 — _GitScreenBodyState.build has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 16 (18 pts), boolean chains 9, if/else 7 (9 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 · codex-process.normalizeMcpToolResult (cognitive 36) · ×1
  • codex-process.normalizeMcpToolResult (cognitive 36) REDACTED:4947 — codex-process.normalizeMcpToolResult has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 7 (10 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 · FileBrowserCubit._onMessage (cognitive 35) · ×1
  • FileBrowserCubit._onMessage (cognitive 35) apps/mobile/lib/features/file_browser/state/file_browser_cubit.dart:313 — FileBrowserCubit._onMessage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 9, loops 2 (4 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 · PermissionPresentation.from (cognitive 35) · ×1
  • PermissionPresentation.from (cognitive 35) apps/mobile/lib/models/messages.dart:2214 — PermissionPresentation.from has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 9 (12 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 · sdk-process.buildAskUserAnswers (cognitive 35) · ×1
  • sdk-process.buildAskUserAnswers (cognitive 35) packages/bridge/src/sdk-process.ts:297 — sdk-process.buildAskUserAnswers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 7, loops 2 (5 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 11). Of this number, 28 points are the body's own statements and 7 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 · sessions-index.claudeAbandonedBranchUuids (cognitive 35) · ×1
  • sessions-index.claudeAbandonedBranchUuids (cognitive 35) packages/bridge/src/sessions-index.ts:3551 — sessions-index.claudeAbandonedBranchUuids has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 7, ternaries 3 (6 pts), loops 3, error handling 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 · directory-listing.listAllowedDirectories (cognitive 34) · ×1
  • directory-listing.listAllowedDirectories (cognitive 34) packages/bridge/src/directory-listing.ts:81 — directory-listing.listAllowedDirectories has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 11, error handling 3 (4 pts), ternaries 2 (3 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 · doctor.printReport (cognitive 34) · ×1
  • doctor.printReport (cognitive 34) REDACTED:865 — doctor.printReport has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (8 pts), ternaries 3 (5 pts), boolean chains 4 (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 · _CommitBottomSheetContentState.build (cognitive 33) · ×1
  • _CommitBottomSheetContentState.build (cognitive 33) apps/mobile/lib/features/git/widgets/commit_bottom_sheet.dart:38 — _CommitBottomSheetContentState.build has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 6 (11 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 19). 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 · SessionResumeCoordinator.resume (cognitive 33) · ×1
  • SessionResumeCoordinator.resume (cognitive 33) apps/mobile/lib/features/session_list/services/session_resume_coordinator.dart:155 — SessionResumeCoordinator.resume has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 29, if/else 3, boolean chains 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 · BridgeService.resolveSessionLink (cognitive 33) · ×1
  • BridgeService.resolveSessionLink (cognitive 33) apps/mobile/lib/services/bridge_service.dart:2957 — BridgeService.resolveSessionLink has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 10, error handling 2 (5 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 · _NewSessionSheetContentState._buildParams (cognitive 33) · ×1
  • _NewSessionSheetContentState._buildParams (cognitive 33) apps/mobile/lib/widgets/new_session_sheet.dart:1524 — _NewSessionSheetContentState._buildParams has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 22, boolean chains 11. 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 · sessions-index.getCodexSessionIndexMetadata (cognitive 33) · ×1
  • sessions-index.getCodexSessionIndexMetadata (cognitive 33) packages/bridge/src/sessions-index.ts:2602 — sessions-index.getCodexSessionIndexMetadata has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 7 (12 pts), error handling 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 12). Of this number, 27 points are the body's own statements and 6 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 · sessions-index.buildClaudeMessageImageIndex (cognitive 33) · ×1
  • sessions-index.buildClaudeMessageImageIndex (cognitive 33) packages/bridge/src/sessions-index.ts:3870 — sessions-index.buildClaudeMessageImageIndex has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 4, error handling 2 (3 pts), loops 2 (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 · CodexProcess.readThread (cognitive 33) · ×1
  • CodexProcess.readThread (cognitive 33) REDACTED:725 — CodexProcess.readThread has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, loops 4 (5 pts), error handling 2, ternaries 1 (2 pts) (nesting depth added 9). Of this number, 27 points are the body's own statements and 6 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 · CodexProcess.handleServerRequest (cognitive 33) · ×1
  • CodexProcess.handleServerRequest (cognitive 33) REDACTED:2943 — CodexProcess.handleServerRequest has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 15 (30 pts), if/else 1 (2 pts), match/switch 1 (nesting depth added 16). 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 · _ChatMessageListState.build (cognitive 32) · ×1
  • _ChatMessageListState.build (cognitive 32) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:584 — _ChatMessageListState.build has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 8, ternaries 4 (5 pts), match/switch 2 (3 pts), 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 · _BranchSelectorContentState.build (cognitive 31) · ×1
  • _BranchSelectorContentState.build (cognitive 31) apps/mobile/lib/features/git/widgets/branch_selector_sheet.dart:43 — _BranchSelectorContentState.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (24 pts), if/else 4 (5 pts), boolean chains 2 (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 · ChatMessageHandler._handleAssistant (cognitive 31) · ×1
  • ChatMessageHandler._handleAssistant (cognitive 31) apps/mobile/lib/services/chat_message_handler.dart:464 — ChatMessageHandler._handleAssistant has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, ternaries 3 (6 pts), loops 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 · pack-delivery.main (cognitive 31) · ×1
  • pack-delivery.main (cognitive 31) scripts/store-review/apps/pack-delivery.py:16 — pack-delivery.main has cognitive complexity 31 (threshold 15). Drivers by points: loops 5 (13 pts), ternaries 3 (9 pts), if/else 4 (8 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 · CodexProcess._fetchCompletionEntitiesInternal (cognitive 31) · ×1
  • CodexProcess._fetchCompletionEntitiesInternal (cognitive 31) REDACTED:2487 — CodexProcess._fetchCompletionEntitiesInternal has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (6 pts), ternaries 5 (6 pts), boolean chains 5, error handling 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 2572, a function literal at line 2622, a function literal at line 2605, …). 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 · SessionManager.buildSessionSummary (cognitive 31) · ×1
  • SessionManager.buildSessionSummary (cognitive 31) packages/bridge/src/session.ts:1052 — SessionManager.buildSessionSummary has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 16 (29 pts), boolean chains 2 (nesting depth added 13). Of this number, 29 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 · SessionManager.backfillUserUuidsFromDisk (cognitive 31) · ×1
  • SessionManager.backfillUserUuidsFromDisk (cognitive 31) packages/bridge/src/session.ts:2219 — SessionManager.backfillUserUuidsFromDisk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, error handling 2 (3 pts), ternaries 1 (3 pts), loops 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 · ChatSessionCubit._extractCodexStructuredInputs (cognitive 30) · ×1
  • ChatSessionCubit._extractCodexStructuredInputs (cognitive 30) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:2947 — ChatSessionCubit._extractCodexStructuredInputs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (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 · BridgeService._routeProjectRequestError (cognitive 30) · ×1
  • BridgeService._routeProjectRequestError (cognitive 30) apps/mobile/lib/services/bridge_service.dart:1349 — BridgeService._routeProjectRequestError has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24 (29 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.
D2 · Cognitive Complexity · BridgeService.send (cognitive 30) · ×1
  • BridgeService.send (cognitive 30) apps/mobile/lib/services/bridge_service.dart:1927 — BridgeService.send has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, error handling 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 · ChatMessageHandler._buildCommandList (cognitive 30) · ×1
  • ChatMessageHandler._buildCommandList (cognitive 30) apps/mobile/lib/services/chat_message_handler.dart:1033 — ChatMessageHandler._buildCommandList has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 7 (11 pts), boolean chains 3, ternaries 2 (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 · ChatSessionCubit._userEntryMatchIndex (cognitive 29) · ×1
  • ChatSessionCubit._userEntryMatchIndex (cognitive 29) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1439 — ChatSessionCubit._userEntryMatchIndex has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 11, loops 1, 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 · MockBridgeService.send (cognitive 29) · ×1
  • MockBridgeService.send (cognitive 29) apps/mobile/lib/services/mock_bridge_service.dart:149 — MockBridgeService.send has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (9 pts), ternaries 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 15). 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 · _AskQuestionLayout.build (cognitive 29) · ×1
  • _AskQuestionLayout.build (cognitive 29) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:603 — _AskQuestionLayout.build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 2 (6 pts), boolean chains 4, loops 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 · _InputTextFieldState._handleKeyEvent (cognitive 29) · ×1
  • _InputTextFieldState._handleKeyEvent (cognitive 29) apps/mobile/lib/widgets/chat_input_bar.dart:968 — _InputTextFieldState._handleKeyEvent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 6 (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 · recent-session-search.transcriptLineMessageTexts (cognitive 29) · ×1
  • recent-session-search.transcriptLineMessageTexts (cognitive 29) REDACTED:137 — recent-session-search.transcriptLineMessageTexts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 4 (8 pts), boolean chains 6 (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 · codex-process.coerceElicitationValue (cognitive 29) · ×1
  • codex-process.coerceElicitationValue (cognitive 29) REDACTED:5350 — codex-process.coerceElicitationValue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 3 (6 pts), boolean chains 3 (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 · skill-triggers.convertSkillTriggers (cognitive 29) · ×1
  • skill-triggers.convertSkillTriggers (cognitive 29) packages/bridge/src/skill-triggers.ts:129 — skill-triggers.convertSkillTriggers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 8, loops 3 (5 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 · BridgeWebSocketServer.registerPastUserMessageImages (cognitive 29) · ×1
  • BridgeWebSocketServer.registerPastUserMessageImages (cognitive 29) REDACTED:3098 — BridgeWebSocketServer.registerPastUserMessageImages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (5 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 12). 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 · FileUploadCubit.start (cognitive 28) · ×1
  • FileUploadCubit.start (cognitive 28) apps/mobile/lib/features/file_upload/state/file_upload_cubit.dart:61 — FileUploadCubit.start has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, error handling 3 (6 pts), 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 · ChatMessageHandler.handle (cognitive 28) · ×1
  • ChatMessageHandler.handle (cognitive 28) apps/mobile/lib/services/chat_message_handler.dart:213 — ChatMessageHandler.handle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 2 (4 pts), boolean chains 2, match/switch 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 · cli-args.parseCliArgs (cognitive 28) · ×1
  • cli-args.parseCliArgs (cognitive 28) packages/bridge/src/cli-args.ts:25 — cli-args.parseCliArgs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 2 (6 pts), boolean chains 3, 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 · SessionManager.create (cognitive 28) · ×1
  • SessionManager.create (cognitive 28) packages/bridge/src/session.ts:398 — SessionManager.create has cognitive complexity 28 (threshold 15). Drivers by points: if/else 65 (130 pts), boolean chains 37, loops 4 (12 pts), error handling 5 (9 pts), ternaries 6 (7 pts) (nesting depth added 78). To reduce it, split the body into named stages: move each independent 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 (SessionManager.create::processMessage) 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 · skill-triggers.catalogFromCachedCommands (cognitive 28) · ×1
  • skill-triggers.catalogFromCachedCommands (cognitive 28) packages/bridge/src/skill-triggers.ts:76 — skill-triggers.catalogFromCachedCommands has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (6 pts), loops 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 · BridgeWebSocketServer.collectGitDiff (cognitive 28) · ×1
  • BridgeWebSocketServer.collectGitDiff (cognitive 28) REDACTED:10996 — BridgeWebSocketServer.collectGitDiff has cognitive complexity 28 (threshold 15). Drivers by points: error handling 7 (13 pts), if/else 9 (13 pts), ternaries 1 (2 pts) (nesting depth added 11). Of this number, 16 points are the body's own statements and 12 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 · _MachineEditSheetState._testConnection (cognitive 27) · ×1
  • _MachineEditSheetState._testConnection (cognitive 27) apps/mobile/lib/features/session_list/widgets/machine_edit_sheet.dart:212 — _MachineEditSheetState._testConnection has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 5, error handling 1, if/else 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 · BridgeService._clearTransportScopedRequestState (cognitive 27) · ×1
  • BridgeService._clearTransportScopedRequestState (cognitive 27) apps/mobile/lib/services/bridge_service.dart:3486 — BridgeService._clearTransportScopedRequestState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 6, boolean chains 3 (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 · deliver-ios.main (cognitive 27) · ×1
  • deliver-ios.main (cognitive 27) scripts/store-review/apps/deliver-ios.py:42 — deliver-ios.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 3 (5 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 · recent-session-search.searchTranscriptFile (cognitive 27) · ×1
  • recent-session-search.searchTranscriptFile (cognitive 27) REDACTED:230 — recent-session-search.searchTranscriptFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (4 pts), boolean chains 3, error handling 3, loops 2 (3 pts) (nesting depth added 8). Of this number, 22 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 · ChatSessionCubit._restorePendingInputMessages (cognitive 26) · ×1
  • ChatSessionCubit._restorePendingInputMessages (cognitive 26) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:335 — ChatSessionCubit._restorePendingInputMessages has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), ternaries 3 (7 pts), 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 · _StandardBubble.build (cognitive 26) · ×1
  • _StandardBubble.build (cognitive 26) apps/mobile/lib/widgets/bubbles/user_bubble.dart:317 — _StandardBubble.build has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 2 (5 pts), if/else 3 (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 · codex-recovery.rateLimitFailure · ×1
  • codex-recovery.rateLimitFailure::visit (cognitive 26) packages/bridge/src/codex-recovery.ts:16 — codex-recovery.rateLimitFailure::visit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (8 pts), boolean chains 5, loops 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 · sessions-index.extractMissingFieldsStreaming (cognitive 26) · ×1
  • sessions-index.extractMissingFieldsStreaming (cognitive 26) packages/bridge/src/sessions-index.ts:922 — sessions-index.extractMissingFieldsStreaming has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 10, error handling 1 (2 pts) (nesting depth added 4). None of this is in the body itself: all 26 points belong to 4 function literals inside it that branch (lines 949, 937, 984, …). 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 · sessions-index.getPinnedCodexSessions (cognitive 26) · ×1
  • sessions-index.getPinnedCodexSessions (cognitive 26) packages/bridge/src/sessions-index.ts:2394 — sessions-index.getPinnedCodexSessions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, loops 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). 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 · sessions-index.findCodexSessionJsonlPath (cognitive 26) · ×1
  • sessions-index.findCodexSessionJsonlPath (cognitive 26) packages/bridge/src/sessions-index.ts:3465 — sessions-index.findCodexSessionJsonlPath has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 4 (8 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). Of this number, 15 points are the body's own statements and 11 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 · CodexProcess.handleTurnCompleted (cognitive 26) · ×1
  • CodexProcess.handleTurnCompleted (cognitive 26) REDACTED:3431 — CodexProcess.handleTurnCompleted has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (10 pts), 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 · UploadStore.receive (cognitive 26) · ×1
  • UploadStore.receive (cognitive 26) packages/bridge/src/upload-store.ts:413 — UploadStore.receive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (10 pts), loops 2 (3 pts), boolean chains 1, 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 · index.startServer (cognitive 26) · ×1
  • index.startServer (cognitive 26) packages/bridge/src/index.ts:38 — index.startServer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, ternaries 5 (6 pts), boolean chains 4, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 164, shutdown, a function literal at line 256). 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 · ProjectSetupCubit.request (cognitive 25) · ×1
  • ProjectSetupCubit.request (cognitive 25) apps/mobile/lib/features/project_setup/state/project_setup_cubit.dart:22 — ProjectSetupCubit.request has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (8 pts), boolean chains 4, 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 · _ProjectSetupActionBody.build (cognitive 25) · ×1
  • _ProjectSetupActionBody.build (cognitive 25) apps/mobile/lib/features/project_setup/widgets/project_setup_action.dart:43 — _ProjectSetupActionBody.build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (10 pts), boolean chains 3 (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 · BridgeService._clearPendingSessionActionFor (cognitive 25) · ×1
  • BridgeService._clearPendingSessionActionFor (cognitive 25) apps/mobile/lib/services/bridge_service.dart:2585 — BridgeService._clearPendingSessionActionFor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, 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 · sessions-index.extractLastPromptFromTail (cognitive 25) · ×1
  • sessions-index.extractLastPromptFromTail (cognitive 25) packages/bridge/src/sessions-index.ts:1008 — sessions-index.extractLastPromptFromTail has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 2 (4 pts), loops 2 (3 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 · CodexProcess.handleStdoutChunk (cognitive 25) · ×1
  • CodexProcess.handleStdoutChunk (cognitive 25) REDACTED:2842 — CodexProcess.handleStdoutChunk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (9 pts), error handling 2 (4 pts), boolean chains 1, loops 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 · BridgeWebSocketServer.sendCompletionPush (cognitive 25) · ×1
  • BridgeWebSocketServer.sendCompletionPush (cognitive 25) REDACTED:10694 — BridgeWebSocketServer.sendCompletionPush has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 5 (8 pts), loops 1 (nesting depth added 7). Of this number, 23 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 · FileTransferCubit.start (cognitive 24) · ×1
  • FileTransferCubit.start (cognitive 24) apps/mobile/lib/features/file_transfer/state/file_transfer_cubit.dart:63 — FileTransferCubit.start has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, error handling 3 (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 · _UsageSectionState.build (cognitive 24) · ×1
  • _UsageSectionState.build (cognitive 24) apps/mobile/lib/features/settings/widgets/usage_section.dart:105 — _UsageSectionState.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 7 (10 pts), loops 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 · codex-service-tier.extractCodexServiceTierMetadata (cognitive 24) · ×1
  • codex-service-tier.extractCodexServiceTierMetadata (cognitive 24) packages/bridge/src/codex-service-tier.ts:21 — codex-service-tier.extractCodexServiceTierMetadata has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 2 (4 pts), boolean chains 3, 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 · CodexBackgroundTracker.observe (cognitive 24) · ×1
  • CodexBackgroundTracker.observe (cognitive 24) packages/bridge/src/codex-background-tracker.ts:37 — CodexBackgroundTracker.observe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, match/switch 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 · BridgeWebSocketServer.codexHistoryMessageToServerMessage (cognitive 24) · ×1
  • BridgeWebSocketServer.codexHistoryMessageToServerMessage (cognitive 24) REDACTED:2978 — BridgeWebSocketServer.codexHistoryMessageToServerMessage has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 5 (7 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 · BridgeWebSocketServer.registerPastToolResultImages (cognitive 24) · ×1
  • BridgeWebSocketServer.registerPastToolResultImages (cognitive 24) REDACTED:3168 — BridgeWebSocketServer.registerPastToolResultImages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), boolean chains 2, ternaries 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 · BridgeWebSocketServer.listSnapshotOnlyCodexSessions (cognitive 24) · ×1
  • BridgeWebSocketServer.listSnapshotOnlyCodexSessions (cognitive 24) REDACTED:9708 — BridgeWebSocketServer.listSnapshotOnlyCodexSessions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2 (3 pts), boolean chains 1, 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 · websocket.normalizeHistoryContent (cognitive 24) · ×1
  • websocket.normalizeHistoryContent (cognitive 24) REDACTED:361 — websocket.normalizeHistoryContent has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 6 (9 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 · doctor.checkCliProviders (cognitive 24) · ×1
  • doctor.checkCliProviders (cognitive 24) REDACTED:111 — doctor.checkCliProviders has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 3 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 4). 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, 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 · _FileBrowserViewState.build (cognitive 23) · ×1
  • _FileBrowserViewState.build (cognitive 23) apps/mobile/lib/features/file_browser/file_browser_view.dart:95 — _FileBrowserViewState.build has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (7 pts), if/else 5 (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 · _HtmlFilePreviewState._loadPreview (cognitive 23) · ×1
  • _HtmlFilePreviewState._loadPreview (cognitive 23) apps/mobile/lib/features/file_peek/widgets/html_file_preview.dart:59 — _HtmlFilePreviewState._loadPreview has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, 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 · GalleryImageViewer.build (cognitive 23) · ×1
  • GalleryImageViewer.build (cognitive 23) apps/mobile/lib/features/gallery/widgets/gallery_image_viewer.dart:31 — GalleryImageViewer.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 4 (6 pts), boolean chains 2, match/switch 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 · _SessionListScreenState._showRecentSessionActions (cognitive 23) · ×1
  • _SessionListScreenState._showRecentSessionActions (cognitive 23) apps/mobile/lib/features/session_list/session_list_screen.dart:1358 — _SessionListScreenState._showRecentSessionActions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, ternaries 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 · SessionFilterBar.build (cognitive 23) · ×1
  • SessionFilterBar.build (cognitive 23) apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart:54 — SessionFilterBar.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (7 pts), loops 3 (5 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 · ServerMessage.fromJson (cognitive 23) · ×1
  • ServerMessage.fromJson (cognitive 23) apps/mobile/lib/models/messages.dart:807 — ServerMessage.fromJson has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (18 pts), match/switch 3 (5 pts) (nesting depth added 11). 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 · _StripPrimaryAction.build (cognitive 23) · ×1
  • _StripPrimaryAction.build (cognitive 23) apps/mobile/lib/widgets/chat_input_bar.dart:1524 — _StripPrimaryAction.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 4, match/switch 2 (4 pts), if/else 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 · upload-duo-screenshots.main (cognitive 23) · ×1
  • upload-duo-screenshots.main (cognitive 23) scripts/store-review/upload-duo-screenshots.py:74 — upload-duo-screenshots.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (3 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 · DoctorPageView.body (cognitive 23) · ×1
  • DoctorPageView.body (cognitive 23) apps/menubar/CCPocketMenubar/Views/DoctorPage/DoctorPageView.swift:9 — DoctorPageView.body has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (8 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 · sessions-index.hydrateClaudeIndexedEntry (cognitive 23) · ×1
  • sessions-index.hydrateClaudeIndexedEntry (cognitive 23) packages/bridge/src/sessions-index.ts:864 — sessions-index.hydrateClaudeIndexedEntry has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 7 (8 pts), if/else 4 (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 · codex-process.formatDynamicToolResult (cognitive 23) · ×1
  • codex-process.formatDynamicToolResult (cognitive 23) REDACTED:4862 — codex-process.formatDynamicToolResult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 5 (7 pts), boolean chains 4, loops 1 (2 pts) (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 · git-operations.collectFileSystemFiles.visit (cognitive 23) · ×1
  • git-operations.collectFileSystemFiles.visit (cognitive 23) REDACTED:722 — git-operations.collectFileSystemFiles.visit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2, ternaries 1 (2 pts), boolean chains 1, 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 · _ClaudeSessionScreenState._listenForSessionCreated (cognitive 22) · ×1
  • _ClaudeSessionScreenState._listenForSessionCreated (cognitive 22) apps/mobile/lib/features/claude_session/claude_session_screen.dart:253 — _ClaudeSessionScreenState._listenForSessionCreated has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10 (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 · _CodexSessionScreenState._listenForSessionCreated (cognitive 22) · ×1
  • _CodexSessionScreenState._listenForSessionCreated (cognitive 22) apps/mobile/lib/features/codex_session/codex_session_screen.dart:274 — _CodexSessionScreenState._listenForSessionCreated has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10 (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 · MachineManagerService._mergeStoredMachines (cognitive 22) · ×1
  • MachineManagerService._mergeStoredMachines (cognitive 22) apps/mobile/lib/services/machine_manager_service.dart:261 — MachineManagerService._mergeStoredMachines has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 7, loops 3 (5 pts), 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 · MachineManagerService.updateMachine (cognitive 22) · ×1
  • MachineManagerService.updateMachine (cognitive 22) apps/mobile/lib/services/machine_manager_service.dart:581 — MachineManagerService.updateMachine has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 9, ternaries 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 · _ToolApprovalArea.build (cognitive 22) · ×1
  • _ToolApprovalArea.build (cognitive 22) apps/mobile/lib/widgets/session_card.dart:852 — _ToolApprovalArea.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 6 (8 pts), boolean chains 4 (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 · CodexProcess.processItemStarted (cognitive 22) · ×1
  • CodexProcess.processItemStarted (cognitive 22) REDACTED:3598 — CodexProcess.processItemStarted has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (19 pts), boolean chains 1, if/else 1, match/switch 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 · websocket.buildCodexHistoryPrefix (cognitive 22) · ×1
  • websocket.buildCodexHistoryPrefix (cognitive 22) REDACTED:400 — websocket.buildCodexHistoryPrefix has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 2 (nesting depth added 7). Of this number, 14 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 · runProbe (cognitive 22) · ×1
  • runProbe (cognitive 22) tmp/verification/codex-app-server-effort-probe.mjs:15 — runProbe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 pts), loops 2, other 1 (nesting depth added 9). None of this is in the body itself: all 22 points belong to 7 function items inside it that branch (a function literal at line 54, settleError, a function literal at line 96, …). 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 · FileUploadTransport.upload (cognitive 21) · ×1
  • FileUploadTransport.upload (cognitive 21) apps/mobile/lib/features/file_upload/file_upload_transport.dart:67 — FileUploadTransport.upload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 2, 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 · GitViewCubit._onDiffImageResult (cognitive 21) · ×1
  • GitViewCubit._onDiffImageResult (cognitive 21) apps/mobile/lib/features/git/state/git_view_cubit.dart:383 — GitViewCubit._onDiffImageResult has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (7 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 · DiffContentList._buildFileSection (cognitive 21) · ×1
  • DiffContentList._buildFileSection (cognitive 21) apps/mobile/lib/features/git/widgets/diff_content_list.dart:115 — DiffContentList._buildFileSection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (6 pts), boolean chains 3 (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 · _SessionListScreenState._loadPreferencesAndAutoConnect (cognitive 21) · ×1
  • _SessionListScreenState._loadPreferencesAndAutoConnect (cognitive 21) apps/mobile/lib/features/session_list/session_list_screen.dart:501 — _SessionListScreenState._loadPreferencesAndAutoConnect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, error handling 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 · SettingsCubit._load (cognitive 21) · ×1
  • SettingsCubit._load (cognitive 21) apps/mobile/lib/features/settings/state/settings_cubit.dart:164 — SettingsCubit._load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (6 pts), boolean chains 2, loops 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 · _CompactWindowRow.build (cognitive 21) · ×1
  • _CompactWindowRow.build (cognitive 21) apps/mobile/lib/features/settings/widgets/usage_section.dart:708 — _CompactWindowRow.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 9, 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 · BridgeService._markScopedRequestSent (cognitive 21) · ×1
  • BridgeService._markScopedRequestSent (cognitive 21) apps/mobile/lib/services/bridge_service.dart:3446 — BridgeService._markScopedRequestSent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (2 pts), ternaries 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 · PromptHistoryService.matchesFilters (cognitive 21) · ×1
  • PromptHistoryService.matchesFilters (cognitive 21) apps/mobile/lib/services/prompt_history_service.dart:674 — PromptHistoryService.matchesFilters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9 (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 · _ApprovalButtons.build (cognitive 21) · ×1
  • _ApprovalButtons.build (cognitive 21) apps/mobile/lib/widgets/approval_bar.dart:353 — _ApprovalButtons.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (7 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 · ResultChip.build (cognitive 21) · ×1
  • ResultChip.build (cognitive 21) apps/mobile/lib/widgets/bubbles/result_chip.dart:26 — ResultChip.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 3 (5 pts), match/switch 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 · CodexSpeedButton.build (cognitive 21) · ×1
  • CodexSpeedButton.build (cognitive 21) apps/mobile/lib/widgets/codex_effort_slider.dart:495 — CodexSpeedButton.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 4 (8 pts), boolean chains 2, loops 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 · sessions-index.parseClaudeJsonlFileFast (cognitive 21) · ×1
  • sessions-index.parseClaudeJsonlFileFast (cognitive 21) packages/bridge/src/sessions-index.ts:781 — sessions-index.parseClaudeJsonlFileFast has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, error handling 1, 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 · sessions-index.appendImageGenerationResult (cognitive 21) · ×1
  • sessions-index.appendImageGenerationResult (cognitive 21) packages/bridge/src/sessions-index.ts:3153 — sessions-index.appendImageGenerationResult has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12 (15 pts), if/else 4, boolean chains 2 (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 · CodexProcess.forkThreadAtUserTurn (cognitive 21) · ×1
  • CodexProcess.forkThreadAtUserTurn (cognitive 21) REDACTED:929 — CodexProcess.forkThreadAtUserTurn has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (4 pts), boolean chains 2, 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 · CodexProcess.installToolSuggestion (cognitive 21) · ×1
  • CodexProcess.installToolSuggestion (cognitive 21) REDACTED:1641 — CodexProcess.installToolSuggestion has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · SessionManager.isSameUserInput (cognitive 21) · ×1
  • SessionManager.isSameUserInput (cognitive 21) packages/bridge/src/session.ts:1298 — SessionManager.isSameUserInput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 4 (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 · SessionManager.extractLastMessage (cognitive 21) · ×1
  • SessionManager.extractLastMessage (cognitive 21) packages/bridge/src/session.ts:1545 — SessionManager.extractLastMessage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 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 · LocalMediaSnapshot._prepare (cognitive 20) · ×1
  • LocalMediaSnapshot._prepare (cognitive 20) apps/mobile/lib/features/file_peek/playback/local_media_snapshot_io.dart:26 — LocalMediaSnapshot._prepare has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (8 pts), error handling 1 (nesting depth added 4). 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 · FinderRevealCubit._reveal (cognitive 20) · ×1
  • FinderRevealCubit._reveal (cognitive 20) apps/mobile/lib/features/file_peek/state/finder_reveal_cubit.dart:26 — FinderRevealCubit._reveal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 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 · FileTransferDialog._shareReadyFile (cognitive 20) · ×1
  • FileTransferDialog._shareReadyFile (cognitive 20) apps/mobile/lib/features/file_transfer/widgets/file_transfer_dialog.dart:88 — FileTransferDialog._shareReadyFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), boolean chains 1, 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 · GalleryScreen.build (cognitive 20) · ×1
  • GalleryScreen.build (cognitive 20) apps/mobile/lib/features/gallery/gallery_screen.dart:31 — GalleryScreen.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 7, if/else 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 · _GitScreenContent.build (cognitive 20) · ×1
  • _GitScreenContent.build (cognitive 20) apps/mobile/lib/features/git/git_screen.dart:900 — _GitScreenContent.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 6, if/else 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 · _SessionListScreenState._buildScaffoldBody (cognitive 20) · ×1
  • _SessionListScreenState._buildScaffoldBody (cognitive 20) apps/mobile/lib/features/session_list/session_list_screen.dart:1938 — _SessionListScreenState._buildScaffoldBody has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 7, boolean chains 5 (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 · _SessionListScreenState._buildBodyContent (cognitive 20) · ×1
  • _SessionListScreenState._buildBodyContent (cognitive 20) apps/mobile/lib/features/session_list/session_list_screen.dart:2109 — _SessionListScreenState._buildBodyContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (6 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 · _RecentAdvancedSearchSheetState.build (cognitive 20) · ×1
  • _RecentAdvancedSearchSheetState.build (cognitive 20) apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart:592 — _RecentAdvancedSearchSheetState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (7 pts), loops 2 (4 pts), boolean chains 3, if/else 3, match/switch 1 (3 pts) (nesting depth added 6). 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 · BridgeUpdateStatusTile.build (cognitive 20) · ×1
  • BridgeUpdateStatusTile.build (cognitive 20) apps/mobile/lib/features/settings/widgets/bridge_update_status_tile.dart:95 — BridgeUpdateStatusTile.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 20. 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 · _ToolResultPresentation.fromMessage (cognitive 20) · ×1
  • _ToolResultPresentation.fromMessage (cognitive 20) apps/mobile/lib/widgets/bubbles/tool_result_bubble.dart:513 — _ToolResultPresentation.fromMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1, match/switch 1, 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 · _NewSessionSheetContentState._refreshModelCatalogs (cognitive 20) · ×1
  • _NewSessionSheetContentState._refreshModelCatalogs (cognitive 20) apps/mobile/lib/widgets/new_session_sheet.dart:1042 — _NewSessionSheetContentState._refreshModelCatalogs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7 (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 · RecentSessionCard._formatDateRange (cognitive 20) · ×1
  • RecentSessionCard._formatDateRange (cognitive 20) apps/mobile/lib/widgets/session_card.dart:3171 — RecentSessionCard._formatDateRange has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, 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 · SlashCommandSheet.build (cognitive 20) · ×1
  • SlashCommandSheet.build (cognitive 20) apps/mobile/lib/widgets/slash_command_sheet.dart:273 — SlashCommandSheet.build has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 6 (7 pts), boolean chains 3 (nesting depth added 6). 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 · delivery.extract (cognitive 20) · ×1
  • delivery.extract (cognitive 20) scripts/store-review/apps/delivery.py:37 — delivery.extract has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (4 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 · sdk-process.matchesSessionRule (cognitive 20) · ×1
  • sdk-process.matchesSessionRule (cognitive 20) packages/bridge/src/sdk-process.ts:258 — sdk-process.matchesSessionRule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1, 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 · RecordingStore.extractInfoFromJsonl (cognitive 20) · ×1
  • RecordingStore.extractInfoFromJsonl (cognitive 20) packages/bridge/src/recording-store.ts:121 — RecordingStore.extractInfoFromJsonl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, error handling 2 (3 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 · BridgeWebSocketServer.splitPastHistoryMessages (cognitive 20) · ×1
  • BridgeWebSocketServer.splitPastHistoryMessages (cognitive 20) REDACTED:2471 — BridgeWebSocketServer.splitPastHistoryMessages has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 2 (4 pts), 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 · BridgeWebSocketServer.prepareServerMessageForClient (cognitive 20) · ×1
  • BridgeWebSocketServer.prepareServerMessageForClient (cognitive 20) REDACTED:10777 — BridgeWebSocketServer.prepareServerMessageForClient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 6). Of this number, 16 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 · BridgeWebSocketServer.buildResumeSessionMessage (cognitive 20) · ×1
  • BridgeWebSocketServer.buildResumeSessionMessage (cognitive 20) REDACTED:11570 — BridgeWebSocketServer.buildResumeSessionMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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 · websocket.buildRecentSessionPredicate.<returned closure> (cognitive 20) · ×1
  • websocket.buildRecentSessionPredicate.<returned closure> (cognitive 20) REDACTED:984 — websocket.buildRecentSessionPredicate.<returned closure> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, ternaries 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 · setup-systemd.setupSystemd (cognitive 20) · ×1
  • setup-systemd.setupSystemd (cognitive 20) packages/bridge/src/setup-systemd.ts:96 — setup-systemd.setupSystemd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 4, error handling 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 · ChatSessionCubit._entriesEquivalent (cognitive 19) · ×1
  • ChatSessionCubit._entriesEquivalent (cognitive 19) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1515 — ChatSessionCubit._entriesEquivalent has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (9 pts) (nesting depth added 2). 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 · _ChatMessageListState._measureVisibleAnchor (cognitive 19) · ×1
  • _ChatMessageListState._measureVisibleAnchor (cognitive 19) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:386 — _ChatMessageListState._measureVisibleAnchor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, ternaries 1 (3 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 · _FilePeekMediaPreviewState._open (cognitive 19) · ×1
  • _FilePeekMediaPreviewState._open (cognitive 19) apps/mobile/lib/features/file_peek/widgets/file_peek_media_preview.dart:122 — _FilePeekMediaPreviewState._open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, error handling 1, 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 · _NewProjectSheetState.build (cognitive 19) · ×1
  • _NewProjectSheetState.build (cognitive 19) apps/mobile/lib/features/project_setup/widgets/new_project_sheet.dart:138 — _NewProjectSheetState.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9, boolean chains 6, if/else 3, loops 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 · _InputTextFieldState.didChangeAppLifecycleState (cognitive 19) · ×1
  • _InputTextFieldState.didChangeAppLifecycleState (cognitive 19) apps/mobile/lib/widgets/chat_input_bar.dart:862 — _InputTextFieldState.didChangeAppLifecycleState has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (7 pts), match/switch 1 (nesting depth added 3). 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 · _IOSImagePasteContextMenuState._show (cognitive 19) · ×1
  • _IOSImagePasteContextMenuState._show (cognitive 19) apps/mobile/lib/widgets/ios_image_paste_context_menu.dart:40 — _IOSImagePasteContextMenuState._show has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, 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 · _NewSessionSheetContentState.initState (cognitive 19) · ×1
  • _NewSessionSheetContentState.initState (cognitive 19) apps/mobile/lib/widgets/new_session_sheet.dart:861 — _NewSessionSheetContentState.initState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 2 (4 pts), boolean chains 2 (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 · _WorktreeOptions.build (cognitive 19) · ×1
  • _WorktreeOptions.build (cognitive 19) apps/mobile/lib/widgets/new_session_sheet.dart:3956 — _WorktreeOptions.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 1 (4 pts), ternaries 2 (4 pts), boolean chains 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 · RecentSessionCard.build (cognitive 19) · ×1
  • RecentSessionCard.build (cognitive 19) apps/mobile/lib/widgets/session_card.dart:2822 — RecentSessionCard.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, ternaries 5, boolean chains 4. 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 · delivery.validate_manifest (cognitive 19) · ×1
  • delivery.validate_manifest (cognitive 19) scripts/store-review/apps/delivery.py:18 — delivery.validate_manifest has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (4 pts), ternaries 3 (4 pts), boolean chains 1 (nesting depth added 8). 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 · NetworkDiscovery.getReachableAddresses (cognitive 19) · ×1
  • NetworkDiscovery.getReachableAddresses (cognitive 19) apps/menubar/CCPocketMenubar/Services/NetworkDiscovery.swift:7 — NetworkDiscovery.getReachableAddresses has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, 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 · worktree.parseGtrConfig (cognitive 19) · ×1
  • worktree.parseGtrConfig (cognitive 19) REDACTED:30 — worktree.parseGtrConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (6 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 · worktree.copyConfiguredFiles (cognitive 19) · ×1
  • worktree.copyConfiguredFiles (cognitive 19) REDACTED:154 — worktree.copyConfiguredFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (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 · parser.parseClientMessage · ×1
  • parser.parseClientMessage::isPromptHistoryEntry (cognitive 19) packages/bridge/src/parser.ts:1479 — parser.parseClientMessage::isPromptHistoryEntry has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 9. 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. This shape REPEATS in the file: one other method here (parser.parseClientMessage) 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 · sdk-process.backgroundTasksFromSdk (cognitive 19) · ×1
  • sdk-process.backgroundTasksFromSdk (cognitive 19) packages/bridge/src/sdk-process.ts:557 — sdk-process.backgroundTasksFromSdk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 5, 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 · sessions-index.findSessionsByClaudeIds (cognitive 19) · ×1
  • sessions-index.findSessionsByClaudeIds (cognitive 19) packages/bridge/src/sessions-index.ts:4496 — sessions-index.findSessionsByClaudeIds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (5 pts), loops 2 (3 pts), boolean chains 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 · CodexProcess.rewindBeforeUserTurn (cognitive 19) · ×1
  • CodexProcess.rewindBeforeUserTurn (cognitive 19) REDACTED:874 — CodexProcess.rewindBeforeUserTurn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1, 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 · SessionManager.findAssistantUuidBeforeUser (cognitive 19) · ×1
  • SessionManager.findAssistantUuidBeforeUser (cognitive 19) packages/bridge/src/session.ts:2170 — SessionManager.findAssistantUuidBeforeUser has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, loops 2 (3 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 · UploadStore.publish (cognitive 19) · ×1
  • UploadStore.publish (cognitive 19) packages/bridge/src/upload-store.ts:556 — UploadStore.publish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (4 pts), boolean chains 1, loops 1, 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 · git-operations.listGitFilesWithArgsForClient (cognitive 19) · ×1
  • git-operations.listGitFilesWithArgsForClient (cognitive 19) REDACTED:380 — git-operations.listGitFilesWithArgsForClient has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 3). None of this is in the body itself: all 19 points belong to 7 function literals inside it that branch (lines 452, 418, 434, …). 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 · websocket.countCodexUserTurnsInSession (cognitive 19) · ×1
  • websocket.countCodexUserTurnsInSession (cognitive 19) REDACTED:326 — websocket.countCodexUserTurnsInSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). 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 · setup-launchd.setupLaunchd (cognitive 19) · ×1
  • setup-launchd.setupLaunchd (cognitive 19) packages/bridge/src/setup-launchd.ts:47 — setup-launchd.setupLaunchd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 4, error handling 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 · _ExploreScreenState._pickAndUploadFiles (cognitive 18) · ×1
  • _ExploreScreenState._pickAndUploadFiles (cognitive 18) apps/mobile/lib/features/explore/explore_screen.dart:142 — _ExploreScreenState._pickAndUploadFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 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 · _DiffBottomBar.build (cognitive 18) · ×1
  • _DiffBottomBar.build (cognitive 18) apps/mobile/lib/features/git/git_screen.dart:998 — _DiffBottomBar.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 5, boolean chains 4, loops 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 · DiffImageViewer.build (cognitive 18) · ×1
  • DiffImageViewer.build (cognitive 18) apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:42 — DiffImageViewer.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 5, boolean chains 2, 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 · _ProjectRecentSessionGroup.build (cognitive 18) · ×1
  • _ProjectRecentSessionGroup.build (cognitive 18) apps/mobile/lib/features/session_list/widgets/home_content.dart:1421 — _ProjectRecentSessionGroup.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). 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 · _RecentProjectPickerSheetState.build (cognitive 18) · ×1
  • _RecentProjectPickerSheetState.build (cognitive 18) apps/mobile/lib/features/session_list/widgets/recent_session_filter_sheets.dart:145 — _RecentProjectPickerSheetState.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (4 pts), loops 2 (3 pts), 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, 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 · SketchDocument.decode (cognitive 18) · ×1
  • SketchDocument.decode (cognitive 18) apps/mobile/lib/features/sketch/sketch_document.dart:64 — SketchDocument.decode has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (5 pts) (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 · BridgeService._sendRecentSessionsRequest (cognitive 18) · ×1
  • BridgeService._sendRecentSessionsRequest (cognitive 18) apps/mobile/lib/services/bridge_service.dart:3240 — BridgeService._sendRecentSessionsRequest has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9, boolean chains 4, loops 3, if/else 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 · ReplayBridgeService._buildChunks (cognitive 18) · ×1
  • ReplayBridgeService._buildChunks (cognitive 18) apps/mobile/lib/services/replay_bridge_service.dart:87 — ReplayBridgeService._buildChunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (3 pts), 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 · SshStartupService.startBridgeServer (cognitive 18) · ×1
  • SshStartupService.startBridgeServer (cognitive 18) apps/mobile/lib/services/ssh_startup_service.dart:572 — SshStartupService.startBridgeServer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (SshStartupService.updateBridgeServer) 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 · SshStartupService.updateBridgeServer (cognitive 18) · ×1
  • SshStartupService.updateBridgeServer (cognitive 18) apps/mobile/lib/services/ssh_startup_service.dart:777 — SshStartupService.updateBridgeServer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (SshStartupService.startBridgeServer) 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 · _MediaExportActionsState._export (cognitive 18) · ×1
  • _MediaExportActionsState._export (cognitive 18) apps/mobile/lib/widgets/media_export_actions.dart:33 — _MediaExportActionsState._export has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (3 pts), ternaries 1 (3 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 · ProcessError.errorDescription (cognitive 18) · ×1
  • ProcessError.errorDescription (cognitive 18) apps/menubar/CCPocketMenubar/Services/BridgeProcessManager.swift:191 — ProcessError.errorDescription has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 7). 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 · OnboardingView.buildStepList (cognitive 18) · ×1
  • OnboardingView.buildStepList (cognitive 18) apps/menubar/CCPocketMenubar/Views/OnboardingView.swift:351 — OnboardingView.buildStepList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (4 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 · SdkProcess.updateStatusFromMessage (cognitive 18) · ×1
  • SdkProcess.updateStatusFromMessage (cognitive 18) packages/bridge/src/sdk-process.ts:2095 — SdkProcess.updateStatusFromMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 7). 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 · BridgeWebSocketServer.listRecentCodexThreads (cognitive 18) · ×1
  • BridgeWebSocketServer.listRecentCodexThreads (cognitive 18) REDACTED:10395 — BridgeWebSocketServer.listRecentCodexThreads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatSessionCubit._applySessionContext (cognitive 17) · ×1
  • ChatSessionCubit._applySessionContext (cognitive 17) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:571 — ChatSessionCubit._applySessionContext has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8, boolean chains 4, if/else 3, match/switch 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 · ChatSessionCubit._rollbackFailedModeChange (cognitive 17) · ×1
  • ChatSessionCubit._rollbackFailedModeChange (cognitive 17) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:2708 — ChatSessionCubit._rollbackFailedModeChange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 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 · _ChatMessageListState._deriveData (cognitive 17) · ×1
  • _ChatMessageListState._deriveData (cognitive 17) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:820 — _ChatMessageListState._deriveData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 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 · _ChatMessageListState._findPlanFromWriteTool (cognitive 17) · ×1
  • _ChatMessageListState._findPlanFromWriteTool (cognitive 17) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:900 — _ChatMessageListState._findPlanFromWriteTool has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, 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 · _GeneratedImagePreviewScreenState.build (cognitive 17) · ×1
  • _GeneratedImagePreviewScreenState.build (cognitive 17) apps/mobile/lib/features/generated_image_preview/generated_image_preview_screen.dart:161 — _GeneratedImagePreviewScreenState.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 3 (4 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 · _SessionListScreenState._connectToMachineConfig (cognitive 17) · ×1
  • _SessionListScreenState._connectToMachineConfig (cognitive 17) apps/mobile/lib/features/session_list/session_list_screen.dart:2452 — _SessionListScreenState._connectToMachineConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, 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 · WorkspaceShellScreenState._notifyPresentationChanged (cognitive 17) · ×1
  • WorkspaceShellScreenState._notifyPresentationChanged (cognitive 17) apps/mobile/lib/features/session_list/workspace_shell_screen.dart:251 — WorkspaceShellScreenState._notifyPresentationChanged has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 2 (5 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 · ChatMessageHandler._handlePastHistory (cognitive 17) · ×1
  • ChatMessageHandler._handlePastHistory (cognitive 17) apps/mobile/lib/services/chat_message_handler.dart:573 — ChatMessageHandler._handlePastHistory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (5 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 · MachineManagerService.addMachine (cognitive 17) · ×1
  • MachineManagerService.addMachine (cognitive 17) apps/mobile/lib/services/machine_manager_service.dart:507 — MachineManagerService.addMachine has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 3. 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 · prepare.validate (cognitive 17) · ×1
  • prepare.validate (cognitive 17) scripts/store-review/apps/prepare.py:14 — prepare.validate has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), loops 2 (5 pts), boolean chains 2, if/else 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 · DoctorViewModel.cliProviderCommands (cognitive 17) · ×1
  • DoctorViewModel.cliProviderCommands (cognitive 17) apps/menubar/CCPocketMenubar/ViewModels/DoctorViewModel.swift:340 — DoctorViewModel.cliProviderCommands has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 2 (6 pts), boolean chains 2, 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 · index.relay (cognitive 17) · ×1
  • index.relay (cognitive 17) functions/src/index.ts:361 — index.relay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (6 pts), error handling 1, match/switch 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 · sessions-index.findSessionJsonlPath (cognitive 17) · ×1
  • sessions-index.findSessionJsonlPath (cognitive 17) packages/bridge/src/sessions-index.ts:3410 — sessions-index.findSessionJsonlPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 4 (7 pts), loops 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 · SessionManager.nextCodexUserTurnUuid (cognitive 17) · ×1
  • SessionManager.nextCodexUserTurnUuid (cognitive 17) packages/bridge/src/session.ts:1408 — SessionManager.nextCodexUserTurnUuid has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 5). 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 · SessionManager.retractableUserInput (cognitive 17) · ×1
  • SessionManager.retractableUserInput (cognitive 17) packages/bridge/src/session.ts:2106 — SessionManager.retractableUserInput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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 · BridgeWebSocketServer.listRecentSessions (cognitive 17) · ×1
  • BridgeWebSocketServer.listRecentSessions (cognitive 17) REDACTED:9548 — BridgeWebSocketServer.listRecentSessions has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 6, if/else 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 · ChatSessionCubit._mergeEquivalentEntry (cognitive 16) · ×1
  • ChatSessionCubit._mergeEquivalentEntry (cognitive 16) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1699 — ChatSessionCubit._mergeEquivalentEntry has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 2, if/else 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 · ChatSessionCubit.setClaudeSettings (cognitive 16) · ×1
  • ChatSessionCubit.setClaudeSettings (cognitive 16) apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:2612 — ChatSessionCubit.setClaudeSettings has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 3. 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 · _ChatMessageListState._entryKeyBase (cognitive 16) · ×1
  • _ChatMessageListState._entryKeyBase (cognitive 16) apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:932 — _ChatMessageListState._entryKeyBase has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 7). 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 · _SwipeStageDismissible.build (cognitive 16) · ×1
  • _SwipeStageDismissible.build (cognitive 16) apps/mobile/lib/features/git/widgets/diff_content_list.dart:248 — _SwipeStageDismissible.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9, if/else 4 (5 pts), boolean chains 2 (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 · _ConnectedStatus.build (cognitive 16) · ×1
  • _ConnectedStatus.build (cognitive 16) apps/mobile/lib/features/settings/widgets/settings_status_card.dart:159 — _ConnectedStatus.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, 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 · DraftService._loadAll (cognitive 16) · ×1
  • DraftService._loadAll (cognitive 16) apps/mobile/lib/services/draft_service.dart:28 — DraftService._loadAll 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 · SkillTriggerCatalog.fromCompletionItems (cognitive 16) · ×1
  • SkillTriggerCatalog.fromCompletionItems (cognitive 16) apps/mobile/lib/utils/skill_invocation.dart:23 — SkillTriggerCatalog.fromCompletionItems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 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 · _AskUserQuestionWidgetState.build (cognitive 16) · ×1
  • _AskUserQuestionWidgetState.build (cognitive 16) apps/mobile/lib/widgets/bubbles/ask_user_question_widget.dart:328 — _AskUserQuestionWidgetState.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6, boolean chains 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 · InlineEditDiff.build (cognitive 16) · ×1
  • InlineEditDiff.build (cognitive 16) apps/mobile/lib/widgets/bubbles/inline_edit_diff.dart:25 — InlineEditDiff.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), 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 · _StreamingBubbleState._buildMarkdownBlocks (cognitive 16) · ×1
  • _StreamingBubbleState._buildMarkdownBlocks (cognitive 16) apps/mobile/lib/widgets/bubbles/streaming_bubble.dart:104 — _StreamingBubbleState._buildMarkdownBlocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, 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 · ChatEntryWidget.build (cognitive 16) · ×1
  • ChatEntryWidget.build (cognitive 16) apps/mobile/lib/widgets/message_bubble.dart:75 — ChatEntryWidget.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 5, if/else 2, match/switch 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 · SdkProcess.createUserMessageStream (cognitive 16) · ×1
  • SdkProcess.createUserMessageStream (cognitive 16) packages/bridge/src/sdk-process.ts:1617 — SdkProcess.createUserMessageStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (3 pts), boolean chains 2, 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 · sessions-index.scanJsonlDir (cognitive 16) · ×1
  • sessions-index.scanJsonlDir (cognitive 16) packages/bridge/src/sessions-index.ts:1068 — sessions-index.scanJsonlDir has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), error handling 1, loops 1 (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 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 · sessions-index.hasCodexUserMessage (cognitive 16) · ×1
  • sessions-index.hasCodexUserMessage (cognitive 16) packages/bridge/src/sessions-index.ts:1801 — sessions-index.hasCodexUserMessage 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). 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 · project-bootstrap.bootstrapProject · ×1
  • project-bootstrap.bootstrapProject::copy (cognitive 16) packages/bridge/src/project-bootstrap.ts:27 — project-bootstrap.bootstrapProject::copy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 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.
D2 · Cognitive Complexity · MediaStore.serveEntry (cognitive 16) · ×1
  • MediaStore.serveEntry (cognitive 16) packages/bridge/src/media-store.ts:209 — MediaStore.serveEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 3, error handling 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 · BridgeWebSocketServer.prepareFileUpload (cognitive 16) · ×1
  • BridgeWebSocketServer.prepareFileUpload (cognitive 16) REDACTED:1561 — BridgeWebSocketServer.prepareFileUpload has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 4, if/else 4, error handling 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 · BridgeWebSocketServer.rewindCodexConversation (cognitive 16) · ×1
  • BridgeWebSocketServer.rewindCodexConversation (cognitive 16) REDACTED:2055 — BridgeWebSocketServer.rewindCodexConversation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 3, ternaries 3, error handling 1. 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: 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 · startup-info.printStartupInfo (cognitive 16) · ×1
  • startup-info.printStartupInfo (cognitive 16) REDACTED:63 — startup-info.printStartupInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, loops 3 (4 pts), ternaries 3, boolean chains 2, 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: git_screen.dart, diff_file_header.dart, diff_hunk_widget.dart apps/mobile/lib/features/git/git_screen.dart — 3 files — `apps/mobile/lib/features/git/git_screen.dart`, `apps/mobile/lib/features/git/widgets/diff_file_header.dart`, `apps/mobile/lib/features/git/widgets/diff_hunk_widget.dart` — 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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (666 shared lines) · ×1
  • Near-duplicate member pair (666 shared lines) apps/mobile/lib/features/claude_session/claude_session_screen.dart:604 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:604-1477 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:664-1631 — These two members are variants of one another: 666 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) apps/mobile/lib/models/messages.dart:5444 — apps/mobile/lib/models/messages.dart:5444-5508 | apps/mobile/lib/services/bridge_service.dart:3679-3743 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:53 — apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:53-108 | apps/mobile/lib/features/settings/widgets/new_session_tabs_bottom_sheet.dart:78-176 | apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart:55-113 | apps/mobile/lib/features/settings/widgets/terminal_app_bottom_sheet.dart:120-308 | apps/mobile/lib/features/settings/widgets/theme_bottom_sheet.dart:40-104 | apps/mobile/lib/widgets/plan_detail_sheet.dart:38-95 | apps/mobile/lib/widgets/screenshot_sheet.dart:129-283 | apps/mobile/lib/widgets/worktree_list_sheet.dart:127-211 — These 8 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 8 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 8 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:980 — apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:980-1033 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1054-1112 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1129-1174 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1236-1288 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1303-1341 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1356-1400 — These 6 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 6 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 6 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:42 — apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:42-55 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:72-84 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:86-99 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:101-114 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:116-129 — 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.
D4 · Code Duplication · Duplicated block (115 lines × 2) · ×1
  • Duplicated block (115 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1021 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1021-1135 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1123-1237 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (100–103 lines × 2) · ×1
  • Duplicated block (100–103 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:744 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:744-846 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:823-922 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:963 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:963-1019 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1065-1121 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:695 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:695-738 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:758-801 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) apps/mobile/lib/theme/app_theme.dart:512 — apps/mobile/lib/theme/app_theme.dart:512-553 | apps/mobile/lib/theme/app_theme.dart:558-599 — 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.
D4 · Code Duplication · Duplicated block (40–41 lines × 2) · ×1
  • Duplicated block (40–41 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:632 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:632-672 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:690-729 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:253 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:253-291 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:274-311 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) apps/mobile/lib/widgets/session_card.dart:1081 — apps/mobile/lib/widgets/session_card.dart:1081-1119 | apps/mobile/lib/widgets/session_card.dart:1249-1287 — 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.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1242 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1242-1276 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1373-1407 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (34 lines × 3) · ×1
  • Duplicated block (34 lines × 3) apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1000 — apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1000-1033 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1079-1112 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1367-1400 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) apps/mobile/lib/widgets/session_card.dart:1191 — apps/mobile/lib/widgets/session_card.dart:1191-1224 | apps/mobile/lib/widgets/session_card.dart:1314-1347 — 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.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) apps/mobile/lib/widgets/bubbles/user_bubble.dart:321 — apps/mobile/lib/widgets/bubbles/user_bubble.dart:321-353 | apps/mobile/lib/widgets/bubbles/user_bubble.dart:463-495 — 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.
D4 · Code Duplication · Duplicated block (29 lines × 3) · ×1
  • Duplicated block (29 lines × 3) apps/mobile/lib/services/store_screenshot_extension.dart:534 — apps/mobile/lib/services/store_screenshot_extension.dart:534-562 | apps/mobile/lib/services/store_screenshot_extension.dart:1098-1126 | apps/mobile/lib/services/store_screenshot_extension.dart:1504-1532 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) apps/mobile/lib/features/git/git_screen.dart:538 — apps/mobile/lib/features/git/git_screen.dart:538-565 | apps/mobile/lib/features/git/git_screen.dart:618-646 — 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) apps/mobile/lib/features/git/widgets/diff_content_list.dart:278 — apps/mobile/lib/features/git/widgets/diff_content_list.dart:278-304 | apps/mobile/lib/features/git/widgets/diff_hunk_widget.dart:540-566 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:1452 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:1452-1477 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1609-1631 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:408 — apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:408-432 | apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:538-562 | apps/mobile/lib/features/git/widgets/diff_image_viewer.dart:671-695 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:851 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:851-875 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:929-953 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:878 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:878-902 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:957-980 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (23–24 lines × 3) · ×1
  • Duplicated block (23–24 lines × 3) apps/mobile/lib/widgets/plan_detail_sheet.dart:48 — apps/mobile/lib/widgets/plan_detail_sheet.dart:48-70 | apps/mobile/lib/widgets/screenshot_sheet.dart:137-160 | apps/mobile/lib/widgets/worktree_list_sheet.dart:133-156 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:675 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:675-693 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:732-753 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (21 lines × 5) · ×1
  • Duplicated block (21 lines × 5) apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:60 — apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:60-80 | apps/mobile/lib/features/settings/widgets/new_session_tabs_bottom_sheet.dart:85-105 | apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart:62-82 | apps/mobile/lib/features/settings/widgets/terminal_app_bottom_sheet.dart:131-151 | apps/mobile/lib/features/settings/widgets/theme_bottom_sheet.dart:47-67 — before extracting anything, compare `apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart` and `apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:290 — apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:290-310 | apps/mobile/lib/widgets/bubbles/result_chip.dart:101-121 | apps/mobile/lib/widgets/plan_detail_sheet.dart:115-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart:216 — apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart:216-233 | apps/mobile/lib/features/session_list/widgets/session_filter_bar.dart:309-328 — 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) apps/mobile/lib/features/session_list/widgets/bridge_update_banner.dart:32 — apps/mobile/lib/features/session_list/widgets/bridge_update_banner.dart:32-49 | apps/mobile/lib/features/session_list/widgets/support_banner.dart:17-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17 lines × 8) · ×1
  • Duplicated block (17 lines × 8) apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:61 — apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart:61-77 | apps/mobile/lib/features/settings/widgets/new_session_tabs_bottom_sheet.dart:86-102 | apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart:63-79 | apps/mobile/lib/features/settings/widgets/terminal_app_bottom_sheet.dart:132-148 | apps/mobile/lib/features/settings/widgets/theme_bottom_sheet.dart:48-64 | apps/mobile/lib/widgets/plan_detail_sheet.dart:51-67 | apps/mobile/lib/widgets/screenshot_sheet.dart:141-157 | apps/mobile/lib/widgets/worktree_list_sheet.dart:137-153 — before extracting anything, compare `apps/mobile/lib/features/settings/widgets/app_locale_bottom_sheet.dart` and `apps/mobile/lib/features/settings/widgets/speech_locale_bottom_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:608 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:608-624 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:669-684 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (15–16 lines × 4) · ×1
  • Duplicated block (15–16 lines × 4) apps/mobile/lib/services/store_screenshot_extension.dart:666 — apps/mobile/lib/services/store_screenshot_extension.dart:666-680 | apps/mobile/lib/services/store_screenshot_extension.dart:820-835 | apps/mobile/lib/services/store_screenshot_extension.dart:965-979 | apps/mobile/lib/services/store_screenshot_extension.dart:1723-1737 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) apps/mobile/lib/widgets/file_mention_overlay.dart:113 — apps/mobile/lib/widgets/file_mention_overlay.dart:113-128 | apps/mobile/lib/widgets/file_mention_overlay.dart:171-185 | apps/mobile/lib/widgets/slash_command_overlay.dart:96-110 — before extracting anything, compare `apps/mobile/lib/widgets/file_mention_overlay.dart` and `apps/mobile/lib/widgets/slash_command_overlay.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) apps/mobile/lib/features/prompt_history/widgets/prompt_history_sheet.dart:108 — apps/mobile/lib/features/prompt_history/widgets/prompt_history_sheet.dart:108-123 | apps/mobile/lib/widgets/slash_command_sheet.dart:294-308 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) apps/mobile/lib/features/claude_session/claude_session_screen.dart:916 — apps/mobile/lib/features/claude_session/claude_session_screen.dart:916-930 | apps/mobile/lib/features/codex_session/codex_session_screen.dart:1010-1023 — `apps/mobile/lib/features/claude_session/claude_session_screen.dart` and `apps/mobile/lib/features/codex_session/codex_session_screen.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 850 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) apps/mobile/lib/features/session_list/widgets/home_content.dart:1704 — apps/mobile/lib/features/session_list/widgets/home_content.dart:1704-1717 | apps/mobile/lib/widgets/session_card.dart:459-471 | apps/mobile/lib/widgets/session_card.dart:2908-2920 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) apps/mobile/lib/features/session_list/session_list_screen.dart:1999 — apps/mobile/lib/features/session_list/session_list_screen.dart:1999-2011 | apps/mobile/lib/features/session_list/session_list_screen.dart:2068-2081 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) apps/mobile/lib/features/session_list/session_list_screen.dart:2570 — apps/mobile/lib/features/session_list/session_list_screen.dart:2570-2581 | apps/mobile/lib/features/session_list/session_list_screen.dart:2597-2608 | apps/mobile/lib/features/session_list/session_list_screen.dart:2624-2635 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) apps/mobile/lib/widgets/chat_input_bar.dart:270 — apps/mobile/lib/widgets/chat_input_bar.dart:270-280 | apps/mobile/lib/widgets/chat_input_bar.dart:414-424 | apps/mobile/lib/widgets/chat_input_bar.dart:520-530 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1003 — apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1003-1012 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1082-1091 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1137-1146 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1242-1251 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1310-1319 | apps/mobile/lib/features/chat_session/widgets/session_mode_bar.dart:1370-1379 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) apps/mobile/lib/widgets/chat_input_bar.dart:272 — apps/mobile/lib/widgets/chat_input_bar.dart:272-281 | apps/mobile/lib/widgets/chat_input_bar.dart:522-530 | apps/mobile/lib/widgets/chat_input_bar.dart:1420-1429 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) apps/mobile/lib/features/git/widgets/diff_file_header.dart:66 — apps/mobile/lib/features/git/widgets/diff_file_header.dart:66-74 | apps/mobile/lib/features/git/widgets/diff_stats_badge.dart:25-33 | apps/mobile/lib/widgets/bubbles/assistant_bubble.dart:763-771 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) apps/mobile/lib/features/git/state/git_view_cubit.dart:631 — apps/mobile/lib/features/git/state/git_view_cubit.dart:631-638 | apps/mobile/lib/features/git/state/git_view_cubit.dart:641-648 | apps/mobile/lib/features/git/state/git_view_cubit.dart:668-675 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×1
  • Duplicated block (6 lines × 2) apps/mobile/lib/features/git/git_screen.dart:328 — apps/mobile/lib/features/git/git_screen.dart:328-333 | apps/mobile/lib/features/setup_guide/setup_guide_screen.dart:34-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) apps/menubar/CCPocketMenubar/Views/QRCodePage/QRCodePageView.swift:9 — apps/menubar/CCPocketMenubar/Views/QRCodePage/QRCodePageView.swift:9-36 | apps/menubar/CCPocketMenubar/Views/UsagePage/UsagePageView.swift:45-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `apps/menubar/CCPocketMenubar/Views/QRCodePage/QRCodePageView.swift:9` 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) apps/menubar/CCPocketMenubar/Views/DoctorPage/DoctorPageView.swift:204 — apps/menubar/CCPocketMenubar/Views/DoctorPage/DoctorPageView.swift:204-213 | apps/menubar/CCPocketMenubar/Views/OnboardingView.swift:60-69 | apps/menubar/CCPocketMenubar/Views/QRCodePage/QRCodePageView.swift:11-20 | apps/menubar/CCPocketMenubar/Views/UsagePage/UsagePageView.swift:47-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `apps/menubar/CCPocketMenubar/Views/DoctorPage/DoctorPageView.swift: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.
D4 · Code Duplication · Duplicated block (1–5 lines × 8) · ×1
  • Duplicated block (1–5 lines × 8) apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:46 — apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:46-46 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:51-52 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:80-84 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:90-90 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:95-99 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:105-105 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:110-114 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:120-120 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:46` 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 (1–5 lines × 4) · ×1
  • Duplicated block (1–5 lines × 4) apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:61 — apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:61-61 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:66-70 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:76-76 | apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:125-129 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/menubar/CCPocketMenubar/Services/MockDoctorScenarios.swift:61` 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.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: ccpocket — ccpocket: abstractness 0.04, instability 0.00, distance 0.96 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
R10 · Code Duplication · Duplicated block (52 lines × 2 locations) · ×1
  • Duplicated block (52 lines × 2 locations) REDACTED:3565 — REDACTED:3565 · REDACTED:6268 — 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 (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) packages/bridge/src/setup-launchd.ts:47 — packages/bridge/src/setup-launchd.ts:47 · packages/bridge/src/setup-systemd.ts:96 — 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 (33 lines × 2 locations) · ×1
  • Duplicated block (33 lines × 2 locations) REDACTED:5586 — REDACTED:5586 · REDACTED:5620 — 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 (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) REDACTED:431 — REDACTED:431 · REDACTED:480 — 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 (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) REDACTED:4644 — REDACTED:4644 · REDACTED:4737 — 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.
R10 · Code Duplication · Duplicated block with local edits (28 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (28 matched lines × 2 locations) packages/bridge/src/claude-usage.ts:80 — packages/bridge/src/claude-usage.ts:80 · packages/bridge/src/sdk-process.ts:198 — the two spans are one implementation copied and then locally edited — 128 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 (27 lines × 2 locations) · ×1
  • Duplicated block (27 lines × 2 locations) REDACTED:4693 — REDACTED:4693 · REDACTED:5342 — 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 (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) packages/bridge/src/debug-trace-store.ts:61 — packages/bridge/src/debug-trace-store.ts:61 · packages/bridge/src/recording-store.ts:180 — 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 with local edits (21 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (21 matched lines × 2 locations) packages/bridge/src/codex-transport.ts:86 — packages/bridge/src/codex-transport.ts:86 · packages/bridge/src/codex-transport.ts:256 — the two spans are one implementation copied and then locally edited — 126 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 (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) REDACTED:6382 — REDACTED:6382 · REDACTED:6627 — 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 (20 lines × 9 locations) · ×1
  • Duplicated block (20 lines × 9 locations) REDACTED:7754 — REDACTED:7754 · REDACTED:7782 · REDACTED:7810 · REDACTED:7903 · +5 more site(s) not listed — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (20 lines × 3 locations) · ×1
  • Duplicated block (20 lines × 3 locations) REDACTED:8651 — REDACTED:8651 · REDACTED:8684 · REDACTED:8722 — all 3 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 (17 lines × 4 locations) · ×1
  • Duplicated block (17 lines × 4 locations) REDACTED:7800 — REDACTED:7800 · REDACTED:7985 · REDACTED:8013 · REDACTED:8041 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (15 lines × 11 locations) · ×1
  • Duplicated block (15 lines × 11 locations) REDACTED:7733 — REDACTED:7733 · REDACTED:7764 · REDACTED:7792 · REDACTED:7820 · +7 more site(s) not listed — all 11 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.
R2 · Cyclomatic Complexity · Complex function handleClientMessage (cyclomatic 649, cognitive 1131) · ×1
  • Complex function handleClientMessage (cyclomatic 649, cognitive 1131) REDACTED:3462 — handleClientMessage has cyclomatic complexity 649 and cognitive complexity 1131; 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 parseClientMessage (cyclomatic 553, cognitive 671) · ×1
  • Complex function parseClientMessage (cyclomatic 553, cognitive 671) packages/bridge/src/parser.ts:1464 — parseClientMessage has cyclomatic complexity 553 and cognitive complexity 671; 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 93, cognitive 152) · ×1
  • Complex function (anonymous) (cyclomatic 93, cognitive 152) packages/bridge/src/session.ts:502 — (anonymous) has cyclomatic complexity 93 and cognitive complexity 152; 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 parseCodexSessionJsonl (cyclomatic 79, cognitive 167) · ×1
  • Complex function parseCodexSessionJsonl (cyclomatic 79, cognitive 167) packages/bridge/src/sessions-index.ts:1559 — parseCodexSessionJsonl has cyclomatic complexity 79 and cognitive complexity 167; 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 parseFromChunks (cyclomatic 68, cognitive 152) · ×1
  • Complex function parseFromChunks (cyclomatic 68, cognitive 152) packages/bridge/src/sessions-index.ts:560 — parseFromChunks has cyclomatic complexity 68 and cognitive complexity 152; 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 getCodexSessionHistory (cyclomatic 66, cognitive 227) · ×1
  • Complex function getCodexSessionHistory (cyclomatic 66, cognitive 227) packages/bridge/src/sessions-index.ts:4224 — getCodexSessionHistory has cyclomatic complexity 66 and cognitive complexity 227; 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 codexThreadToSessionHistory (cyclomatic 58, cognitive 125) · ×1
  • Complex function codexThreadToSessionHistory (cyclomatic 58, cognitive 125) packages/bridge/src/sessions-index.ts:2845 — codexThreadToSessionHistory has cyclomatic complexity 58 and cognitive complexity 125; 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 buildSessionCreatedMessage (cyclomatic 54, cognitive 61) · ×1
  • Complex function buildSessionCreatedMessage (cyclomatic 54, cognitive 61) REDACTED:1713 — buildSessionCreatedMessage has cyclomatic complexity 54 and cognitive complexity 61; 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 getSessionHistory (cyclomatic 43, cognitive 82) · ×1
  • Complex function getSessionHistory (cyclomatic 43, cognitive 82) packages/bridge/src/sessions-index.ts:3618 — getSessionHistory has cyclomatic complexity 43 and cognitive complexity 82; 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 maybeSendPushNotification (cyclomatic 43, cognitive 79) · ×1
  • Complex function maybeSendPushNotification (cyclomatic 43, cognitive 79) REDACTED:10547 — maybeSendPushNotification has cyclomatic complexity 43 and cognitive complexity 79; 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 convertSdkMessage (cyclomatic 40, cognitive 72) · ×1
  • Complex function convertSdkMessage (cyclomatic 40, cognitive 72) packages/bridge/src/sdk-process.ts:644 — convertSdkMessage has cyclomatic complexity 40 and cognitive complexity 72; 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 setupSystemd (cyclomatic 39, cognitive 33) · ×1
  • Complex function setupSystemd (cyclomatic 39, cognitive 33) packages/bridge/src/setup-systemd.ts:96 — setupSystemd has cyclomatic complexity 39 and cognitive complexity 33; 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 setupLaunchd (cyclomatic 38, cognitive 32) · ×1
  • Complex function setupLaunchd (cyclomatic 38, cognitive 32) packages/bridge/src/setup-launchd.ts:47 — setupLaunchd has cyclomatic complexity 38 and cognitive complexity 32; 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 getAllRecentSessions (cyclomatic 36, cognitive 49) · ×1
  • Complex function getAllRecentSessions (cyclomatic 36, cognitive 49) packages/bridge/src/sessions-index.ts:1119 — getAllRecentSessions has cyclomatic complexity 36 and cognitive complexity 49; 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 hydrateClaudeIndexedEntry (cyclomatic 34, cognitive 29) · ×1
  • Complex function hydrateClaudeIndexedEntry (cyclomatic 34, cognitive 29) packages/bridge/src/sessions-index.ts:864 — hydrateClaudeIndexedEntry has cyclomatic complexity 34 and cognitive complexity 29; 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 hasValidSessionOptions (cyclomatic 31, cognitive 12) · ×1
  • Complex function hasValidSessionOptions (cyclomatic 31, cognitive 12) packages/bridge/src/parser.ts:1362 — hasValidSessionOptions has cyclomatic complexity 31 and cognitive complexity 12; 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 rewindInPlace (cyclomatic 30, cognitive 43) · ×1
  • Complex function rewindInPlace (cyclomatic 30, cognitive 43) packages/bridge/src/session.ts:1947 — rewindInPlace has cyclomatic complexity 30 and cognitive complexity 43; 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 normalizeCodexMcpResult (cyclomatic 27, cognitive 50) · ×1
  • Complex function normalizeCodexMcpResult (cyclomatic 27, cognitive 50) packages/bridge/src/sessions-index.ts:3288 — normalizeCodexMcpResult has cyclomatic complexity 27 and cognitive complexity 50; 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 27, cognitive 39) · ×1
  • Complex function (anonymous) (cyclomatic 27, cognitive 39) REDACTED:7168 — (anonymous) has cyclomatic complexity 27 and cognitive complexity 39; 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 listAllowedDirectories (cyclomatic 27, cognitive 31) · ×1
  • Complex function listAllowedDirectories (cyclomatic 27, cognitive 31) packages/bridge/src/directory-listing.ts:81 — listAllowedDirectories has cyclomatic complexity 27 and cognitive complexity 31; 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 · REDACTED · ×1
  • REDACTED: 11055 lines of code REDACTED:1 — REDACTED has 11055 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: 5459 lines of code REDACTED:1 — REDACTED has 5459 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 · packages/bridge/src/sessions-index.ts · ×1
  • packages/bridge/src/sessions-index.ts: 4137 lines of code packages/bridge/src/sessions-index.ts:1 — packages/bridge/src/sessions-index.ts has 4137 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 · packages/bridge/src/parser.ts · ×1
  • packages/bridge/src/parser.ts: 2409 lines of code packages/bridge/src/parser.ts:1 — packages/bridge/src/parser.ts has 2409 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 · packages/bridge/src/session.ts · ×1
  • packages/bridge/src/session.ts: 2246 lines of code packages/bridge/src/session.ts:1 — packages/bridge/src/session.ts has 2246 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 · packages/bridge/src/sdk-process.ts · ×1
  • packages/bridge/src/sdk-process.ts: 2036 lines of code packages/bridge/src/sdk-process.ts:1 — packages/bridge/src/sdk-process.ts has 2036 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: 985 lines of code REDACTED:1 — REDACTED has 985 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: 857 lines of code REDACTED:1 — REDACTED has 857 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 · packages/bridge/src/upload-store.ts · ×1
  • packages/bridge/src/upload-store.ts: 750 lines of code packages/bridge/src/upload-store.ts:1 — packages/bridge/src/upload-store.ts has 750 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: 414 lines of code REDACTED:1 — REDACTED has 414 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 · packages/bridge/src/prompt-history-store.ts · ×1
  • packages/bridge/src/prompt-history-store.ts: 413 lines of code packages/bridge/src/prompt-history-store.ts:1 — packages/bridge/src/prompt-history-store.ts has 413 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 (~233 LoC) · ×1
  • Dead file (~233 LoC) scripts/benchmark-desktop.mts — no import path from any entry point (22 application, 5 tooling, 69 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 (~114 LoC) · ×1
  • Dead file (~114 LoC) scripts/verify-finder-sandbox.mts — no import path from any entry point (22 application, 5 tooling, 69 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 (~105 LoC) · ×1
  • Dead file (~105 LoC) packages/bridge/test-client.mjs — no import path from any entry point (22 application, 5 tooling, 69 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
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap apps/mobile/lib/models/messages.dart:979 — `ServerMessage.fromJson` is public and takes `Map<String, dynamic> json` from its caller, and it calls itself at line 979 (`ServerMessage.fromJson`) with a piece of `json` — and nowhere in `ServerMessage.fromJson` 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. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `ServerMessage.fromJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 84 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate apps/mobile/lib/features/claude_session/claude_session_screen.dart:1485 — `!hideSessionBackButton && onBackToSessions != null` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:766 — `!isBackground && effectiveProjectPath != null` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:769 — `!isBackground && path != null && path.isNotEmpty` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/services/native_paste_bridge.dart:18 — `!kIsWeb && defaultTargetPlatform == TargetPlatform.macOS` appears character-identically in 2 files — apps/mobile/lib/services/native_paste_bridge.dart, apps/mobile/lib/widgets/google_search_text_selection.dart. 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 apps/mobile/lib/widgets/bubbles/plan_card.dart:160 — `!mounted || !_scrollController.hasClients` appears character-identically in 3 files — apps/mobile/lib/widgets/bubbles/plan_card.dart, apps/mobile/lib/widgets/file_mention_overlay.dart, apps/mobile/lib/widgets/slash_command_overlay.dart. 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 apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart:429 — `!mounted || !widget.scrollController.hasClients` appears character-identically in 2 files — apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart, apps/mobile/lib/features/file_peek/file_peek_sheet.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:362 — `!mounted || stoppedSessionId != _sessionId` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/settings/supporter_screen.dart:40 — `!state.isAvailable && state.errorMessage == null` appears character-identically in 2 files — apps/mobile/lib/features/settings/supporter_screen.dart, apps/mobile/lib/features/settings/widgets/support_section.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:1246 — `FeatureFlags.current.isEnabled( AppFeature.terminalAppIntegration, ) && terminalConfig.isConfigured && effectiveProjectPath != null` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/file_peek/playback/local_media_snapshot_io.dart:22 — `Platform.isMacOS || Platform.isWindows || Platform.isLinux` appears character-identically in 2 files — apps/mobile/lib/features/file_peek/playback/local_media_snapshot_io.dart, apps/mobile/lib/utils/platform_helper_io.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:1440 — `approval is ApprovalNone && queuedInput != null` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:1294 — `askToolUseId == null && askInput == null && pendingToolUseId == null` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/file_transfer/state/file_transfer_cubit.dart:14 — `base == null || uri == null || (base.scheme != 'http' && base.scheme != 'https')` appears character-identically in 2 files — apps/mobile/lib/features/file_transfer/state/file_transfer_cubit.dart, apps/mobile/lib/features/file_upload/file_upload_transport.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:1288 — `bridgeState == BridgeConnectionState.reconnecting || bridgeState == BridgeConnectionState.disconnected` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:256 — `buffered != null && buffered.sessionId != null` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:1712 — `c is ToolUseContent && c.name == 'ExitPlanMode'` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/widgets/bubbles/assistant_bubble.dart. 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 apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart:1560 — `clientMessageId != null && clientMessageId.isNotEmpty` appears character-identically in 2 files — apps/mobile/lib/features/chat_session/state/chat_session_cubit.dart, apps/mobile/lib/features/chat_session/widgets/chat_message_list.dart. 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 apps/mobile/lib/features/file_transfer/state/file_transfer_cubit.dart:212 — `completer != null && !completer.isCompleted` appears character-identically in 3 files — apps/mobile/lib/features/file_transfer/state/file_transfer_cubit.dart, apps/mobile/lib/features/file_upload/state/file_upload_cubit.dart, apps/mobile/lib/services/bridge_service.dart. 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 apps/mobile/lib/services/chat_message_handler.dart:477 — `content is! ThinkingContent || content.thinking.trim().isNotEmpty` appears character-identically in 2 files — apps/mobile/lib/services/chat_message_handler.dart, apps/mobile/lib/widgets/bubbles/assistant_bubble.dart. 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 apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1752 — `count < line.length && line.codeUnitAt(count) == 32` appears character-identically in 2 files — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart, apps/mobile/lib/utils/ordered_list_editing.dart. 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 apps/mobile/lib/features/file_browser/file_browser_view.dart:238 — `duoPolicy.useStrip && DuoStripScope.hasStrip(context)` appears character-identically in 3 files — apps/mobile/lib/features/file_browser/file_browser_view.dart, apps/mobile/lib/features/gallery/gallery_screen.dart, apps/mobile/lib/features/git/git_screen.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:1911 — `entry is UserChatEntry && entry.status == MessageStatus.failed` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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 apps/mobile/lib/features/file_transfer/widgets/file_transfer_dialog.dart:126 — `error is PlatformException && error.code == 'permission_denied'` appears character-identically in 2 files — apps/mobile/lib/features/file_transfer/widgets/file_transfer_dialog.dart, apps/mobile/lib/widgets/media_export_actions.dart. 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 apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart:1438 — `event is! KeyDownEvent && event is! KeyRepeatEvent` appears character-identically in 2 files — apps/mobile/lib/features/chat_session/widgets/chat_input_with_overlays.dart, apps/mobile/lib/widgets/chat_input_bar.dart. 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 apps/mobile/lib/features/claude_session/claude_session_screen.dart:854 — `gitProjectPath != null && gitProjectPath.isNotEmpty` appears character-identically in 2 files — apps/mobile/lib/features/claude_session/claude_session_screen.dart, apps/mobile/lib/features/codex_session/codex_session_screen.dart. 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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×15
  • Silent fallback default in catch apps/mobile/lib/features/session_list/services/codex_project_profile_store.dart:63 — `_loadAll` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch apps/mobile/lib/services/prompt_history_service.dart:1288 — `_decodeClientStats` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch apps/mobile/lib/services/prompt_history_service.dart:1302 — `_decodeSessionStats` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch apps/mobile/lib/widgets/session_card.dart:615 — `_formatElapsed` turns every thrown error into `''` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch apps/mobile/lib/widgets/session_card.dart:3224 — `_formatDate` turns every thrown error into `''` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch REDACTED:301 — `listWorktrees` 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:345 — `getMainBranch` 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 packages/bridge/src/sessions-index.ts:1014 — `extractLastPromptFromTail` 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 packages/bridge/src/sessions-index.ts:1077 — `scanJsonlDir` 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 packages/bridge/src/git-project-state.ts:8 — `currentGitBranch` 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 packages/bridge/src/worktree-store.ts:67 — `load` 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 packages/bridge/src/codex-thread-snapshot.ts:85 — `get` 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 packages/bridge/src/recording-store.ts:112 — `listRecordings` 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 packages/bridge/src/recording-store.ts:165 — `extractInfoFromJsonl` 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 packages/bridge/src/version.ts:27 — `getGitInfo` 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.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×14
  • Hand-rolled JSON/XML parsing via regex REDACTED:224 — 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 packages/bridge/src/sessions-index.ts:429 — 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 packages/bridge/src/sessions-index.ts:430 — 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 packages/bridge/src/sessions-index.ts:431 — 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 packages/bridge/src/sessions-index.ts:432 — 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 packages/bridge/src/sessions-index.ts:433 — 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 packages/bridge/src/sessions-index.ts:434 — 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 packages/bridge/src/sessions-index.ts:435 — 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 packages/bridge/src/sessions-index.ts:436 — 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 packages/bridge/src/sessions-index.ts:437 — 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 packages/bridge/src/sessions-index.ts:438 — 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 packages/bridge/src/sessions-index.ts:440 — 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 packages/bridge/src/sessions-index.ts:442 — 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 packages/bridge/src/sessions-index.ts:444 — 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.
D10 · Test Quality · Mock-dominated test · ×9
  • Mock-dominated test: calls stop, disable, deletes file, and daemon-reload packages/bridge/src/setup-systemd.test.ts:355 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: still prints public deep link when no local addresses are available packages/bridge/src/startup-info.test.ts:140 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: archives a Codex thread through a standalone process when none is active packages/bridge/src/websocket.test.ts:2055 — This test sets up 5 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: rejects standalone Codex archive outside allowed directories packages/bridge/src/websocket.test.ts:2100 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: fails closed when client protocol metadata is malformed packages/bridge/src/websocket.test.ts:2833 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: reports handler rejections to the client instead of leaking them packages/bridge/src/websocket.test.ts:2869 — This test sets up 5 test doubles (for example `vi.fn`) against 4 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: records original deltas immediately instead of recording batches packages/bridge/src/websocket.test.ts:9709 — This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not hold Codex completion pushes for background terminals packages/bridge/src/websocket.test.ts:9927 — This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not notify the relay without an active token registration packages/bridge/src/websocket.test.ts:9973 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
D24 · Comment Value · redundant comment · ×8
  • redundant comment functions/src/index.ts:395 — "Rate limit check" repeats the code it sits on: 3 of its 3 words (rate, limit, check) are already in `const rateLimitOp = parsed.op === "notify" ? "notify" as const : "token" as const;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/bridge/src/parser.test.ts:1611 — "git_create_branch" repeats the code it sits on: 3 of its 3 words (git, create, branch) are already in `it("parses git_create_branch", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/bridge/src/parser.test.ts:1636 — "git_checkout_branch" repeats the code it sits on: 3 of its 3 words (git, checkout, branch) are already in `it("parses git_checkout_branch", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/bridge/src/parser.test.ts:1660 — "git_revert_file" repeats the code it sits on: 3 of its 3 words (git, revert, file) are already in `it("parses git_revert_file", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/bridge/src/sessions-index.test.ts:242 — "Users/x/Workspace/vibetunnel/.claude/worktrees/feature" repeats the code it sits on: 6 of its 6 words (users, workspace, vibetunnel, claude, worktrees, feature) are already in `expect(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/bridge/src/setup-systemd.ts:146 — "Build environment lines" repeats the code it sits on: 3 of its 3 words (build, environment, lines) are already in `let envLines = `Environment=PATH=${buildServicePath(nodeBinDir)}`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:120 — "Demo mode: omit API key from deep link" repeats the code it sits on: 6 of its 7 words (demo, mode, api, key, deep, link) are already in `const deepLink = buildConnectionUrl(connectWsUrl, demoMode ? undefined : apiKey);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:6618 — "Look up worktree mapping for this Claude session" repeats the code it sits on: 4 of its 5 words (worktree, mapping, claude, session) are already in `const wtMapping = this.worktreeStore.get(claudeSessionId);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 2 of 11 project(s) overshoot their size bounds, lowering Project Cohesion to 6.4/10. The most over is `apps/mobile` (115408 LoC, 763 module-visible types across 75 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.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 3 ADR-shaped document(s) detected by content — `docs/design/codex-additional-writable-roots-mobile-ui.md`, `docs/design/codex-additional-writable-roots.md`, `docs/design/linux-desktop-support.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 3/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `apps/menubar`, `apps/mobile/ios`, `apps/mobile_preview`, `apps/mobile_preview/macos`, `packages/bridge`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:3 — No static application security testing detected. For this repository's stack, add the Dart analyzer's security lints plus `semgrep --config=auto` as a CI step. What was searched, so you can tell an absence from a miss: the 113077 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.
P3 · Security & performance tooling · Dependabot does not watch gradle · ×1
  • Dependabot does not watch gradle REDACTED:2 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `gradle`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
P4 · Deployment & Rollback · No rollback/health safety · ×1
  • No rollback/health safety — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
R7 · Dead Code · Unused export 'clearCodexParseCache' · ×1
  • Unused export 'clearCodexParseCache' packages/bridge/src/sessions-index.ts:1870 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'summarizeFileChanges' · ×1
  • Unused module-local declaration 'summarizeFileChanges' REDACTED:4804 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'permissionModeToApprovalPolicy' · ×1
  • Unused module-local declaration 'permissionModeToApprovalPolicy' REDACTED:468 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete firebase.json:1 — Set: Content-Security-Policy. Missing: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−1.5 on this card.)
Minor — 2 finding(s)
D10 · Test Quality · Skipped (documented) · ×1
  • Skipped (documented): (unnamed test) packages/bridge/src/websocket.test.ts:6535 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
D12 · Dependency Hygiene · Outdated · ×1
  • Outdated: Sparkle — `Sparkle` is locked at 2.9.1 in apps/mobile/macos/Podfile.lock, but 2.9.6 is the newest release the CocoaPods trunk lists within the same major. A `~>` requirement admits every release below the next major — so `pod update Sparkle` reaches this one with no change to the Podfile.

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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c5ed3ba056454b78acc7d8ae2a1a9010/history.json --exit-code 0 --source .2artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c5ed3ba056454b78acc7d8ae2a1a9010/tree.json --exit-code 0 --source .2artifacts/raw/gitleaks-tree.json
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/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .23artifacts/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-update17artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .6artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 5 file(s) — `apps/menubar/CCPocketMenubar/Services/DoctorRunner.swift`, `apps/menubar/CCPocketMenubar/ViewModels/AppViewModel.swift`, `apps/menubar/CCPocketMenubar/ViewModels/DoctorViewModel.swift`, `packages/bridge/src/sdk-process.ts`, `REDACTED` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
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 01a1add4-870b-7eab-8eb0-572578cebac3 · 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