Public report of wxtsky/CodeIsland, published 29 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). 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, 15 November 2026, 00:56 UTC · Survey ID cd_1bd6208bec844fc3b4e7172c9b69965c

wxtsky/CodeIsland

Measured 29 October 2026, 08:57 UTC, at code version 03c77e9

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

Boundary Type-Coupling is not measured: Bounded contexts not declared.

Knowledge freshness is not measured: Freshness signal contradicted by repo activity.

CAI score 55out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 2 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 medium codebase: 89,744 lines of product code in 10 projects, tests not counted · Estimated rebuild effort: about 1.2 person-years · Weakest lens: Code Health, 47

Findings by how serious they are

14 critical 699 serious 36 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 October 2026, 08:57 UTC

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

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

76of 76 dimensions measured by tools.
733of 749 findings point to an exact file and line, so you can open each one in the code. The other 16 concern the repository as a whole, such as missing documentation.
76dimensions across 6 lenses, read from 89,744 lines of product code in 10 projects.
Chapters

Executive summary

wxtsky/CodeIsland falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 55 out of 100 and is rated Adequate, and eight of its 14 critical findings are security problems in the build pipeline and in its code.

Code Health, at 47, is the weakest lens and counts most in the score. The best first step is removing the unread values, worth about 6 points. Splitting the oversized files would lift Code Health itself, worth about 5 points. Raising Code Health to 70 would lift the score to about 61.

Five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Two secrets can leak from the build pipeline, and five errors are caught and ignored, so failures can go unnoticed. Pinning each tool to an exact version, limiting each secret to its own step and handling or logging the ignored errors would close these risks. Fixing the weaknesses the scanner points to would fix the security weakness in the code. The data field that is written but never read needs removing.

The product code is 89,744 lines, about €180,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.
Code Health 47 · counts for 46%Production Readiness 53 · counts for 25%Maturity 65 · counts for 14%Performance 66 · counts for 8%Security and Compliance 79 · counts for 4%Architecture 98 · counts for 2%

If Code Health rose from 47 to 70, the lowest score rated Strong, the score would rise from 55 to about 61.

Code composition: what the lines of code are
Business logic 3%Supporting code 4%Tests 93%
New since the last survey: 170 findings

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

  • Cyclomatic Complexity · SessionSnapshot.swift.applyHookEvent (cyclomatic 163) Sources/CodeIslandCore/SessionSnapshot.swift
  • Cyclomatic Complexity · HookIntake.init (cyclomatic 83) Sources/CodeIslandCore/HookIntake.swift
  • Cyclomatic Complexity · HookIntake.addTerminalContext (cyclomatic 56) Sources/CodeIslandCore/HookIntake.swift
  • Cyclomatic Complexity · CodexPermissionRules.plainCommands (cyclomatic 52) Sources/CodeIsland/CodexPermissionRules.swift
  • Cyclomatic Complexity · TerminalActivator.activateTerminal (cyclomatic 43) Sources/CodeIsland/TerminalActivator.swift
  • Cyclomatic Complexity · KimiDiscovery.readRecentFromKimiTranscript (cyclomatic 37) Sources/CodeIsland/Discovery/KimiDiscovery.swift
  • Cyclomatic Complexity · CodexDiscovery.discoverCodexSessions (cyclomatic 35) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cyclomatic Complexity · ClaudeDiscovery.readRecentFromTranscript (cyclomatic 33) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift
  • Cyclomatic Complexity · CodexDiscovery.readRecentFromCodexTranscript (cyclomatic 30) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cyclomatic Complexity · AppState.backfillClaudeTerminalMetadata (cyclomatic 29) Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift
  • Cyclomatic Complexity · CodexDiscovery.codexSpawnEdgeRecords (cyclomatic 24) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cyclomatic Complexity · CopilotDiscovery.readRecentFromCopilotTranscript (cyclomatic 24) Sources/CodeIsland/Discovery/CopilotDiscovery.swift
  • Cyclomatic Complexity · AttentionPolicy.intents (cyclomatic 24) Sources/CodeIslandCore/AttentionPolicy.swift
  • Cyclomatic Complexity · CodexDiscovery.recentCodexDesktopThreadRecords (cyclomatic 23) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cyclomatic Complexity · KimiDiscovery.findActiveKimiSessions (cyclomatic 23) Sources/CodeIsland/Discovery/KimiDiscovery.swift
  • Cyclomatic Complexity · KimiDiscovery.discoverKimiCodeSessionFromIndex (cyclomatic 22) Sources/CodeIsland/Discovery/KimiDiscovery.swift
  • Cyclomatic Complexity · OpenCodeDiscovery.readRecentFromOpenCodeSession (cyclomatic 22) Sources/CodeIsland/Discovery/OpenCodeDiscovery.swift
  • Cyclomatic Complexity · CodexTmuxRouting.resolve (cyclomatic 20) Sources/CodeIsland/CodexTmuxRouting.swift
  • Cyclomatic Complexity · FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp (cyclomatic 19) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift
  • Cyclomatic Complexity · SubsessionRouter.placement (cyclomatic 19) Sources/CodeIslandCore/SubsessionRouter.swift
  • Cyclomatic Complexity · SessionListView.body (cyclomatic 18) Sources/CodeIsland/NotchPanelView.swift
  • Cyclomatic Complexity · AppState.separateMergedCodexSubagents (cyclomatic 17) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · CodexDiscovery.latestCodexTurnStatus (cyclomatic 17) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cyclomatic Complexity · FlatStoreDiscovery.readRecentFromCodeBuddyTranscript (cyclomatic 17) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift
  • Cyclomatic Complexity · CodexThreadSubsession.link (cyclomatic 17) Sources/CodeIslandCore/CodexThreadSubsession.swift
  • Cyclomatic Complexity · CodexDiscovery.inspectCodexSubagentMetadata (cyclomatic 16) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cyclomatic Complexity · CopilotDiscovery.copilotSessionMatchesCwd (cyclomatic 16) Sources/CodeIsland/Discovery/CopilotDiscovery.swift
  • Cognitive Complexity · SessionSnapshot.swift.applyHookEvent (cognitive 241) Sources/CodeIslandCore/SessionSnapshot.swift
  • Cognitive Complexity · HookIntake.init (cognitive 108) Sources/CodeIslandCore/HookIntake.swift
  • Cognitive Complexity · CodexPermissionRules.plainCommands (cognitive 85) Sources/CodeIsland/CodexPermissionRules.swift
  • Cognitive Complexity · HookIntake.addTerminalContext (cognitive 66) Sources/CodeIslandCore/HookIntake.swift
  • Cognitive Complexity · KimiDiscovery.readRecentFromKimiTranscript (cognitive 64) Sources/CodeIsland/Discovery/KimiDiscovery.swift
  • Cognitive Complexity · CodexDiscovery.discoverCodexSessions (cognitive 62) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cognitive Complexity · ClaudeDiscovery.readRecentFromTranscript (cognitive 51) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift
  • Cognitive Complexity · TerminalActivator.activateTerminal (cognitive 49) Sources/CodeIsland/TerminalActivator.swift
  • Cognitive Complexity · KimiDiscovery.findActiveKimiSessions (cognitive 43) Sources/CodeIsland/Discovery/KimiDiscovery.swift
  • Cognitive Complexity · CodexDiscovery.readRecentFromCodexTranscript (cognitive 37) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cognitive Complexity · CodexDiscovery.recentCodexDesktopThreadRecords (cognitive 33) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cognitive Complexity · CodexDiscovery.codexSpawnEdgeRecords (cognitive 33) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cognitive Complexity · CodexDiscovery.latestCodexTurnStatus (cognitive 31) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cognitive Complexity · OpenCodeDiscovery.readRecentFromOpenCodeSession (cognitive 31) Sources/CodeIsland/Discovery/OpenCodeDiscovery.swift
  • Cognitive Complexity · AppState.backfillClaudeTerminalMetadata (cognitive 28) Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift
  • Cognitive Complexity · CopilotDiscovery.readRecentFromCopilotTranscript (cognitive 28) Sources/CodeIsland/Discovery/CopilotDiscovery.swift
  • Cognitive Complexity · FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp (cognitive 28) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift
  • Cognitive Complexity · KimiDiscovery.discoverKimiCodeSessionFromIndex (cognitive 27) Sources/CodeIsland/Discovery/KimiDiscovery.swift
  • Cognitive Complexity · AttentionPolicy.intents (cognitive 23) Sources/CodeIslandCore/AttentionPolicy.swift
  • Cognitive Complexity · AppState.performCardShortcut (cognitive 21) Sources/CodeIsland/AppState+CardShortcuts.swift
  • Cognitive Complexity · CodexTmuxRouting.resolve (cognitive 21) Sources/CodeIsland/CodexTmuxRouting.swift
  • Cognitive Complexity · GrokDiscovery.grokDirectorySessionCandidates (cognitive 20) Sources/CodeIsland/Discovery/GrokDiscovery.swift
  • Cognitive Complexity · SubsessionRouter.placement (cognitive 20) Sources/CodeIslandCore/SubsessionRouter.swift
  • Cognitive Complexity · FlatStoreDiscovery.readRecentFromCodeBuddyTranscript (cognitive 19) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift
  • Cognitive Complexity · FlatStoreDiscovery.codeBuddyLatestTerminalTurnTimestamp (cognitive 19) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift
  • Cognitive Complexity · HookConnection.readAvailable (cognitive 18) Sources/CodeIsland/HookSocket.swift
  • Cognitive Complexity · CopilotDiscovery.copilotSessionMatchesCwd (cognitive 18) Sources/CodeIsland/Discovery/CopilotDiscovery.swift
  • Cognitive Complexity · GeminiDiscovery.findActiveGeminiSessions (cognitive 18) Sources/CodeIsland/Discovery/GeminiDiscovery.swift
  • Cognitive Complexity · AgentProcessFinder.findCodexProcesses (cognitive 17) Sources/CodeIsland/Discovery/AgentProcessFinder.swift
  • Cognitive Complexity · CodexThreadSubsession.link (cognitive 17) Sources/CodeIslandCore/CodexThreadSubsession.swift
  • Cognitive Complexity · PrivateFiles.write (cognitive 17) Sources/CodeIslandCore/PrivateFiles.swift
  • Cognitive Complexity · DiagnosticsRedaction.words (cognitive 16) Sources/CodeIsland/DiagnosticsRedaction.swift
  • Cognitive Complexity · IdleSessionRemovalPolicy.selection (cognitive 16) Sources/CodeIsland/IdleSessionRemoval.swift
  • Cognitive Complexity · ProcessTable.getProcessArgs (cognitive 16) Sources/CodeIsland/ProcessTable.swift
  • Cognitive Complexity · CodexDiscovery.inspectCodexSubagentMetadata (cognitive 16) Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • Cognitive Complexity · CursorDiscovery.findActiveCursorSessions (cognitive 16) Sources/CodeIsland/Discovery/CursorDiscovery.swift
  • Cognitive Complexity · GrokDiscovery.grokSessionProcessMatchScore (cognitive 16) Sources/CodeIsland/Discovery/GrokDiscovery.swift
  • Cognitive Complexity · HookIntake.stdout (cognitive 16) Sources/CodeIslandCore/HookIntake.swift
  • God Classes · FunctionTooLong: SessionSnapshot.swift.applyHookEvent Sources/CodeIslandCore/SessionSnapshot.swift
  • God Classes · ClassTooLong: CodexDiscovery Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • God Classes · MethodTooLong: HookIntake.init Sources/CodeIslandCore/HookIntake.swift
  • God Classes · FileTooLong: Discovery/CodexDiscovery.swift Sources/CodeIsland/Discovery/CodexDiscovery.swift
  • God Classes · ClassTooLong: PanelWindowController Sources/CodeIsland/PanelWindowController.swift
  • God Classes · ClassTooLong: AgentProcessFinder Sources/CodeIsland/Discovery/AgentProcessFinder.swift
  • God Classes · FileTooLong: CodeIsland/CodexPermissionRules.swift Sources/CodeIsland/CodexPermissionRules.swift
  • God Classes · MethodTooLong: AppState.applyCursorSubsessionModeToKnownSessions Sources/CodeIsland/AppState.swift
  • God Classes · FileTooLong: CodeIsland/PanelWindowController.swift Sources/CodeIsland/PanelWindowController.swift
  • God Classes · FileTooLong: CodeIsland/MarkdownReplyView.swift Sources/CodeIsland/MarkdownReplyView.swift
  • God Classes · MethodTooLong: AppState.handleAskUserQuestion Sources/CodeIsland/AppState.swift
  • Code Duplication · Near-duplicate member family (4 members, 17 shared lines) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Near-duplicate member family (4 members, 11 shared lines) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Edited copy of a member (16 corresponding lines) Sources/CodeIsland/ClineView.swift
  • Code Duplication · Members sharing a duplicated core (24 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (20 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (19 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (15 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) Sources/CodeIsland/CopilotView.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/CodeIslandCore/AppleCompanionPayload.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/ClineView.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/ConfigInstaller.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/Discovery/CopilotDiscovery.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodeIsland/BuddyView.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodeIsland/BuddyView.swift
  • Code Duplication · Duplicated block (17–25 lines × 3) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (21–25 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift
  • Code Duplication · Duplicated block (16 lines × 2) Sources/CodeIsland/KiroView.swift
  • Code Duplication · Duplicated block (15–16 lines × 2) Sources/CodeIslandCore/HookIntake.swift
  • Code Duplication · Duplicated block (13 lines × 2) Sources/CodeIsland/Discovery/GeminiDiscovery.swift
  • Code Duplication · Duplicated block (10–11 lines × 6) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift
  • Code Duplication · Duplicated block (11 lines × 2) Sources/CodeIsland/Discovery/CopilotDiscovery.swift

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

Fixed since the last survey: 122 findings

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

  • Cyclomatic Complexity · SessionSnapshot.swift.reduceEvent (cyclomatic 175) Sources/CodeIslandCore/SessionSnapshot.swift
  • Cyclomatic Complexity · codeisland-remote-hook._normalize_event (cyclomatic 42) Sources/CodeIsland/Resources/codeisland-remote-hook.py
  • Cyclomatic Complexity · AppState.readRecentFromKimiTranscript (cyclomatic 37) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · HookServer.routeSubsessionPayloadIfNeeded (cyclomatic 36) Sources/CodeIsland/HookServer.swift
  • Cyclomatic Complexity · AppState.discoverCodexSessions (cyclomatic 35) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.readRecentFromTranscript (cyclomatic 33) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.readRecentFromCodexTranscript (cyclomatic 30) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.codexSpawnEdgeRecords (cyclomatic 24) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.readRecentFromCopilotTranscript (cyclomatic 24) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.findActiveKimiSessions (cyclomatic 23) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.recentCodexDesktopThreadRecords (cyclomatic 23) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.discoverKimiCodeSessionFromIndex (cyclomatic 22) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.readRecentFromOpenCodeSession (cyclomatic 22) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · CodexPermissionRules.shellPrefix (cyclomatic 22) Sources/CodeIsland/CodexPermissionRules.swift
  • Cyclomatic Complexity · AppState.qoderLatestTerminalTurnTimestamp (cyclomatic 19) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.latestCodexTurnStatus (cyclomatic 17) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.readRecentFromCodeBuddyTranscript (cyclomatic 17) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · AppState.copilotSessionMatchesCwd (cyclomatic 16) Sources/CodeIsland/AppState.swift
  • Cyclomatic Complexity · FollowUpReminderController.perform (cyclomatic 16) Sources/CodeIsland/FollowUpReminderController.swift
  • Cognitive Complexity · SessionSnapshot.swift.reduceEvent (cognitive 259) Sources/CodeIslandCore/SessionSnapshot.swift
  • Cognitive Complexity · AppState.readRecentFromKimiTranscript (cognitive 64) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.discoverCodexSessions (cognitive 62) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.readRecentFromTranscript (cognitive 51) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · HookServer.routeSubsessionPayloadIfNeeded (cognitive 44) Sources/CodeIsland/HookServer.swift
  • Cognitive Complexity · AppState.findActiveKimiSessions (cognitive 43) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · codeisland-remote-hook._normalize_event (cognitive 41) Sources/CodeIsland/Resources/codeisland-remote-hook.py
  • Cognitive Complexity · AppState.readRecentFromCodexTranscript (cognitive 37) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · CodexPermissionRules.shellPrefix (cognitive 34) Sources/CodeIsland/CodexPermissionRules.swift
  • Cognitive Complexity · AppState.recentCodexDesktopThreadRecords (cognitive 33) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.codexSpawnEdgeRecords (cognitive 33) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.readRecentFromOpenCodeSession (cognitive 31) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.latestCodexTurnStatus (cognitive 31) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.readRecentFromCopilotTranscript (cognitive 28) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.qoderLatestTerminalTurnTimestamp (cognitive 28) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.discoverKimiCodeSessionFromIndex (cognitive 27) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.findCursorSubagentTranscriptPath (cognitive 20) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.grokDirectorySessionCandidates (cognitive 20) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.readRecentFromCodeBuddyTranscript (cognitive 19) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.codeBuddyLatestTerminalTurnTimestamp (cognitive 19) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · TypingIndicator.body (cognitive 19) Sources/CodeIsland/NotchPanelView.swift
  • Cognitive Complexity · AppState.findActiveGeminiSessions (cognitive 18) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.copilotSessionMatchesCwd (cognitive 18) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · PanelWindowController.isActiveSpaceFullscreen (cognitive 18) Sources/CodeIsland/PanelWindowController.swift
  • Cognitive Complexity · AppState.findCodexProcesses (cognitive 17) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · CodexPermissionRules.findSuggestedPrefixRule (cognitive 17) Sources/CodeIsland/CodexPermissionRules.swift
  • Cognitive Complexity · AppState.startRotationIfNeeded (cognitive 16) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.grokSessionProcessMatchScore (cognitive 16) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.findActiveCursorSessions (cognitive 16) Sources/CodeIsland/AppState.swift
  • Cognitive Complexity · AppState.getProcessArgs (cognitive 16) Sources/CodeIsland/AppState.swift
  • God Classes · FunctionTooLong: SessionSnapshot.swift.reduceEvent Sources/CodeIslandCore/SessionSnapshot.swift
  • God Classes · FunctionTooLong: main.swift.top-level code Sources/CodeIslandBridge/main.swift
  • God Classes · TooManyMethods: HookServer Sources/CodeIsland/HookServer.swift
  • God Classes · MethodTooLong: AppState.cleanupIdleSessions Sources/CodeIsland/AppState.swift
  • God Classes · FileTooLong: CodeIsland/HookServer.swift Sources/CodeIsland/HookServer.swift
  • Code Duplication · Edited copy of a member (16 corresponding lines) Sources/CodeIsland/ClineView.swift
  • Code Duplication · Members sharing a duplicated core (23 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (22 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (20 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (19 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (18 members, 50+ identical tokens) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Members sharing a duplicated core (15 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/CodeIsland/AppState.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/ClineView.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/ConfigInstaller.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodeIsland/AppState.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodeIsland/BuddyView.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodeIsland/BuddyView.swift
  • Code Duplication · Duplicated block (29–33 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift
  • Code Duplication · Duplicated block (14–17 lines × 22) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Duplicated block (12–17 lines × 3) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (16–17 lines × 2) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Duplicated block (10–16 lines × 2) Sources/CodeIsland/RemoteInstaller.swift
  • Code Duplication · Duplicated block (15–16 lines × 2) Sources/CodeIslandBridge/main.swift
  • Code Duplication · Duplicated block (13 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (12 lines × 2) Sources/CodeIsland/RemoteHost.swift
  • Code Duplication · Duplicated block (10–11 lines × 6) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (11 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (9–10 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift
  • Code Duplication · Duplicated block (4–9 lines × 18) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Duplicated block (9 lines × 3) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (6–9 lines × 2) Sources/CodeIsland/HostHarnessSupport.swift
  • Code Duplication · Duplicated block (9 lines × 2) Sources/CodeIslandBridge/main.swift
  • Code Duplication · Duplicated block (7–8 lines × 5) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (8 lines × 3) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (7–8 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (8 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (3–7 lines × 5) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (7 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (6 lines × 3) Sources/CodeIsland/AntiGravityView.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/CodeIsland/AppState.swift
  • Code Duplication · Duplicated block (6 lines × 2) Sources/CodeIsland/KiroView.swift
  • Code Duplication · Duplicated block (5 lines × 10) Sources/CodeIsland/AiWorkView.swift
  • Code Duplication · Duplicated block (5 lines × 8) Sources/CodeIsland/CopilotView.swift
  • Code Duplication · Duplicated block (5 lines × 3) Sources/CodeIsland/AppState.swift
Rebuild cost: about €180,000 · Estimate
Cost to rebuild€60,000 to €300,000, for 996 to 3,163 hours of work, about 1.2 person-years for 1 to 3 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.8 at a score of 55. 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.
SizeMedium: 89,744 lines of product code
Comment linesThe estimate prices 89,736 lines. Comment lines count towards the size of 89,744 lines but aren't priced as work.
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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.

Top priorities

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

1
Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt — start with HookManager.cs.
Raises the score by about 6 points · Low effort · Explicit Debt
2
Resolve the 5 EmptyCatchBlock finding(s) in Explicit Debt — start with PipeServer.cs, App.xaml.cs, AppLogger.cs.
Raises the score by about 6 points · Low effort · Explicit Debt
3
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 5 points · Medium effort · Large Files

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 €180,000 to build again, about 1.2 person-years of work. Its weakest lens is Code Health, at 47 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for low effort, because it clears the 1 Explicit Debt findings. 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 6.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 132,044 lines over the last 90 days, which is about 535,512 lines a year. At that pace, the extra work comes to an estimated 56.7 to 340.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, 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 CodeIsland CodeIsland CodeIslandCore CodeIslandCore CodeIsland->CodeIslandCore CodeIslandBuddyWatch CodeIslandBuddyWatch codeisland-bridge codeisland-bridge codeisland-bridge->CodeIslandCore

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.

26 modules, with 26 dependencies between them. 2 loops run through 5 of the modules, marked above the diagonal.

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 (global)2 CodeIsland.Core3 Sources.CodeIsland.Resources.codeisland-omp4 Sources.CodeIsland.Resources.codeisland-openclaw5 com.codeisland.buddywatch.BuddyMascotView6 com.codeisland.buddywatch.BuddyPeripheralService7 CodeIsland.Bluetooth8 CodeIsland.Hooks9 CodeIsland.Ipc10 CodeIsland.Protocol11 CodeIslandCore12 Sources.CodeIsland.Resources13 com.codeisland.buddywatch.BuddyMascotView.Scene14 com.codeisland.buddywatch.IncomingCommand15 repository16 CodeIsland17 CodeIsland.Windows18 com.codeisland.buddywatch19 CodeIslandBridge20 com.codeisland.buddywatch.AgentStatusCode21 com.codeisland.buddywatch.DisplayMode22 com.codeisland.buddywatch.HostUplinkDeliveryMode23 com.codeisland.buddywatch.MainActivity24 com.codeisland.buddywatch.Mascot25 com.codeisland.buddywatch.PeripheralState26 com.codeisland.buddywatch.ScreenOrientation
1 (global)
2 CodeIsland.Core
3 Sources.CodeIsland.Resources.codeisland-omp
4 Sources.CodeIsland.Resources.codeisland-openclaw
5 com.codeisland.buddywatch.BuddyMascotView
6 com.codeisland.buddywatch.BuddyPeripheralService
7 CodeIsland.Bluetooth2
8 CodeIsland.Hooks1
9 CodeIsland.Ipc1
10 CodeIsland.Protocol6
11 CodeIslandCore220
12 Sources.CodeIsland.Resources31
13 com.codeisland.buddywatch.BuddyMascotView.Scene3
14 com.codeisland.buddywatch.IncomingCommand5
15 repository141
16 CodeIsland22625
17 CodeIsland.Windows11151
18 com.codeisland.buddywatch23
19 CodeIslandBridge2
20 com.codeisland.buddywatch.AgentStatusCode6
21 com.codeisland.buddywatch.DisplayMode3
22 com.codeisland.buddywatch.HostUplinkDeliveryMode2
23 com.codeisland.buddywatch.MainActivity1
24 com.codeisland.buddywatch.Mascot17
25 com.codeisland.buddywatch.PeripheralState7
26 com.codeisland.buddywatch.ScreenOrientation3
Uses a module listed above itPart of a loopThe module itself
1 (global)2 CodeIsland.Core3 Sources.CodeIsland.Resources.codeisland-omp4 Sources.CodeIsland.Resources.codeisland-openclaw5 com.codeisland.buddywatch.BuddyMascotView6 com.codeisland.buddywatch.BuddyPeripheralService7 CodeIsland.Bluetooth8 CodeIsland.Hooks9 CodeIsland.Ipc10 CodeIsland.Protocol11 CodeIslandCore12 Sources.CodeIsland.Resources13 com.codeisland.buddywatch.BuddyMascotView.Scene14 com.codeisland.buddywatch.IncomingCommand15 repository16 CodeIsland17 CodeIsland.Windows18 com.codeisland.buddywatch19 CodeIslandBridge20 com.codeisland.buddywatch.AgentStatusCode21 com.codeisland.buddywatch.DisplayMode22 com.codeisland.buddywatch.HostUplinkDeliveryMode23 com.codeisland.buddywatch.MainActivity24 com.codeisland.buddywatch.Mascot25 com.codeisland.buddywatch.PeripheralState26 com.codeisland.buddywatch.ScreenOrientation(global)1CodeIsland.Core2Sources.CodeIsland.Resources.codeisland-omp3Sources.CodeIsland.Resources.codeisland-openclaw4com.codeisland.buddywatch.BuddyMascotView5com.codeisland.buddywatch.BuddyPeripheralService6CodeIsland.Bluetooth7CodeIsland.Hooks8CodeIsland.Ipc9CodeIsland.Protocol10CodeIslandCore11Sources.CodeIsland.Resources12com.codeisland.buddywatch.BuddyMascotView.Scene13com.codeisland.buddywatch.IncomingCommand14repository15CodeIsland16CodeIsland.Windows17com.codeisland.buddywatch18CodeIslandBridge19com.codeisland.buddywatch.AgentStatusCode20com.codeisland.buddywatch.DisplayMode21com.codeisland.buddywatch.HostUplinkDeliveryMode22com.codeisland.buddywatch.MainActivity23com.codeisland.buddywatch.Mascot24com.codeisland.buddywatch.PeripheralState25com.codeisland.buddywatch.ScreenOrientation2621162203135141226251115123263211773

At a glance — Code Health · 47% · Weak · gated by D2, R3 ·

At a glance — Architecture · 98% · Exemplary ·

At a glance — Maturity · 65% · Adequate · gated by M2 ·

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

At a glance — Security · 79% · Adequate · gated by D36 ·

At a glance — Performance · 66% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection8High / Critical
A03:2025 — Software Supply Chain Failures6Medium

Roadmap

Begin by resolving explicit debt, specifically addressing the WriteOnlyPrivateField in HookManager.cs and the EmptyCatchBlock issues in PipeServer.cs, App.xaml.cs, and AppLogger.cs. Next, split the three largest source files into smaller, focused modules to improve maintainability. Finally, integrate a SAST step into the CI pipeline to prevent security regressions and address sync-over-async patterns to eliminate deadlock risks.

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

Do thisHelpsEffortDimension
Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt — start with HookManager.cs.+6.0 ptsLowExplicit Debt
Resolve the 5 EmptyCatchBlock finding(s) in Explicit Debt — start with PipeServer.cs, App.xaml.cs, AppLogger.cs.+6.0 ptsLowExplicit Debt
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+5.4 ptsMediumLarge Files
Resolve the 1 No ADRs found finding(s) in ADR Quality.+2.0 ptsLowADR Quality
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+3.7 ptsMediumSecurity & performance tooling
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with SessionSnapshot.swift.applyHookEvent (cognitive 241).+1.7 ptsMediumCognitive Complexity
Sync-over-async (deadlock risk)+2.8 ptsMediumAsync correctness
Swallowed exception (empty catch)+2.3 ptsMediumException handling

File quality

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

FileScoreBandWorst signal
windows/CodeIsland.Windows/MainWindow.xaml.cs4.6MixedExplicit Debt: EmptyCatchBlock
Sources/CodeIsland/ConfigInstaller.swift4.8MixedCyclomatic Complexity: ConfigInstaller.installExternalHooks (cyclomatic 60)
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
Sources/CodeIsland/AppState.swift5.5MixedCyclomatic Complexity: AppState.handleEvent (cyclomatic 56)
Sources/CodeIslandBridge/main.swift6.3MixedCyclomatic Complexity: main.swift.top-level code (cyclomatic 28)
Sources/CodeIslandCore/SessionSnapshot.swift7.0MixedCyclomatic Complexity: SessionSnapshot.swift.applyHookEvent (cyclomatic 163)
Sources/CodeIslandCore/HookIntake.swift7.0MixedCyclomatic Complexity: HookIntake.init (cyclomatic 83)
windows/CodeIsland.Windows/SettingsWindow.xaml.cs7.0MixedCyclomatic Complexity: SettingsWindow.RefreshLanguageFixed (cyclomatic 52)
Sources/CodeIsland/CodexPermissionRules.swift7.0MixedCyclomatic Complexity: CodexPermissionRules.plainCommands (cyclomatic 52)
Sources/CodeIsland/NotchPanelView.swift7.0MixedCyclomatic Complexity: NotchPanelView.body (cyclomatic 52)
Sources/CodeIsland/TerminalActivator.swift7.0MixedCyclomatic Complexity: TerminalActivator.activateTerminal (cyclomatic 43)
Sources/CodeIslandCore/Models.swift7.0MixedCyclomatic Complexity: CLIProcessResolver.sourceMatchesExecutablePath (cyclomatic 42)
Sources/CodeIsland/Discovery/CodexDiscovery.swift7.0MixedCyclomatic Complexity: CodexDiscovery.discoverCodexSessions (cyclomatic 35)
Sources/CodeIsland/AppState+AiWorkWatch.swift7.0MixedCyclomatic Complexity: AppState.handleAiWorkStreamEvent (cyclomatic 31)
Sources/CodeIsland/Resources/codeisland-remote-hook.py7.0MixedCyclomatic Complexity: codeisland-remote-hook._scan_session_jsonl (cyclomatic 25)
Sources/CodeIsland/JSONMinimalEditor.swift7.0MixedCyclomatic Complexity: JSONMinimalEditor.readStringLiteral (cyclomatic 19)
android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt7.0MixedCyclomatic Complexity: BuddyMascotView.drawAlert (cyclomatic 19)
Sources/CodeIsland/SettingsView.swift7.0MixedCyclomatic Complexity: HooksPage.body (cyclomatic 18)
Sources/CodeIslandCore/AiWorkWatchClient.swift7.0MixedCyclomatic Complexity: AiWorkStatusMapper.toolName (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 — 14

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

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

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

Could not be resolved — 8

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

Methodology & how to trust this report

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

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

What we checked — 76 dimensions across the health lenses
D1D2D3D4D5D6D9D10D13D14D15D17D19D20D26D28D29D30D35D36D43D44AX10AX3AX4AX5AX6AX8AX9GD1IC1M1M2M3M4P1P2P3P4P6PF1PF2PF3R1R10R2R3R4R6R7R9X1X12X13X14X15X16X17X18X19X2X20X21X22X23X24X25X26X27X28X29X3X30X32X4X5

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, 733 of 749 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a186e1-0a83-7902-a2ce-a8684a324ee4.

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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the analyzer environment could not build/run this repository's test suite, whose production source is .ino, .kt, .py, .swift, .ts. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. We track the analyzer-image gap so it can be closed; in the meantime, produce a coverage report in a standard format (Cobertura — `dotnet test --collect:"XPlat Code Coverage"` with a `coverlet.collector` PackageReference (.NET: C#, VB.NET and F# alike), lcov — `swift test --enable-code-coverage` or `xcodebuild -enableCodeCoverage YES` then `xcrun llvm-cov export -format=lcov` (Swift/Xcode), `cargo llvm-cov --lcov`, `go test -coverprofile`, `rebar3 do eunit --cover, cover` or covertool (Erlang/BEAM), `flutter test --coverage` or `dart test --coverage=coverage` then `dart run coverage:format_coverage --lcov` (Dart/Flutter), `sbt clean coverage test coverageReport` via the sbt-scoverage plugin in `project/plugins.sbt` (Scala/sbt), jest/nyc, JaCoCo/Cobertura XML, coverage.py … most ecosystems' coverage tools can emit one) 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: your test projects already reference a coverage collector, but no CI step we found runs the tests with it, so there is no report to hand us — run them with `--collect:"XPlat Code Coverage"` and commit (or publish into the working tree) the coverage.cobertura.xml it writes, and the real number is read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 7 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 259 test source file(s) (.swift, .ts) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source spans .cs, .swift, and the swift executor ran against the .swift half and never executed — so reliability was not measured for the repository as a whole. The .NET suite did build and re-run, and came back with 0 flaky across 1 measured tier(s) (unit: measured (0 flaky)) — 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. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `dotnet list package` did not return usable output (restore or query failed); no outdated/vulnerable/deprecated data to assess. The tool said: `dotnet list package` exited 1 with no output.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/REDACTED, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Gradle 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 (79 contributor(s) across 752 commit(s) sampled, automation and bot accounts excluded). One of them holds 81% of the history; the other 78 hold 0.2% 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.
  • D17 Explicit Debt — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The C# workspace loaded this repository's projects but reported a load failure, and the dead-code reference search is unreliable over a graph that did not load cleanly, so it was skipped. The other debt markers on this row were read; dead symbols were not, and their absence from the score is not a finding that the code has none. First load diagnostic: Failure: Msbuild failed when processing the file 'windows/CodeIsland.Windows/CodeIsland.Windows.csproj' with message: Project file must include the .NET Framework assembly 'PresentationCore, PresentationFramework' in the reference list.
  • D17 Explicit Debt — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 6 deducted marker(s) and the 1.0/KLoC density on this row were taken over this repository's .NET projects ALONE: .swift (72,689 lines, 85% of production source) went unread, because every marker collector on this path is reached through a C# workspace. D17's marker collectors need a compiler we do not have for that language, so none of its nine marker kinds were read there. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • D22 Internal API Consistency — 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. The loaded project set declares no packable project and no `.Contracts` project, so there is no intentionally-exposed surface for API consistency to be judged over.
  • D23 Boundary Type-Coupling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Large codebase (86,647 production LoC in the .NET projects) with no declared bounded contexts — cross-boundary type coupling is unassessed Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D30 Dependency Vulnerabilities — measured, with a gap in what it reached — 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. The solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan. 2 of 3 declared ecosystem(s) (npm,osv) WERE scanned and every vulnerability they reported is included in this result; nuget was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that nuget is free of known-vulnerable dependencies.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Sources/CodeIsland/AppState+CodexAppServer.swift`, `Sources/CodeIsland/AppState+ToolUseCache.swift`, `Sources/CodeIsland/AppState.swift`, `Sources/CodeIsland/ClineView.swift`, `Sources/CodeIsland/CodexPermissionRules.swift`, … (+21 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D34 Knowledge Freshness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. File-level freshness contradicts repo activity: 423 commits in the last 90 days, yet 28 of 28 significant files carry no living knowledge. Those two readings cannot both be true, so the per-file recency signal is treated as unreliable here and freshness is not scored for this run.
  • D39 IL Efficiency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. IL NOT MEASURED: the analyzer's own build of this repository failed for an ENVIRONMENT reason (exit 1) — MSBuild's engine or the CLR gave up, or our image does not carry the SDK band/targeting pack this repository needs. This is OUR limitation, not a defect in the repo, and it is not a statement that this repository fails to build. D18 owns the question of whether this repository builds; it was not answered here.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (android-watch/app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: .base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1075) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConne…; runtime evidence skipped (launch chosen because android-watch/app/build.gradle.kts applies the Android application plugin and android-watch/gradlew builds it).
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • 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.
  • 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 Dockerfile (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.
  • 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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 Complexity4.8 / 10Weak✓ 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 4.8 / 10 · rule-coverage 100% · ceiling Prevented

129 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SessionSnapshot.swift.applyHookEvent at 163. A further 11 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 EventNormalizer.normalize at 49 — they are counted neither in the figure above nor in this dimension's score. 8 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Sources/CodeIslandCore/EventNormalizer.swift (EventNormalizer.normalize at 49), Sources/CodeIsland/Discovery/AgentProcessFinder.swift (AgentProcessFinder.findPids at 30), Sources/CodeIsland/MascotView.swift (MascotView.body at 26), windows/CodeIsland.Protocol/CodexTranscriptParser.cs (CodexTranscriptParser.ParseLine at 23), Sources/CodeIsland/DebugHarness.swift (DebugHarness.apply at 19), and 3 more not listed here. 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.

SessionSnapshot.swift.applyHookEvent (cyclomatic 163)Sources/CodeIslandCore/SessionSnapshot.swift:1229
HookIntake.init (cyclomatic 83)Sources/CodeIslandCore/HookIntake.swift:225
codeisland-omp.codeislandExtension (cyclomatic 79)Sources/CodeIsland/Resources/codeisland-omp.ts:494
SessionSnapshot.swift.extractMetadata (cyclomatic 77)Sources/CodeIslandCore/SessionSnapshot.swift:2047
ConfigInstaller.installExternalHooks (cyclomatic 60)Sources/CodeIsland/ConfigInstaller.swift:1753

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with SessionSnapshot.swift.applyHookEvent (cyclomatic 163). — Refactoring it lifts Cyclomatic Complexity from 4.8 to about 5.2/10.
  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.3 / 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.3 / 10 · rule-coverage 100% · ceiling Prevented

198 method(s) exceeded the cognitive complexity threshold of 15; the worst was SessionSnapshot.swift.applyHookEvent at 241.

SessionSnapshot.swift.applyHookEvent (cognitive 241)Sources/CodeIslandCore/SessionSnapshot.swift:1229
HookIntake.init (cognitive 108)Sources/CodeIslandCore/HookIntake.swift:225
AppState.integrateDiscovered (cognitive 107)Sources/CodeIsland/AppState.swift:3568
codeisland-omp.codeislandExtension (cognitive 95)Sources/CodeIsland/Resources/codeisland-omp.ts:494
ConfigInstaller.verifyAndRepair (cognitive 93)Sources/CodeIsland/ConfigInstaller.swift:1402

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with SessionSnapshot.swift.applyHookEvent (cognitive 241). — Refactoring it lifts Cognitive Complexity from 2.3 to about 3.7/10.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

63 god class(es) detected.

FileTooLong: CodeIsland/NotchPanelView.swift · ×20Sources/CodeIsland/NotchPanelView.swift
MethodTooLong: RemoteInstaller.configureRemoteHooksScript · ×14Sources/CodeIsland/RemoteInstaller.swift:446
ClassTooLong: AppState · ×14Sources/CodeIsland/AppState.swift:26
TooManyMethods: AppState · ×10Sources/CodeIsland/AppState.swift:26
FunctionTooLong: codeisland-omp.codeislandExtension · ×5Sources/CodeIsland/Resources/codeisland-omp.ts:494

What to do

  1. Resolve the 20 FileTooLong finding(s) in God Classes — start with NotchPanelView.swift, AppState.swift, ConfigInstaller.swift. — One of this dimension's main actionable groups (20 warning-level).
  2. Resolve the 14 MethodTooLong finding(s) in God Classes — start with SettingsView.swift (4), AppState.swift (4), ConfigInstaller.swift (2). — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 14 ClassTooLong finding(s) in God Classes — start with AppState.swift, ConfigInstaller.swift, RemoteInstaller.swift. — One of this dimension's main actionable groups (14 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 Duplication8.9 / 10Strong✓ 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 8.9 / 10 · rule-coverage 100% · ceiling Verified

192 duplicated block group(s) detected. A further 23 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (5 lines × 2) · ×28windows/CodeIsland.Windows/DockShoulderGeometry.cs:34
Duplicated block (7 lines × 2) · ×13Sources/CodeIsland/ConfigInstaller.swift:2925
Duplicated block (8 lines × 2) · ×11windows/CodeIsland.Windows/DesktopSessionStore.cs:89
Duplicated block (6 lines × 2) · ×10Sources/CodeIsland/AntiGravityView.swift:117
Duplicated block (9 lines × 2) · ×9Sources/CodeIsland/AppState.swift:2236

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

What to do

  1. Resolve the 28 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with ConfigInstaller.swift (2), KiroView.swift (2), NotchPanelView.swift (2). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 13 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with SessionSnapshot.swift (3), NotchPanelView.swift (2), ConfigInstaller.swift. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 11 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with TerminalActivator.swift (2), DesktopSessionStore.cs, AppState.swift. — One of this dimension's main actionable groups (11 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.4 / 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.4 / 10 · rule-coverage 100% · ceiling Prevented

5 production modules (Gradle+SwiftPM), 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; 1 module(s) off the main sequence, with abstractness counted on 4 of the 5 (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: CodeIslandCore

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.2 / 10Stronggated by 4 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.2 / 10 · rule-coverage 100% · ceiling Verified

4 of 63 classes have LCOM4 above 3.

Low cohesion: AppState (LCOM4 6) · ×4Sources/CodeIsland/AppState.swift:26

What to do

  1. Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with AppState.swift, MainWindow.xaml.cs, AppleCompanionPublisher.swift. — One of this dimension's main actionable groups (4 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.

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

2938 test methods: 2930 unit, 0 integration, 0 BDD, 8 e2e. The JavaScript/TypeScript suite contributes 90 `it`/`test` case(s) across 10 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 swift suite(s) contribute 2841 test method(s), read from the language model's own test census — every XCTest `test…` method on an XCTestCase, every swift-testing `@Test` and every JUnit/TestNG `@Test`-annotated method, which is those frameworks' own discovery rule. Their tier split is INFERRED from the test target's name and path only, not declared.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ 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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 7 tests. Measured on the C# suite only — at least 259 test source file(s) (.swift, .ts) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D13 · Secret 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

Secret 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 102 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 4 direct `PackageReference`(s), and 98 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package dependencies and nothing else. The repository also declares a Swift Package.swift/REDACTED and a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependency graphs 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 Hotspots7.8 / 10Strong✓ 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 7.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: Sources/CodeIslandCore/SessionSnapshot.swift (48×163=7824); Sources/CodeIsland/AppState.swift (118×56=6608); Sources/CodeIsland/NotchPanelView.swift (68×52=3536) Repeated repair below the complexity floor: Sources/CodeIsland/RemoteInstaller.swift (18 of 20 changes were fixes); Sources/CodeIsland/HookSocket.swift (11 of 11 changes were fixes); Sources/CodeIsland/PanelWindowController.swift (8 of 11 changes were fixes)

Hotspot: Sources/CodeIslandCore/SessionSnapshot.swift · ×28Sources/CodeIslandCore/SessionSnapshot.swift:1229
Repeated repair: Sources/CodeIsland/RemoteInstaller.swift · ×18Sources/CodeIsland/RemoteInstaller.swift:50

What to do

  1. Resolve the 28 Hotspot finding(s) in Churn × Complexity Hotspots — start with SessionSnapshot.swift, AppState.swift, NotchPanelView.swift. — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 18 Repeated repair finding(s) in Churn × Complexity Hotspots — start with RemoteInstaller.swift, HookSocket.swift, PanelWindowController.swift. — One of this dimension's main actionable groups (18 warning-level).

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

D17 · Explicit Debt8.0 / 10Adequategated by 6 critical findings✓ Tool-verified

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

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

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

6 deducted debt markers + unmeasured dead symbols across 4023 LoC in the .NET projects (1.0/KLoC) → score 8.0. Dead code not measured: the solution did not load cleanly, so the reference search was skipped. Measured on the .NET source only: .swift (85% of production source) was not read, and carries at least 0 uncounted task marker(s) in 0 file(s).

EmptyCatchBlock · ×5windows/CodeIsland.Ipc/PipeServer.cs:38
WriteOnlyPrivateFieldwindows/CodeIsland.Hooks/HookManager.cs:14

What to do

  1. Resolve the 5 EmptyCatchBlock finding(s) in Explicit Debt — start with PipeServer.cs, App.xaml.cs, AppLogger.cs. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt — start with HookManager.cs. — One of this dimension's main actionable groups (1 issue-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation 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

2 of 2 documentation facets pass in full. 11 document(s) read across 10 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

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

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

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

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

D26 · Project Cohesion10.0 / 10Exemplary✓ Tool-verified

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

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

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

0 of 10 projects flagged as possibly oversized/incoherent.

✓ On the Gold path — maintain.

Detailed fixes: d26_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

Method: Secret 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Documented

8 finding(s): 0 critical, 8 high, 0 medium, 0 low. 5 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 24 file(s) — `Sources/CodeIsland/AppState.swift` (lines 167–168, lines 336–337, lines 371–372, …), `Sources/CodeIsland/ConfigInstaller.swift`, `Sources/CodeIsland/DiagnosticsExporter.swift` (line 211), `Sources/CodeIsland/FollowUpReminderController.swift` (line 73, line 74), `Sources/CodeIsland/HookServer.swift`, … (+19 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. In 1 of those file(s) — `windows/CodeIsland.Hooks/NativeHookInstaller.cs` — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 2 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

What to do

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

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

D30 · Dependency Vulnerabilities9.8 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

1 finding(s): 0 critical, 0 high, 1 medium, 0 low. Partial dependency scan: 2 of 3 declared ecosystem(s) were scanned (npm,osv), and the findings above are real and complete for them. nuget was not scanned (nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan), so this is not the whole dependency surface and the result is reported at reduced confidence.

REDACTED

What to do

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

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

D35 · Change Coupling9.8 / 10Stronggated by 3 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.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: ConfigInstaller.swift↔EventNormalizer.swift 90%; main.swift↔EventNormalizer.swift 70%; ConfigInstaller.swift↔MascotView.swift 67%

Change coupling: ConfigInstaller.swift ↔ EventNormalizer.swift · ×3Sources/CodeIsland/ConfigInstaller.swift:1

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with ConfigInstaller.swift (2), main.swift. — One of this dimension's main actionable groups (3 warning-level).

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

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ 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 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 11 platform declaration(s) and 10 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.

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.

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, 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.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

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.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in 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: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.

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)8.0 / 10Strong✓ Tool-verified

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

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

What to do

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 README actually describes the code that exists (LLM-judged, advisory).

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

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.

P2 · Observability6.0 / 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 2/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 10237 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:7
  • `windows/CodeIsland.Core.Tests/CodeIsland.Core.Tests.csproj` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — windows/CodeIsland.Core.Tests/CodeIsland.Core.Tests.csproj:13

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ 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.

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

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
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.

PF1 · Benchmark discipline6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.

What to do

  • Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
PF2 · Allocation hygiene7.1 / 10Strong✓ 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 9 use(s) across 4,234 production line(s) (~2.1/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
PF3 · Async & latency hygiene7.0 / 10Strong✓ Tool-verified

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

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

  • 2 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×2) — windows/CodeIsland.Windows/App.xaml.cs:277, windows/CodeIsland.Windows/App.xaml.cs:280

What to do

  • Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified

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

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

R10 · Code Duplication7.5 / 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.

  • Sources/CodeIsland/Resources/codeisland-omp.ts:52 · Sources/CodeIsland/Resources/codeisland-pi.ts:77 — the two spans are one implementation copied and then locally edited — 894 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:52
  • Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:139 · Sources/CodeIsland/Resources/codeisland-pi.ts:207 — the two spans are one implementation copied and then locally edited — 526 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. — Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:139
  • Sources/CodeIsland/Resources/codeisland-omp.ts:188 · Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:139 · Sources/CodeIsland/Resources/codeisland-pi.ts:207 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — Sources/CodeIsland/Resources/codeisland-omp.ts:188
  • Sources/CodeIsland/Resources/codeisland-omp.ts:352 · Sources/CodeIsland/Resources/codeisland-pi.ts:334 — 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:352
  • Sources/CodeIsland/Resources/codeisland-omp.ts:280 · Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:210 · Sources/CodeIsland/Resources/codeisland-pi.ts:278 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — Sources/CodeIsland/Resources/codeisland-omp.ts:280
  • Sources/CodeIsland/Resources/codeisland-omp.ts:1066 · Sources/CodeIsland/Resources/codeisland-pi.ts:672 — 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:1066
  • Sources/CodeIsland/Resources/codeisland-omp.ts:558 · Sources/CodeIsland/Resources/codeisland-pi.ts:414 — 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:558
  • Sources/CodeIsland/Resources/codeisland-omp.ts:1044 · Sources/CodeIsland/Resources/codeisland-pi.ts:638 — 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:1044
  • Sources/CodeIsland/Resources/codeisland-omp.ts:1002 · Sources/CodeIsland/Resources/codeisland-pi.ts:583 — 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:1002
  • Sources/CodeIsland/Resources/codeisland-omp.ts:728 · Sources/CodeIsland/Resources/codeisland-omp.ts:735 — 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:728
  • Sources/CodeIsland/Resources/codeisland-pi.ts:730 · Sources/CodeIsland/Resources/codeisland-pi.ts:740 — 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. — Sources/CodeIsland/Resources/codeisland-pi.ts:730
  • Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:505 · Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:515 — 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. — Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:505

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.
R2 · Cyclomatic Complexity10.0 / 10Exemplary✓ 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.

  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 22; 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. — Sources/CodeIsland/Resources/codeisland-pi.ts:635
  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 14; 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. — Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:431
  • (anonymous) has cyclomatic complexity 15 and cognitive complexity 17; 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:656
  • classifyCodeIslandAskResponse has cyclomatic complexity 13 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:459
  • (anonymous) has cyclomatic complexity 11 and cognitive complexity 13; 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:1041
  • ompAgentIdentity has cyclomatic complexity 11 and cognitive complexity 10; 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. — Sources/CodeIsland/Resources/codeisland-omp.ts:155
R3 · Large Files0.0 / 10Critical✓ 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.

  • Sources/CodeIsland/Resources/codeisland-omp.ts has 1018 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/CodeIsland/Resources/codeisland-omp.ts:1
  • Sources/CodeIsland/Resources/codeisland-pi.ts has 673 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/CodeIsland/Resources/codeisland-pi.ts:1
  • Sources/CodeIsland/Resources/codeisland-openclaw/index.ts has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/CodeIsland/Resources/codeisland-openclaw/index.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 Coverage10.0 / 10Exemplary✓ 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.

R6 · Tooling6.7 / 10Adequate✓ 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.

  • test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add eslint as package.json scripts and run them in CI.
R7 · Dead Code10.0 / 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.

  • 12 file(s) (~4136 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
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.

X1 · Async correctness4.0 / 10Weak✓ Tool-verified

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.

  • Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×2) — windows/CodeIsland.Windows/App.xaml.cs:277, windows/CodeIsland.Windows/App.xaml.cs:280

What to do

  • Sync-over-async (deadlock risk)
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 document10.0 / 10Exemplary○ Nothing flagged

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.

X18 · Disposal-pattern correctness5.4 / 10Adequate✓ 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.

  • `PipeClient` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_reader` itself (line 12), which makes that instance its own. But `_reader` is named in none of the methods the disposal search covered: `DisposeAsync` (line 63) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_reader?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — windows/CodeIsland.Ipc/PipeClient.cs:12
  • `PipeClient` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_writer` itself (line 13), which makes that instance its own. But `_writer` is named in none of the methods the disposal search covered: `DisposeAsync` (line 63) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_writer?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — windows/CodeIsland.Ipc/PipeClient.cs:13

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 propagation9.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).

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

  • Only 5/6 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
  • Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one. — windows/CodeIsland.Bridge/Program.cs:102

What to do

  • Thread a CancellationToken through async methods so work stops promptly on cancellation.
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 `ArgumentNullException` 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.

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 `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items are never seen.

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

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

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

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

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

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

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

X3 · Exception handling4.7 / 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.

  • 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. (×5) — windows/CodeIsland.Ipc/PipeServer.cs:38, windows/CodeIsland.Windows/App.xaml.cs:52, windows/CodeIsland.Windows/AppLogger.cs:39, …
  • `catch (InvalidDataException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — windows/CodeIsland.Windows.Smoke/Program.cs:190

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.

X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.

Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.

X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. 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 `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

X5 · Nullable reference types9.2 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.

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

  • ~1.0 `!` suppressions per 1k syntax nodes — 34 suppression(s) across the 34205 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.

What to do

  • Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.

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 Health47%Weak — gated by D2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture98%ExemplaryStrongest area.
Maturity65%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness53%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security79%Adequate — gated by D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance66%AdequateAcceptable, with room to improve.
Unscored — 4 check(s) recorded observations but carry no score

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

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X10 Duplicated predicate — 13 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 9 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 50 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.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: .base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1075) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConne…; runtime evidence skipped (launch chosen because android-watch/app/build.gradle.kts applies the Android application plugin and android-watch/gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
  • C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D12 Dependency Hygiene — Dependency hygiene not measured
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a C#/VB .NET solution, but this repository's production source is mostly .ino, .kt, .py, .swift, .ts, which the C#/VB workspace does not load — the projects that loaded are an immaterial minority, so solution shape was not assessed for this repository. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Kotlin, Python, Swift, TypeScript not measured.
  • D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
  • D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only; comments in this repository's .kt, .py, .swift, .ts source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), 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.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 26 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D34 Knowledge Freshness — knowledge concentrated in recent work — freshness signal contradicted by repo activity
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
  • 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.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — analyzer environment
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (14 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
  • 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'.
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • P8 Schema migrations — no EF Core usage detected
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=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, or wire coverage collection into CI, to enable this cross-layer check
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • X6 Hand-rolled structured-format parsing — 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 — 14 finding(s)
D17 · Explicit Debt · EmptyCatchBlock · ×5
  • EmptyCatchBlock windows/CodeIsland.Ipc/PipeServer.cs:38 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock windows/CodeIsland.Windows/App.xaml.cs:52 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock windows/CodeIsland.Windows/AppLogger.cs:39 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock windows/CodeIsland.Windows/CodexSessionTailer.cs:107 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock windows/CodeIsland.Windows/MainWindow.xaml.cs:238 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D17 · Explicit Debt · WriteOnlyPrivateField · ×1
  • WriteOnlyPrivateField windows/CodeIsland.Hooks/HookManager.cs:14 — private HookFileStore _store — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 699 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×28
  • Hotspot: Sources/CodeIslandCore/SessionSnapshot.swift Sources/CodeIslandCore/SessionSnapshot.swift:1229 — Sources/CodeIslandCore/SessionSnapshot.swift changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 163 in SessionSnapshot.swift.applyHookEvent at line 1229. 28 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/SessionSnapshot.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.
  • Hotspot: Sources/CodeIsland/AppState.swift Sources/CodeIsland/AppState.swift:1664 — Sources/CodeIsland/AppState.swift changed 118 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in AppState.handleEvent at line 1664. 70 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppState.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.
  • Hotspot: Sources/CodeIsland/NotchPanelView.swift Sources/CodeIsland/NotchPanelView.swift:255 — Sources/CodeIsland/NotchPanelView.swift changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in NotchPanelView.body at line 255. 35 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/NotchPanelView.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.
  • Hotspot: Sources/CodeIsland/ConfigInstaller.swift Sources/CodeIsland/ConfigInstaller.swift:1753 — Sources/CodeIsland/ConfigInstaller.swift changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in ConfigInstaller.installExternalHooks at line 1753. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/ConfigInstaller.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.
  • Hotspot: Sources/CodeIslandCore/Models.swift Sources/CodeIslandCore/Models.swift:62 — Sources/CodeIslandCore/Models.swift changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in CLIProcessResolver.sourceMatchesExecutablePath at line 62. 15 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/Models.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.
  • Hotspot: Sources/CodeIsland/TerminalActivator.swift Sources/CodeIsland/TerminalActivator.swift:218 — Sources/CodeIsland/TerminalActivator.swift changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in TerminalActivator.activateTerminal at line 218. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/TerminalActivator.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.
  • Hotspot: Sources/CodeIsland/HookServer.swift Sources/CodeIsland/HookServer.swift:534 — Sources/CodeIsland/HookServer.swift changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in HookServer.processRequest at line 534. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/HookServer.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.
  • Hotspot: Sources/CodeIsland/SettingsView.swift Sources/CodeIsland/SettingsView.swift:827 — Sources/CodeIsland/SettingsView.swift changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in HooksPage.body at line 827. 12 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/SettingsView.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.
  • Hotspot: Sources/CodeIsland/AppState+CoworkWatch.swift Sources/CodeIsland/AppState+CoworkWatch.swift:239 — Sources/CodeIsland/AppState+CoworkWatch.swift changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in AppState.applyCoworkUpdate at line 239. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppState+CoworkWatch.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.
  • Hotspot: Sources/CodeIslandBridge/main.swift Sources/CodeIslandBridge/main.swift:28 — Sources/CodeIslandBridge/main.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in main.swift.top-level code at line 28. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandBridge/main.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.
  • Hotspot: Sources/CodeIslandCore/HookIntake.swift Sources/CodeIslandCore/HookIntake.swift:225 — Sources/CodeIslandCore/HookIntake.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in HookIntake.init at line 225. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/HookIntake.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.
  • Hotspot: Sources/CodeIsland/Resources/codeisland-omp.ts Sources/CodeIsland/Resources/codeisland-omp.ts:494 — Sources/CodeIsland/Resources/codeisland-omp.ts changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in codeisland-omp.codeislandExtension at line 494. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/Resources/codeisland-omp.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: Sources/CodeIsland/AppDelegate.swift Sources/CodeIsland/AppDelegate.swift:22 — Sources/CodeIsland/AppDelegate.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in AppDelegate.applicationDidFinishLaunching at line 22. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppDelegate.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.
  • Hotspot: Sources/CodeIsland/AppState+TranscriptTailer.swift Sources/CodeIsland/AppState+TranscriptTailer.swift:23 — Sources/CodeIsland/AppState+TranscriptTailer.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in AppState.attachTranscriptTailerIfNeeded at line 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppState+TranscriptTailer.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.
  • Hotspot: Sources/CodeIsland/Resources/codeisland-remote-hook.py Sources/CodeIsland/Resources/codeisland-remote-hook.py:669 — Sources/CodeIsland/Resources/codeisland-remote-hook.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in codeisland-remote-hook.main at line 669. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/Resources/codeisland-remote-hook.py`: 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: Sources/CodeIslandCore/JSONLTailer.swift Sources/CodeIslandCore/JSONLTailer.swift:537 — Sources/CodeIslandCore/JSONLTailer.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in JSONLTailer.apply at line 537. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/JSONLTailer.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.
  • Hotspot: Sources/CodeIsland/AppState+AiWorkWatch.swift Sources/CodeIsland/AppState+AiWorkWatch.swift:324 — Sources/CodeIsland/AppState+AiWorkWatch.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in AppState.handleAiWorkStreamEvent at line 324. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppState+AiWorkWatch.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.
  • Hotspot: Sources/CodeIsland/Resources/codeisland-pi.ts Sources/CodeIsland/Resources/codeisland-pi.ts:366 — Sources/CodeIsland/Resources/codeisland-pi.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in codeisland-pi.codeislandExtension at line 366. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/Resources/codeisland-pi.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: Sources/CodeIsland/TerminalVisibilityDetector.swift Sources/CodeIsland/TerminalVisibilityDetector.swift:147 — Sources/CodeIsland/TerminalVisibilityDetector.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in TerminalVisibilityDetector.liveIsSessionTabVisible at line 147. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/TerminalVisibilityDetector.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.
  • Hotspot: Sources/CodeIslandCore/EventNormalizer.swift Sources/CodeIslandCore/EventNormalizer.swift:5 — Sources/CodeIslandCore/EventNormalizer.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in EventNormalizer.normalize at line 5. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/EventNormalizer.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.
  • Hotspot: Sources/CodeIsland/AppState+CodexAppServer.swift Sources/CodeIsland/AppState+CodexAppServer.swift:273 — Sources/CodeIsland/AppState+CodexAppServer.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in AppState.applyCodexRequestUserInput at line 273. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppState+CodexAppServer.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.
  • Hotspot: Sources/CodeIslandCore/AgentTaskList.swift Sources/CodeIslandCore/AgentTaskList.swift:333 — Sources/CodeIslandCore/AgentTaskList.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in AgentTaskList.apply at line 333. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/AgentTaskList.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.
  • Hotspot: Sources/CodeIsland/MascotView.swift Sources/CodeIsland/MascotView.swift:25 — Sources/CodeIsland/MascotView.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in MascotView.body at line 25. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/MascotView.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.
  • Hotspot: Sources/CodeIslandCore/SubsessionRouter.swift Sources/CodeIslandCore/SubsessionRouter.swift:102 — Sources/CodeIslandCore/SubsessionRouter.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in SubsessionRouter.placement at line 102. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/SubsessionRouter.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.
  • Hotspot: Sources/CodeIsland/PushNotifier.swift Sources/CodeIsland/PushNotifier.swift:298 — Sources/CodeIsland/PushNotifier.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in PushNotifier.decide at line 298. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/PushNotifier.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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×28
  • Duplicated block (5 lines × 2) windows/CodeIsland.Windows/DockShoulderGeometry.cs:34 — windows/CodeIsland.Windows/DockShoulderGeometry.cs:34-38 | windows/CodeIsland.Windows/DockShoulderGeometry.cs:53-57 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `windows/CodeIsland.Windows/DockShoulderGeometry.cs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/AiWorkView.swift:229 — Sources/CodeIsland/AiWorkView.swift:229-234 | Sources/CodeIsland/MiMoView.swift:200-204 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/CodexPermissionRules.swift:387 — Sources/CodeIsland/CodexPermissionRules.swift:387-391 | Sources/CodeIsland/NotchPanelView.swift:1631-1635 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/CodexPermissionRules.swift:387` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/ConfigInstaller.swift:208 — Sources/CodeIsland/ConfigInstaller.swift:208-212 | Sources/CodeIsland/ConfigInstaller.swift:267-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/ConfigInstaller.swift:1780 — Sources/CodeIsland/ConfigInstaller.swift:1780-1784 | Sources/CodeIsland/ConfigInstaller.swift:1796-1800 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/DebugHarness.swift:108 — Sources/CodeIsland/DebugHarness.swift:108-112 | Sources/CodeIsland/DebugHarness.swift:170-174 — 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 (5 lines × 2) Sources/CodeIsland/GeminiView.swift:138 — Sources/CodeIsland/GeminiView.swift:138-142 | Sources/CodeIsland/QwenView.swift:149-153 — before extracting anything, compare `Sources/CodeIsland/GeminiView.swift` and `Sources/CodeIsland/QwenView.swift` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 185 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/GeminiView.swift:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/KiroView.swift:104 — Sources/CodeIsland/KiroView.swift:104-108 | Sources/CodeIsland/MinimaxView.swift:126-130 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/KiroView.swift:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/NotchPanelView.swift:939 — Sources/CodeIsland/NotchPanelView.swift:939-943 | ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:620-624 — 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 `Sources/CodeIsland/NotchPanelView.swift:939` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/NotchPanelView.swift:4808 — Sources/CodeIsland/NotchPanelView.swift:4808-4812 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1235-1239 — 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 `Sources/CodeIsland/NotchPanelView.swift:4808` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/SettingsView.swift:2800 — Sources/CodeIsland/SettingsView.swift:2800-2804 | Sources/CodeIsland/SettingsView.swift:2822-2826 — 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 (5 lines × 2) Sources/CodeIslandCore/HookIntake.swift:259 — Sources/CodeIslandCore/HookIntake.swift:259-265 | Sources/CodeIslandCore/HookIntake.swift:363-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/HookIntake.swift:363` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:2456 — Sources/CodeIslandCore/SessionSnapshot.swift:2456-2460 | Sources/CodeIslandCore/SessionSnapshot.swift:2480-2484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/SessionSnapshot.swift:2456` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIslandCore/SessionSnapshot.swift:2455` calls `Date` and `Sources/CodeIslandCore/SessionSnapshot.swift:2479` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:289 — ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:289-293 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchConnection.swift:181-185 — 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 `ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:272 — ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:272-276 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:295-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:272` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:278` calls `overlay`, `RoundedRectangle`, `stroke` and `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:301` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:395 — ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:395-399 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1292-1296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:395` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:122 — ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:122-126 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:338-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `8` in one and `2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/NotchAnimation.swift:24 — Sources/CodeIsland/NotchAnimation.swift:24-32 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1562-1566 — 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 (5 lines × 2) Sources/CodeIslandCore/HookIntake.swift:711 — Sources/CodeIslandCore/HookIntake.swift:711-715 | Sources/CodeIslandCore/SubsessionRouter.swift:359-363 — 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) Sources/CodeIsland/PushNotifier.swift:243 — Sources/CodeIsland/PushNotifier.swift:243-247 | Sources/CodeIsland/SoundManager.swift:165-169 — 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) Sources/CodeIsland/SessionTitleStore.swift:147 — Sources/CodeIsland/SessionTitleStore.swift:147-151 | Sources/CodeIslandCore/CoworkAuditLog.swift:180-184 — 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 (5 lines × 2) Sources/CodeIsland/BuddyView.swift:102 — Sources/CodeIsland/BuddyView.swift:102-106 | Sources/CodeIsland/BuddyView.swift:112-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:102` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) Sources/CodeIsland/KiroView.swift:87 — Sources/CodeIsland/KiroView.swift:87-91 | Sources/CodeIsland/MinimaxView.swift:111-115 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/KiroView.swift:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/CodeIslandCore/AppleCompanionPayload.swift:176 — Sources/CodeIslandCore/AppleCompanionPayload.swift:176-180 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:245-249 — before extracting anything, compare `Sources/CodeIslandCore/AppleCompanionPayload.swift` and `ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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) Sources/CodeIslandCore/SessionSnapshot.swift:976 — Sources/CodeIslandCore/SessionSnapshot.swift:976-980 | Sources/CodeIslandCore/SessionSnapshot.swift:1015-1019 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 3 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×20
  • FileTooLong: CodeIsland/NotchPanelView.swift Sources/CodeIsland/NotchPanelView.swift — FileTooLong — 3736 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3236 over it, 7.47× 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: CodeIsland/AppState.swift Sources/CodeIsland/AppState.swift — FileTooLong — 2833 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: AppState (28-4818). The bar is 500 significant lines; this is 2333 over it, 5.67× 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: CodeIsland/ConfigInstaller.swift Sources/CodeIsland/ConfigInstaller.swift — FileTooLong — 2647 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: ConfigInstaller (172-3959). The bar is 500 significant lines; this is 2147 over it, 5.29× 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: CodeIsland/SettingsView.swift Sources/CodeIsland/SettingsView.swift — FileTooLong — 2295 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1795 over it, 4.59× 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: CodeIsland/RemoteInstaller.swift Sources/CodeIsland/RemoteInstaller.swift — FileTooLong — 1520 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: RemoteInstaller (46-1837). The bar is 500 significant lines; this is 1020 over it, 3.04× 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: CodeIslandCore/SessionSnapshot.swift Sources/CodeIslandCore/SessionSnapshot.swift — FileTooLong — 1507 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1007 over it, 3.01× 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: buddywatch/BuddyMascotView.kt android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt — FileTooLong — 1199 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: BuddyMascotView (18-1535). The bar is 500 significant lines; this is 699 over it, 2.40× 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: CodeIslandCompanion/ContentView.swift ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift — FileTooLong — 1137 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 637 over it, 2.27× 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: CodeIsland/TerminalActivator.swift Sources/CodeIsland/TerminalActivator.swift — FileTooLong — 1022 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 522 over it, 2.04× 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: CodeIsland/ESP32BridgeManager.swift Sources/CodeIsland/ESP32BridgeManager.swift — FileTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 212 over it, 1.42× 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: Resources/codeisland-omp.ts Sources/CodeIsland/Resources/codeisland-omp.ts — FileTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: codeislandExtension (494-1134). The bar is 500 significant lines; this is 187 over it, 1.37× 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: Discovery/CodexDiscovery.swift Sources/CodeIsland/Discovery/CodexDiscovery.swift — FileTooLong — 672 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: CodexDiscovery (54-980). The bar is 500 significant lines; this is 172 over it, 1.34× 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: CodeIslandCore/JSONLTailer.swift Sources/CodeIslandCore/JSONLTailer.swift — FileTooLong — 654 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: JSONLTailer (108-1115). The bar is 500 significant lines; this is 154 over it, 1.31× 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: CodeIsland/AppState+AiWorkWatch.swift Sources/CodeIsland/AppState+AiWorkWatch.swift — FileTooLong — 602 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 102 over it, 1.20× 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: buddywatch/BuddyPeripheralService.kt android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyPeripheralService.kt — FileTooLong — 596 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: BuddyPeripheralService (65-827). The bar is 500 significant lines; this is 96 over it, 1.19× 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: CodeIslandCore/AiWorkWatchClient.swift Sources/CodeIslandCore/AiWorkWatchClient.swift — FileTooLong — 550 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 50 over it, 1.10× 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: CodeIslandCore/Models.swift Sources/CodeIslandCore/Models.swift — FileTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 39 over it, 1.08× 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: CodeIsland/CodexPermissionRules.swift Sources/CodeIsland/CodexPermissionRules.swift — FileTooLong — 525 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: CodexPermissionRules (4-891). The bar is 500 significant lines; this is 25 over it, 1.05× 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: CodeIsland/PanelWindowController.swift Sources/CodeIsland/PanelWindowController.swift — FileTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: PanelWindowController (172-859). The bar is 500 significant lines; this is 16 over it, 1.03× 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: CodeIsland/MarkdownReplyView.swift Sources/CodeIsland/MarkdownReplyView.swift — FileTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5 over it, 1.01× 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×18
  • Repeated repair: Sources/CodeIsland/RemoteInstaller.swift Sources/CodeIsland/RemoteInstaller.swift:50 — Sources/CodeIsland/RemoteInstaller.swift changed 20 times in last 90 days and 18 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 RemoteInstaller.installAll at line 50), 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(remote): the socket check waits for the forward, and a healthy host never fails it”; “fix(remote): the shared socket gets its mode on Linux hosts before glibc 2.32”; “fix(remote): nothing in a host's name, id or socket path runs on the host”; “fix(remote): ssh never reads a host's fields as options of its own”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/RemoteInstaller.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: Sources/CodeIsland/HookSocket.swift Sources/CodeIsland/HookSocket.swift:662 — Sources/CodeIsland/HookSocket.swift changed 11 times in last 90 days and 11 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 HookConnection.readAvailable at line 662), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hooks): a second island leaves the first its socket and quits”; “fix(remote): a remote host gets a bounded share of the island's sockets”; “fix(remote): each remote host's hooks arrive on a socket of its own, which names the host”; “fix(hooks): the listener checks its path before removing anything”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/HookSocket.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: Sources/CodeIsland/PanelWindowController.swift Sources/CodeIsland/PanelWindowController.swift:619 — Sources/CodeIsland/PanelWindowController.swift changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is PanelWindowController.setupHorizontalDragMonitor at line 619), 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(question): a half-typed answer survives the island moving to another display”; “fix(panel): the island changes display only through a rebuild for that display”; “fix(display): a pinned display is remembered by its identity, not its place”; “fix(shortcuts): a shortcut brings the island to the user before it acts”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/PanelWindowController.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: Sources/CodeIsland/FollowUpReminderController.swift Sources/CodeIsland/FollowUpReminderController.swift:398 — Sources/CodeIsland/FollowUpReminderController.swift changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is FollowUpReminderController.perform at line 398), 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(reminders): every session's failed-turn reminder rings”; “fix(aiwork): an aborted stream is no longer chased as finished”; “fix(sound): keep event sounds on while only the displays sleep”; “fix(reminders): follow up a failed turn with the error sound, not "done"”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/FollowUpReminderController.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: Sources/CodeIsland/RemoteManager.swift Sources/CodeIsland/RemoteManager.swift:166 — Sources/CodeIsland/RemoteManager.swift changed 8 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is RemoteManager.connectInternal at line 166), 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(remote): the socket check waits for the forward, and a healthy host never fails it”; “fix(remote): ssh never reads a host's fields as options of its own”; “fix(remote): a host without an id never connects, and its socket stamps nothing”; “fix(remote): the hosts' sockets on this Mac live in the user's own temporary folder”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/RemoteManager.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: Sources/CodeIslandCore/SubsessionLink.swift Sources/CodeIslandCore/SubsessionLink.swift:181 — Sources/CodeIslandCore/SubsessionLink.swift changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is SubsessionCards.samePidCard at line 181), 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(remote): a remote session's pid, transcript and terminal never act on this Mac”; “fix(subsessions): a process id is only matched on the hook's own host”; “fix(reducer): a `_ppid` past pid_t's range is ignored, never trapped on”; “fix(codex): a grandchild filed under its parent thread joins the card its parent is on”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/SubsessionLink.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: Sources/CodeIsland/AppState+ToolUseCache.swift Sources/CodeIsland/AppState+ToolUseCache.swift:175 — Sources/CodeIsland/AppState+ToolUseCache.swift changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is AppState.step at line 175), 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(approval): Codex "Always" holds for the session it was clicked in”; “fix(permission): a request answered in the Claude app goes when its call finishes (#389)”; “fix(approvals): a tool_use_id names a request only within its own card”; “fix(approvals): a session ending drops its requests without deciding them”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppState+ToolUseCache.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: Sources/CodeIsland/MarkdownReplyView.swift Sources/CodeIsland/MarkdownReplyView.swift:430 — Sources/CodeIsland/MarkdownReplyView.swift changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is MarkdownBlockView.body at line 430), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reply): links in any session's reply open only on the web”; “fix(remote): links in a remote session's reply open only on the web”; “fix(a11y): lift dim panel text to WCAG AA contrast”; “fix(question): scroll a long option list so the buttons stay reachable”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/MarkdownReplyView.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: Sources/CodeIslandCore/CursorSessionFolding.swift Sources/CodeIslandCore/CursorSessionFolding.swift:222 — Sources/CodeIslandCore/CursorSessionFolding.swift changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is CursorSubsessionRouter.choosePpidFallbackParentId at line 222), 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(remote): a remote session's pid, transcript and terminal never act on this Mac”; “fix(subsessions): a process id is only matched on the hook's own host”; “fix(reducer): a `_ppid` past pid_t's range is ignored, never trapped on”; “fix(cursor): show the Claude Code hooks Cursor runs as Cursor”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/CursorSessionFolding.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: Sources/CodeIsland/Models.swift Sources/CodeIsland/Models.swift:62 — Sources/CodeIsland/Models.swift changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is AskUserQuestionState.accepts at line 62), 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(question): a half-typed answer survives the island moving to another display”; “fix(approval): Codex "Always" holds for the session it was clicked in”; “fix(hooks): a hook that goes takes only its own request”; “fix(reminders): key a waiting item's reminders to its request”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/Models.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: Sources/CodeIslandCore/FollowUpReminderScheduler.swift Sources/CodeIslandCore/FollowUpReminderScheduler.swift:361 — Sources/CodeIslandCore/FollowUpReminderScheduler.swift changed 6 times in last 90 days and 5 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 FollowUpReminderScheduler.collectDue at line 361), 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(sound): keep event sounds on while only the displays sleep”; “fix(reminders): follow up a failed turn with the error sound, not "done"”; “fix(reminders): let a reminder kept off the Mac still reach the phone when away”; “fix(reminders): postpone a reminder the user is in front of instead of silencing it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/FollowUpReminderScheduler.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: Sources/CodeIsland/SSHForwarder.swift Sources/CodeIsland/SSHForwarder.swift:68 — Sources/CodeIsland/SSHForwarder.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 10 (its worst body is SSHForwarder.startTunnel at line 68), 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(remote): nothing in a host's name, id or socket path runs on the host”; “fix(remote): ssh never reads a host's fields as options of its own”; “fix(remote): the island's socket on a host sits in a folder only the SSH user can enter”; “fix(remote): the island's socket on a host is the SSH user's alone, unless its agents run as other users”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/SSHForwarder.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: Sources/CodeIslandCore/HookEdgeFacts.swift Sources/CodeIslandCore/HookEdgeFacts.swift:45 — Sources/CodeIslandCore/HookEdgeFacts.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 HookEdgeFacts.delivery at line 45), 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(remote): each remote host's hooks arrive on a socket of its own, which names the host”; “fix(edge): an `_edge` is never taken for this Mac”; “fix(remote): a blank remote cwd no longer fails the host's cwd allow-list”; “fix(remote): nobody-waits hooks are never held, and no blank cwd from OpenCode”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/HookEdgeFacts.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: Sources/CodeIsland/AppState+AgentTasks.swift Sources/CodeIsland/AppState+AgentTasks.swift:54 — Sources/CodeIsland/AppState+AgentTasks.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 11 (its worst body is AppState.finishAgentTaskBackfill at line 54), 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(session): find subagent models in nested and far-back transcripts, off the main thread”; “fix(tailer): treat a replaced transcript's history as history, not news”; “fix(tailer): start the live tail where the attach backfill stopped”; “fix(tasks): don't let an attach-time scan wipe a checklist it cannot rebuild”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AppState+AgentTasks.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: Sources/CodeIslandCore/ExtraConfigDirs.swift Sources/CodeIslandCore/ExtraConfigDirs.swift:365 — Sources/CodeIslandCore/ExtraConfigDirs.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 9 (its worst body is ExtraConfigDirs.inspect at line 365), 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(config-dirs): skip paused dirs in discovery and place unknown processes in one root”; “fix(config-dirs): refuse the home folder and folders that hold the primary”; “fix(config-dirs): never install or remove hooks through a file the primary owns”; “fix(config-dirs): compare config paths by realpath identity and memoize root lists”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIslandCore/ExtraConfigDirs.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: Sources/CodeIsland/RemoteHost.swift Sources/CodeIsland/RemoteHost.swift:76 — Sources/CodeIsland/RemoteHost.swift 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 8 (its worst body is RemoteHost.unsafeSSHField at line 76), 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(remote): ssh never reads a host's fields as options of its own”; “fix(remote): the island's socket on a host sits in a folder only the SSH user can enter”; “fix(remote): the island's socket on a host is the SSH user's alone, unless its agents run as other users”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/RemoteHost.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: Sources/CodeIsland/AgentTaskProgressView.swift Sources/CodeIsland/AgentTaskProgressView.swift:114 — Sources/CodeIsland/AgentTaskProgressView.swift 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 7 (its worst body is AgentTaskProgressView.compactRow at line 114), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(a11y): lift dim panel text to WCAG AA contrast”; “fix(island): fit the completion card's reply to the room the card leaves”; “fix(tasks): retire a plan the agent stopped updating, and show no "doing X" while idle”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/AgentTaskProgressView.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: Sources/CodeIsland/PushSettingsView.swift Sources/CodeIsland/PushSettingsView.swift:95 — Sources/CodeIsland/PushSettingsView.swift 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 6 (its worst body is PushFieldSpec.fields at line 95), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(push): mask device keys, topics and webhook URLs in settings”; “fix(push): refuse redirects to another host or from https to http”; “fix(push): redact more credential shapes and send team chats headlines only”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 21:01:29 +08:00' --until='2026-10-28 21:01:29 +08:00' --full-history --no-merges -- Sources/CodeIsland/PushSettingsView.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.
D3 · God Classes · MethodTooLong · ×14
  • MethodTooLong: RemoteInstaller.configureRemoteHooksScript Sources/CodeIsland/RemoteInstaller.swift:446 — MethodTooLong — configureRemoteHooksScript runs 1120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1020 over it, 11.20× 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: HooksPage.body Sources/CodeIsland/SettingsView.swift:827 — MethodTooLong — body runs 205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BuddyPage.body Sources/CodeIsland/SettingsView.swift:2088 — MethodTooLong — body 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: BehaviorPage.body Sources/CodeIsland/SettingsView.swift:485 — MethodTooLong — body 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.
  • MethodTooLong: HookIntake.init Sources/CodeIslandCore/HookIntake.swift:225 — MethodTooLong — init runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CompanionConnection.mockState ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:268 — MethodTooLong — mockState runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× 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: AppState.integrateDiscovered Sources/CodeIsland/AppState.swift:3568 — MethodTooLong — integrateDiscovered runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: AppearancePage.body Sources/CodeIsland/SettingsView.swift:1376 — MethodTooLong — body runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: AppState.handleEvent Sources/CodeIsland/AppState.swift:1664 — MethodTooLong — handleEvent runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.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: ConfigInstaller.defaultEvents Sources/CodeIsland/ConfigInstaller.swift:736 — MethodTooLong — defaultEvents runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.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: AppDelegate.applicationDidFinishLaunching Sources/CodeIsland/AppDelegate.swift:22 — MethodTooLong — applicationDidFinishLaunching runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ConfigInstaller.installExternalHooks Sources/CodeIsland/ConfigInstaller.swift:1753 — MethodTooLong — installExternalHooks runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: AppState.applyCursorSubsessionModeToKnownSessions Sources/CodeIsland/AppState.swift:4001 — MethodTooLong — applyCursorSubsessionModeToKnownSessions runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppState.handleAskUserQuestion Sources/CodeIsland/AppState.swift:2630 — MethodTooLong — handleAskUserQuestion 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.
D3 · God Classes · ClassTooLong · ×14
  • ClassTooLong: AppState Sources/CodeIsland/AppState.swift:26 — ClassTooLong — 2822 significant lines (blank, comment-only and punctuation-only lines excluded), 298 methods. The bar is 400 significant lines; this is 2422 over it, 7.06× 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: ConfigInstaller Sources/CodeIsland/ConfigInstaller.swift:172 — ClassTooLong — 2330 significant lines (blank, comment-only and punctuation-only lines excluded), 152 methods. The bar is 400 significant lines; this is 1930 over it, 5.83× 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: RemoteInstaller Sources/CodeIsland/RemoteInstaller.swift:46 — ClassTooLong — 1492 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 1092 over it, 3.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: BuddyMascotView android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:18 — ClassTooLong — 1184 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods. The bar is 400 significant lines; this is 784 over it, 2.96× 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: CodexDiscovery Sources/CodeIsland/Discovery/CodexDiscovery.swift:54 — ClassTooLong — 642 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 242 over it, 1.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: JSONLTailer Sources/CodeIslandCore/JSONLTailer.swift:108 — ClassTooLong — 599 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 199 over it, 1.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.
  • ClassTooLong: SessionSnapshot Sources/CodeIslandCore/SessionSnapshot.swift:9 — ClassTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 153 over it, 1.38× 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: BuddyPeripheralService android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyPeripheralService.kt:65 — ClassTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 143 over it, 1.36× 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: CodexPermissionRules Sources/CodeIsland/CodexPermissionRules.swift:4 — ClassTooLong — 523 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 123 over it, 1.31× 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: DebugHarness Sources/CodeIsland/DebugHarness.swift:50 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 29 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PanelWindowController Sources/CodeIsland/PanelWindowController.swift:171 — ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 28 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HookServer Sources/CodeIsland/HookServer.swift:7 — ClassTooLong — 427 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 27 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentProcessFinder Sources/CodeIsland/Discovery/AgentProcessFinder.swift:9 — ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 26 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MarkdownBlockParser Sources/CodeIslandCore/MarkdownBlockParser.swift:103 — ClassTooLong — 414 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 14 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×13
  • Duplicated block (7 lines × 2) Sources/CodeIsland/ConfigInstaller.swift:2925 — Sources/CodeIsland/ConfigInstaller.swift:2925-2931 | Sources/CodeIsland/ConfigInstaller.swift:3185-3191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:2925` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/DebugHarness.swift:336 — Sources/CodeIsland/DebugHarness.swift:336-342 | Sources/CodeIsland/DebugHarness.swift:395-401 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/DebugHarness.swift:343` calls `addRecentMessage`, `ChatMessage` and `Sources/CodeIsland/DebugHarness.swift:402` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:285 — Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:285-291 | Sources/CodeIsland/Discovery/CodexDiscovery.swift:913-919 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:285` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/KiroView.swift:95 — Sources/CodeIsland/KiroView.swift:95-101 | Sources/CodeIsland/StepFunView.swift:115-121 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/KiroView.swift:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/MascotView.swift:35 — Sources/CodeIsland/MascotView.swift:35-41 | ios/CodeIslandCompanion/Shared/SharedMascotView.swift:68-74 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/MascotView.swift:32` calls `GrokView` and `ios/CodeIslandCompanion/Shared/SharedMascotView.swift:67` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/NotchPanelView.swift:1189 — Sources/CodeIsland/NotchPanelView.swift:1189-1195 | Sources/CodeIsland/NotchPanelView.swift:1363-1369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/NotchPanelView.swift:1189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/NotchPanelView.swift:5261 — Sources/CodeIsland/NotchPanelView.swift:5261-5267 | Sources/CodeIsland/NotchPanelView.swift:5277-5283 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/NotchPanelView.swift:5284` calls `help`, `String` and `Sources/CodeIsland/NotchPanelView.swift:5268` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/TerminalActivator.swift:1191 — Sources/CodeIsland/TerminalActivator.swift:1191-1197 | Sources/CodeIsland/TerminalVisibilityDetector.swift:468-474 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) Sources/CodeIslandCore/AiWorkWatchClient.swift:667 — Sources/CodeIslandCore/AiWorkWatchClient.swift:667-673 | Sources/CodeIslandCore/EventNormalizer.swift:6-13 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AiWorkWatchClient.swift:667` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:1662 — Sources/CodeIslandCore/SessionSnapshot.swift:1662-1668 | Sources/CodeIslandCore/SessionSnapshot.swift:2176-2182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/SessionSnapshot.swift:1662` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:1691 — Sources/CodeIslandCore/SessionSnapshot.swift:1691-1697 | Sources/CodeIslandCore/SessionSnapshot.swift:2528-2534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/SessionSnapshot.swift:1691` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:2362 — Sources/CodeIslandCore/SessionSnapshot.swift:2362-2368 | Sources/CodeIslandCore/SessionSnapshot.swift:2397-2403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/SessionSnapshot.swift:2362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) Sources/CodeIsland/AppleCompanionPublisher.swift:213 — Sources/CodeIsland/AppleCompanionPublisher.swift:213-219 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:499-505 — 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 (8 lines × 2) · ×11
  • Duplicated block (8 lines × 2) windows/CodeIsland.Windows/DesktopSessionStore.cs:89 — windows/CodeIsland.Windows/DesktopSessionStore.cs:89-96 | windows/CodeIsland.Windows/DesktopSessionStore.cs:106-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `windows/CodeIsland.Windows/DesktopSessionStore.cs:89` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/CodeIsland/AppState.swift:3971 — Sources/CodeIsland/AppState.swift:3971-3978 | Sources/CodeIsland/AppState.swift:4761-4768 — 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) Sources/CodeIsland/ConfigInstaller.swift:1678 — Sources/CodeIsland/ConfigInstaller.swift:1678-1685 | Sources/CodeIsland/ConfigInstaller.swift:1822-1829 — 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) Sources/CodeIsland/Discovery/GeminiDiscovery.swift:103 — Sources/CodeIsland/Discovery/GeminiDiscovery.swift:103-110 | Sources/CodeIsland/Discovery/SessionDiscovery.swift:222-229 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/GeminiDiscovery.swift:103` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) Sources/CodeIsland/NotchPanelView.swift:1504 — Sources/CodeIsland/NotchPanelView.swift:1504-1511 | Sources/CodeIsland/NotchPanelView.swift:1521-1528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/NotchPanelView.swift:1504` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/CodeIsland/TerminalActivator.swift:690 — Sources/CodeIsland/TerminalActivator.swift:690-697 | Sources/CodeIsland/TerminalActivator.swift:794-801 — 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) Sources/CodeIsland/TerminalActivator.swift:1517 — Sources/CodeIsland/TerminalActivator.swift:1517-1524 | Sources/CodeIsland/TerminalVisibilityDetector.swift:555-562 — 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 (8 lines × 2) Sources/CodeIslandCore/AiWorkWatchClient.swift:336 — Sources/CodeIslandCore/AiWorkWatchClient.swift:336-343 | Sources/CodeIslandCore/CodexAppServerClient.swift:336-343 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AiWorkWatchClient.swift:336` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/CodeIslandCore/HostHarness.swift:317 — Sources/CodeIslandCore/HostHarness.swift:317-324 | Sources/CodeIslandCore/HostHarness.swift:362-369 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) Sources/CodeIslandCore/Models.swift:73 — Sources/CodeIslandCore/Models.swift:73-80 | Sources/CodeIslandCore/Models.swift:89-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/Models.swift:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:266 — ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:266-273 | ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:309-316 — 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.
D3 · God Classes · TooManyMethods · ×10
  • TooManyMethods: AppState Sources/CodeIsland/AppState.swift:26 — TooManyMethods — 298 methods, declared across 16 files: CodeIsland/AppState.swift (143), CodeIsland/AppState+AiWorkWatch.swift (29), CodeIsland/ESP32StatePublisher.swift (22), CodeIsland/AppState+CodexAppServer.swift (19), +12 more file(s). The bar is 30 methods; this is 268 over it, 9.93× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ConfigInstaller Sources/CodeIsland/ConfigInstaller.swift:172 — TooManyMethods — 152 methods. The bar is 30 methods; this is 122 over it, 5.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BuddyMascotView android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:18 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.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: ESP32BridgeManager Sources/CodeIsland/ESP32BridgeManager.swift:116 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: TerminalActivator Sources/CodeIsland/TerminalActivator.swift:8 — 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: CodexPermissionRules Sources/CodeIsland/CodexPermissionRules.swift:4 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.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.
  • TooManyMethods: SessionSnapshot Sources/CodeIslandCore/SessionSnapshot.swift:9 — TooManyMethods — 35 methods, declared across 4 files: CodeIslandCore/SessionSnapshot.swift (27), CodeIslandCore/SessionRecap.swift (6), CodeIslandCore/HermesSessionStore.swift (1), CodeIslandCore/SessionHeadline.swift (1). The bar is 30 methods; this is 5 over it, 1.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: JSONLTailer Sources/CodeIslandCore/JSONLTailer.swift:108 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MainWindow windows/CodeIsland.Windows/MainWindow.xaml.cs — TooManyMethods — 220 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MainActivity android-watch/app/src/main/java/com/codeisland/buddywatch/MainActivity.kt:28 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×10
  • Duplicated block (6 lines × 2) Sources/CodeIsland/AntiGravityView.swift:117 — Sources/CodeIsland/AntiGravityView.swift:117-122 | Sources/CodeIsland/WorkBuddyView.swift:109-114 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/WorkBuddyView.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 116 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/ClineView.swift:67 — Sources/CodeIsland/ClineView.swift:67-72 | Sources/CodeIsland/KimiView.swift:67-72 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/KimiView.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 175 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ClineView.swift:67` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/DeepSeekView.swift:98 — Sources/CodeIsland/DeepSeekView.swift:98-103 | Sources/CodeIsland/DeepSeekView.swift:130-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/DeepSeekView.swift:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/DexView.swift:192 — Sources/CodeIsland/DexView.swift:192-197 | Sources/CodeIsland/PixelCharacterView.swift:178-185 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/DexView.swift:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/DexView.swift:207 — Sources/CodeIsland/DexView.swift:207-212 | Sources/CodeIsland/PixelCharacterView.swift:213-218 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/DexView.swift:207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/Discovery/CodexDiscovery.swift:887 — Sources/CodeIsland/Discovery/CodexDiscovery.swift:887-892 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:228-233 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/CodexDiscovery.swift:887` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/GeminiView.swift:143 — Sources/CodeIsland/GeminiView.swift:143-148 | Sources/CodeIsland/QwenView.swift:154-159 — before extracting anything, compare `Sources/CodeIsland/GeminiView.swift` and `Sources/CodeIsland/QwenView.swift` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 185 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/GeminiView.swift:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/NotchPanelView.swift:1437 — Sources/CodeIsland/NotchPanelView.swift:1437-1442 | Sources/CodeIsland/NotchPanelView.swift:1448-1453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/NotchPanelView.swift:1437` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/CodeIsland/ScreenDetector.swift:230 — Sources/CodeIsland/ScreenDetector.swift:230-235 | Sources/CodeIsland/ScreenDetector.swift:246-251 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:378 — android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:378-383 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:529-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:378` 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 (9 lines × 2) · ×9
  • Duplicated block (9 lines × 2) Sources/CodeIsland/AppState.swift:2236 — Sources/CodeIsland/AppState.swift:2236-2244 | Sources/CodeIsland/AppState.swift:2520-2528 — 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) Sources/CodeIsland/DebugHarness.swift:451 — Sources/CodeIsland/DebugHarness.swift:451-459 | Sources/CodeIsland/DebugHarness.swift:477-485 — 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) Sources/CodeIsland/MascotView.swift:56 — Sources/CodeIsland/MascotView.swift:56-64 | ios/CodeIslandCompanion/Shared/SharedMascotView.swift:85-93 — 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 `Sources/CodeIsland/MascotView.swift:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/MascotView.swift:55` calls `MiMoView` and `ios/CodeIslandCompanion/Shared/SharedMascotView.swift:84` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) Sources/CodeIsland/NotchAnimation.swift:115 — Sources/CodeIsland/NotchAnimation.swift:115-123 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1346-1354 — 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 `Sources/CodeIsland/NotchAnimation.swift:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Sources/CodeIslandCore/HookIntake.swift:558 — Sources/CodeIslandCore/HookIntake.swift:558-566 | Sources/CodeIslandCore/HookIntake.swift:585-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/HookIntake.swift:558` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:414 — ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:414-422 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:230-238 — 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 `ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:414` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:228` calls `minimumScaleFactor` and `ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:413` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:559 — ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:559-567 | ios/CodeIslandCompanion/CodeIslandWatchWidget/CodeIslandWatchStatusWidget.swift:131-139 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) Sources/CodeIslandCore/AppleCompanionPayload.swift:10 — Sources/CodeIslandCore/AppleCompanionPayload.swift:10-18 | Sources/CodeIslandCore/ESP32Protocol.swift:278-286 — 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 (9 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:19 — ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:19-27 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:29-37 — 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 (5 lines × 3) · ×6
  • Duplicated block (5 lines × 3) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:44 — windows/CodeIsland.Windows/SettingsWindow.xaml.cs:44-56 | windows/CodeIsland.Windows/SettingsWindow.xaml.cs:65-69 | windows/CodeIsland.Windows/SettingsWindow.xaml.cs:75-82 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `windows/CodeIsland.Windows/SettingsWindow.xaml.cs:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
  • Duplicated block (5 lines × 3) Sources/CodeIsland/AntiGravityView.swift:117 — Sources/CodeIsland/AntiGravityView.swift:117-121 | Sources/CodeIsland/MinimaxView.swift:119-123 | Sources/CodeIsland/WorkBuddyView.swift:109-113 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/WorkBuddyView.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 116 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) Sources/CodeIsland/HostHarnessSupport.swift:69 — Sources/CodeIsland/HostHarnessSupport.swift:69-73 | Sources/CodeIsland/ProcessTable.swift:27-31 | Sources/CodeIslandBridge/main.swift:81-85 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 3) Sources/CodeIsland/ProcessTable.swift:98 — Sources/CodeIsland/ProcessTable.swift:98-102 | Sources/CodeIsland/TerminalActivator.swift:448-452 | Sources/CodeIslandBridge/main.swift:88-92 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 3) Sources/CodeIsland/ScreenDetector.swift:230 — Sources/CodeIsland/ScreenDetector.swift:230-234 | Sources/CodeIsland/ScreenDetector.swift:246-250 | Sources/CodeIsland/TerminalVisibilityDetector.swift:287-292 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/TerminalVisibilityDetector.swift:287` 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.
  • Duplicated block (5 lines × 3) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:303 — android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:303-307 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:382-386 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:533-537 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:303` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
D3 · God Classes · FunctionTooLong · ×5
  • FunctionTooLong: codeisland-omp.codeislandExtension Sources/CodeIsland/Resources/codeisland-omp.ts:494 — FunctionTooLong — codeislandExtension runs 412 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 312 over it, 4.12× 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: SessionSnapshot.swift.applyHookEvent Sources/CodeIslandCore/SessionSnapshot.swift:1229 — FunctionTooLong — applyHookEvent runs 355 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 255 over it, 3.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codeisland-pi.codeislandExtension Sources/CodeIsland/Resources/codeisland-pi.ts:366 — FunctionTooLong — codeislandExtension runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× 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: SessionSnapshot.swift.handleSubagentEvent Sources/CodeIslandCore/SessionSnapshot.swift:2343 — FunctionTooLong — handleSubagentEvent runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.register Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:309 — FunctionTooLong — register runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×5
  • Duplicated block (13 lines × 2) Sources/CodeIsland/AppState.swift:4581 — Sources/CodeIsland/AppState.swift:4581-4593 | Sources/CodeIsland/AppState.swift:4675-4687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AppState.swift:4581` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) Sources/CodeIsland/Discovery/GeminiDiscovery.swift:113 — Sources/CodeIsland/Discovery/GeminiDiscovery.swift:113-125 | Sources/CodeIsland/Discovery/SessionDiscovery.swift:232-244 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/GeminiDiscovery.swift:113` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) Sources/CodeIsland/NotchPanelView.swift:2830 — Sources/CodeIsland/NotchPanelView.swift:2830-2842 | Sources/CodeIsland/NotchPanelView.swift:2890-2902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/NotchPanelView.swift:2830` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) Sources/CodeIsland/TerminalActivator.swift:926 — Sources/CodeIsland/TerminalActivator.swift:926-938 | Sources/CodeIsland/TerminalActivator.swift:943-955 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) Sources/CodeIslandCore/AiWorkWatchClient.swift:345 — Sources/CodeIslandCore/AiWorkWatchClient.swift:345-357 | Sources/CodeIslandCore/CodexAppServerClient.swift:345-357 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AiWorkWatchClient.swift:345` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) Sources/CodeIsland/AppState.swift:2711 — Sources/CodeIsland/AppState.swift:2711-2721 | Sources/CodeIsland/AppState.swift:2929-2939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AppState.swift:2711` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:20 — Sources/CodeIsland/Discovery/CopilotDiscovery.swift:20-30 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:35-45 — before extracting anything, compare `Sources/CodeIsland/Discovery/CopilotDiscovery.swift` and `Sources/CodeIsland/Discovery/CursorDiscovery.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/CopilotDiscovery.swift:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) Sources/CodeIsland/SettingsView.swift:2441 — Sources/CodeIsland/SettingsView.swift:2441-2451 | Sources/CodeIsland/SettingsView.swift:2590-2600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/SettingsView.swift:2441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/SettingsView.swift:2453` calls `help` and `Sources/CodeIsland/SettingsView.swift:2601` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:1671 — Sources/CodeIslandCore/SessionSnapshot.swift:1671-1681 | Sources/CodeIslandCore/SessionSnapshot.swift:2185-2195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/SessionSnapshot.swift:1671` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:2442 — Sources/CodeIslandCore/SessionSnapshot.swift:2442-2452 | Sources/CodeIslandCore/SessionSnapshot.swift:2467-2477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/SessionSnapshot.swift:2442` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIslandCore/SessionSnapshot.swift:2455` calls `Date` and `Sources/CodeIslandCore/SessionSnapshot.swift:2480` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×5
  • Duplicated block (10 lines × 2) Sources/CodeIsland/GrokView.swift:46 — Sources/CodeIsland/GrokView.swift:46-55 | Sources/CodeIsland/GrokView.swift:100-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/GrokView.swift:46` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) Sources/CodeIsland/NotchPanelView.swift:1423 — Sources/CodeIsland/NotchPanelView.swift:1423-1432 | Sources/CodeIsland/NotchPanelView.swift:1456-1465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/NotchPanelView.swift:1423` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:257 — ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:257-266 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchConnection.swift:155-164 — 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) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:127 — ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:127-136 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:343-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:127` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) Sources/CodeIsland/AppState.swift:4520 — Sources/CodeIsland/AppState.swift:4520-4529 | Sources/CodeIsland/AppState.swift:4625-4634 — 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 (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) Sources/CodeIsland/ClineView.swift:150 — Sources/CodeIsland/ClineView.swift:150-158 | Sources/CodeIsland/KimiView.swift:131-139 | Sources/CodeIsland/TraeView.swift:141-149 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/KimiView.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 175 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ClineView.swift:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) Sources/CodeIsland/DebugHarness.swift:116 — Sources/CodeIsland/DebugHarness.swift:116-124 | Sources/CodeIsland/DebugHarness.swift:283-291 | Sources/CodeIsland/DebugHarness.swift:475-483 — 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.
  • Duplicated block (9 lines × 3) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:280 — Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:280-288 | Sources/CodeIsland/Discovery/CopilotDiscovery.swift:118-126 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:137-145 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:84 — ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:84-92 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:226-234 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:317-325 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) ios/CodeIslandCompanion/Shared/CodeIslandActivityAttributes.swift:17 — ios/CodeIslandCompanion/Shared/CodeIslandActivityAttributes.swift:17-25 | ios/CodeIslandCompanion/Shared/CodeIslandActivityAttributes.swift:47-55 | ios/CodeIslandCompanion/Shared/CodeIslandActivityAttributes.swift:61-69 — 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 (7 lines × 3) · ×5
  • Duplicated block (7 lines × 3) Sources/CodeIsland/ConfigInstaller.swift:806 — Sources/CodeIsland/ConfigInstaller.swift:806-812 | Sources/CodeIsland/ConfigInstaller.swift:891-897 | Sources/CodeIsland/ConfigInstaller.swift:913-919 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:806` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:25 — Sources/CodeIsland/Discovery/CopilotDiscovery.swift:25-31 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:40-46 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:67-73 — before extracting anything, compare `Sources/CodeIsland/Discovery/CopilotDiscovery.swift` and `Sources/CodeIsland/Discovery/CursorDiscovery.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/CopilotDiscovery.swift:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) Sources/CodeIslandCore/AiWorkWatchClient.swift:669 — Sources/CodeIslandCore/AiWorkWatchClient.swift:669-675 | Sources/CodeIslandCore/EventNormalizer.swift:68-74 | Sources/CodeIslandCore/SessionSnapshot.swift:785-791 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AiWorkWatchClient.swift:669` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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.
  • Duplicated block (7 lines × 3) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:649 — ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:649-655 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:670-676 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:692-698 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:649` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1578 — ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1578-1584 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:558-564 | ios/CodeIslandCompanion/CodeIslandWatchWidget/CodeIslandWatchStatusWidget.swift:130-136 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1578` 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 (6 lines × 4) · ×5
  • Duplicated block (6 lines × 4) Sources/CodeIsland/BuddyView.swift:171 — Sources/CodeIsland/BuddyView.swift:171-176 | Sources/CodeIsland/CursorView.swift:173-178 | Sources/CodeIsland/OpenCodeView.swift:166-171 | Sources/CodeIsland/QoderView.swift:146-151 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/CursorView.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 131 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) Sources/CodeIsland/ConfigInstaller.swift:798 — Sources/CodeIsland/ConfigInstaller.swift:798-803 | Sources/CodeIsland/ConfigInstaller.swift:818-823 | Sources/CodeIsland/ConfigInstaller.swift:917-922 | Sources/CodeIsland/ConfigInstaller.swift:938-943 — 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.
  • Duplicated block (6 lines × 4) Sources/CodeIsland/ConfigInstaller.swift:796 — Sources/CodeIsland/ConfigInstaller.swift:796-801 | Sources/CodeIsland/ConfigInstaller.swift:893-898 | Sources/CodeIsland/ConfigInstaller.swift:915-920 | Sources/CodeIsland/ConfigInstaller.swift:936-941 — 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.
  • Duplicated block (6 lines × 4) Sources/CodeIsland/AntiGravityView.swift:163 — Sources/CodeIsland/AntiGravityView.swift:163-168 | Sources/CodeIsland/HermesView.swift:171-176 | Sources/CodeIsland/StepFunView.swift:166-171 | Sources/CodeIsland/WorkBuddyView.swift:155-160 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:540 — android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:540-545 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:612-617 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:740-745 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:801-806 — 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×5
  • Swallowed exception (empty catch) windows/CodeIsland.Ipc/PipeServer.cs:38 — 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) windows/CodeIsland.Windows/App.xaml.cs:52 — 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) windows/CodeIsland.Windows/AppLogger.cs:39 — 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) windows/CodeIsland.Windows/CodexSessionTailer.cs:107 — 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) windows/CodeIsland.Windows/MainWindow.xaml.cs:238 — 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/AntiGravityView.swift:124 — Sources/CodeIsland/AntiGravityView.swift:124-148 | Sources/CodeIsland/HermesView.swift:132-156 | Sources/CodeIsland/PiView.swift:131-152 | Sources/CodeIsland/StepFunView.swift:124-150 | Sources/CodeIsland/WorkBuddyView.swift:116-140 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/ClineView.swift:150 — Sources/CodeIsland/ClineView.swift:150-164 | Sources/CodeIsland/GeminiView.swift:138-154 | Sources/CodeIsland/KimiView.swift:131-145 | Sources/CodeIsland/QwenView.swift:149-165 | Sources/CodeIsland/TraeView.swift:141-155 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/ConfigInstaller.swift:3453 — Sources/CodeIsland/ConfigInstaller.swift:3453-3461 | Sources/CodeIsland/ConfigInstaller.swift:3474-3480 | Sources/CodeIsland/ConfigInstaller.swift:3520-3526 | Sources/CodeIsland/RemoteInstaller.swift:381-391 | Sources/CodeIsland/RemoteInstaller.swift:393-403 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:18 — Sources/CodeIsland/Discovery/CopilotDiscovery.swift:18-57 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:33-72 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:57-97 | Sources/CodeIsland/Discovery/KimiDiscovery.swift:14-93 | Sources/CodeIsland/Discovery/OpenCodeDiscovery.swift:66-104 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift:48 — Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift:48-62 | Sources/CodeIsland/Discovery/SessionDiscovery+ConfigRoots.swift:41-49 | Sources/CodeIsland/HostHarnessSupport.swift:75-82 | Sources/CodeIsland/ProcessTable.swift:55-86 — 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) Sources/CodeIsland/BuddyView.swift:58 — Sources/CodeIsland/BuddyView.swift:58-120 | Sources/CodeIsland/DexView.swift:61-97 | Sources/CodeIsland/OpenCodeView.swift:58-105 | Sources/CodeIsland/QoderView.swift:57-87 — 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) Sources/CodeIsland/BuddyView.swift:171 — Sources/CodeIsland/BuddyView.swift:171-184 | Sources/CodeIsland/CursorView.swift:173-185 | Sources/CodeIsland/OpenCodeView.swift:166-178 | Sources/CodeIsland/QoderView.swift:146-159 — 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) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:539 — android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:539-551 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:611-622 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:739-750 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:800-811 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×4
  • Low cohesion: AppState (LCOM4 6) Sources/CodeIsland/AppState.swift:26 — AppState'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: MainWindow (LCOM4 4) windows/CodeIsland.Windows/MainWindow.xaml.cs:24 — MainWindow'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: AppleCompanionPublisher (LCOM4 4) Sources/CodeIsland/AppleCompanionPublisher.swift:7 — AppleCompanionPublisher'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: StatusItemController (LCOM4 4) Sources/CodeIsland/StatusItemController.swift:9 — StatusItemController'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.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: ConfigInstaller.swift ↔ EventNormalizer.swift Sources/CodeIsland/ConfigInstaller.swift:1 — `Sources/CodeIsland/ConfigInstaller.swift` and `Sources/CodeIslandCore/EventNormalizer.swift` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these 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 `4acf0236` fix(hermes): remove the card when the session really ends; `65214f64` fix(hermes): keep cards across turns and show prompt, reply and title…; `30441c10` fix(jump): reach Orca worktree terminals and Zed's integrated terminal — run `git show` on any of them.
  • Change coupling: main.swift ↔ EventNormalizer.swift Sources/CodeIslandBridge/main.swift:1 — `Sources/CodeIslandBridge/main.swift` and `Sources/CodeIslandCore/EventNormalizer.swift` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these 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 `65214f64` fix(hermes): keep cards across turns and show prompt, reply and title…; `30441c10` fix(jump): reach Orca worktree terminals and Zed's integrated terminal; `48f2ef7f` feat(grok): add Grok CLI integration (#281) — run `git show` on any of them.
  • Change coupling: ConfigInstaller.swift ↔ MascotView.swift Sources/CodeIsland/ConfigInstaller.swift:1 — `Sources/CodeIsland/ConfigInstaller.swift` and `Sources/CodeIsland/MascotView.swift` change together 67% of the time (14 of the 21 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, 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 `89dd65fb` feat(mimo): support MiMo Code and the Xiaomi MiMo desktop app (#355); `23440f00` feat(minimax): add MiniMax Code CLI support (#360); `6fc538d4` feat(aiwork): add AiWork GUI and CLI/TUI support (#336) — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) Sources/CodeIsland/NotchPanelView.swift:868 — Sources/CodeIsland/NotchPanelView.swift:868-879 | Sources/CodeIsland/NotchPanelView.swift:883-894 — 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) Sources/CodeIslandCore/CoworkSession.swift:161 — Sources/CodeIslandCore/CoworkSession.swift:161-172 | Sources/CodeIslandCore/JSONLTailer.swift:71-82 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/CoworkSession.swift:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:223 — ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:223-234 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:314-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:223` 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 (6 lines × 5) · ×3
  • Duplicated block (6 lines × 5) Sources/CodeIsland/AntiGravityView.swift:93 — Sources/CodeIsland/AntiGravityView.swift:93-98 | Sources/CodeIsland/HermesView.swift:101-106 | Sources/CodeIsland/PiView.swift:99-104 | Sources/CodeIsland/StepFunView.swift:89-94 | Sources/CodeIsland/WorkBuddyView.swift:85-90 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) Sources/CodeIsland/AntiGravityView.swift:170 — Sources/CodeIsland/AntiGravityView.swift:170-175 | Sources/CodeIsland/HermesView.swift:178-183 | Sources/CodeIsland/PiView.swift:173-178 | Sources/CodeIsland/StepFunView.swift:173-178 | Sources/CodeIsland/WorkBuddyView.swift:162-167 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:170` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:27 — Sources/CodeIsland/Discovery/CopilotDiscovery.swift:27-32 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:42-47 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:69-74 | Sources/CodeIsland/Discovery/KimiDiscovery.swift:25-30 | Sources/CodeIsland/Discovery/OpenCodeDiscovery.swift:77-82 — before extracting anything, compare `Sources/CodeIsland/Discovery/CopilotDiscovery.swift` and `Sources/CodeIsland/Discovery/CursorDiscovery.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/CopilotDiscovery.swift:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×3
  • Sync-over-async blocking — 2 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking windows/CodeIsland.Windows/App.xaml.cs:277 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking windows/CodeIsland.Windows/App.xaml.cs:280 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:274 — Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:274-359 | Sources/CodeIsland/Discovery/ClineDiscovery.swift:67-101 | Sources/CodeIsland/Discovery/CodexDiscovery.swift:909-979 | Sources/CodeIsland/Discovery/CopilotDiscovery.swift:113-165 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:92-132 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:132-178 — 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.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/CodeIslandCore/AppleCompanionPayload.swift:132 — Sources/CodeIslandCore/AppleCompanionPayload.swift:132-158 | Sources/CodeIslandCore/CoworkSession.swift:149-173 | Sources/CodeIslandCore/HookIntake.swift:101-133 | Sources/CodeIslandCore/JSONLTailer.swift:57-85 | Sources/CodeIslandCore/PushNotification.swift:160-186 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:201-227 — 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 · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) Sources/CodeIsland/AppState.swift:2804 — Sources/CodeIsland/AppState.swift:2804-2819 | Sources/CodeIsland/AppState.swift:2930-2944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AppState.swift:2804` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
  • Duplicated block (15–16 lines × 2) Sources/CodeIslandCore/HookIntake.swift:576 — Sources/CodeIslandCore/HookIntake.swift:576-590 | Sources/CodeIslandCore/HookIntake.swift:628-643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/HookIntake.swift:576` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) Sources/CodeIsland/DebugHarness.swift:274 — Sources/CodeIsland/DebugHarness.swift:274-283 | Sources/CodeIsland/DebugHarness.swift:459-467 — 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–10 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:671 — ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:671-679 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:693-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:671` 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 (9 lines × 11) · ×2
  • Duplicated block (9 lines × 11) Sources/CodeIsland/DebugHarness.swift:98 — Sources/CodeIsland/DebugHarness.swift:98-106 | Sources/CodeIsland/DebugHarness.swift:180-188 | Sources/CodeIsland/DebugHarness.swift:252-260 | Sources/CodeIsland/DebugHarness.swift:302-310 | Sources/CodeIsland/DebugHarness.swift:321-329 | Sources/CodeIsland/DebugHarness.swift:380-388 | Sources/CodeIsland/DebugHarness.swift:407-415 | Sources/CodeIsland/DebugHarness.swift:422-430 | Sources/CodeIsland/DebugHarness.swift:437-445 | Sources/CodeIsland/DebugHarness.swift:449-457 | Sources/CodeIsland/DebugHarness.swift:504-512 — all 11 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/DebugHarness.swift:311` calls `addRecentMessage`, `ChatMessage` and `Sources/CodeIsland/DebugHarness.swift:107` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 11) Sources/CodeIsland/ClineView.swift:211 — Sources/CodeIsland/ClineView.swift:211-219 | Sources/CodeIsland/CopilotView.swift:227-235 | Sources/CodeIsland/CursorView.swift:233-241 | Sources/CodeIsland/DexView.swift:244-252 | Sources/CodeIsland/DroidView.swift:209-217 | Sources/CodeIsland/GeminiView.swift:204-212 | Sources/CodeIsland/KimiView.swift:193-201 | Sources/CodeIsland/OpenCodeView.swift:225-233 | Sources/CodeIsland/QoderView.swift:206-214 | Sources/CodeIsland/QwenView.swift:214-222 | Sources/CodeIsland/TraeView.swift:203-211 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/CopilotView.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 136 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 × 5) · ×2
  • Duplicated block (9 lines × 5) Sources/CodeIsland/GrokView.swift:44 — Sources/CodeIsland/GrokView.swift:44-52 | Sources/CodeIsland/GrokView.swift:60-68 | Sources/CodeIsland/GrokView.swift:71-79 | Sources/CodeIsland/GrokView.swift:87-95 | Sources/CodeIsland/GrokView.swift:98-106 — all 5 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 `Sources/CodeIsland/GrokView.swift:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/GrokView.swift:70` calls `addLine`, `point` and `Sources/CodeIsland/GrokView.swift:54` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 5) Sources/CodeIsland/GrokView.swift:51 — Sources/CodeIsland/GrokView.swift:51-59 | Sources/CodeIsland/GrokView.swift:62-70 | Sources/CodeIsland/GrokView.swift:73-81 | Sources/CodeIsland/GrokView.swift:89-97 | Sources/CodeIsland/GrokView.swift:115-123 — all 5 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 `Sources/CodeIsland/GrokView.swift:51` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/GrokView.swift:59` calls `addLine`, `point` and `Sources/CodeIsland/GrokView.swift:48` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 5) · ×2
  • Duplicated block (7–8 lines × 5) Sources/CodeIsland/DebugHarness.swift:120 — Sources/CodeIsland/DebugHarness.swift:120-127 | Sources/CodeIsland/DebugHarness.swift:325-331 | Sources/CodeIsland/DebugHarness.swift:411-417 | Sources/CodeIsland/DebugHarness.swift:426-432 | Sources/CodeIsland/DebugHarness.swift:508-515 — all 5 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.
  • Duplicated block (7–8 lines × 5) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:275 — Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:275-282 | Sources/CodeIsland/Discovery/CopilotDiscovery.swift:114-120 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:93-99 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:133-139 | Sources/CodeIsland/Discovery/KimiDiscovery.swift:186-192 — before extracting anything, compare `Sources/CodeIsland/Discovery/CopilotDiscovery.swift` and `Sources/CodeIsland/Discovery/CursorDiscovery.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (5–8 lines × 2) · ×2
  • Duplicated block (5–8 lines × 2) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:65 — windows/CodeIsland.Windows/SettingsWindow.xaml.cs:65-69 | windows/CodeIsland.Windows/SettingsWindow.xaml.cs:75-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `windows/CodeIsland.Windows/SettingsWindow.xaml.cs:75` 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.
  • Duplicated block (5–8 lines × 2) Sources/CodeIslandCore/AiWorkWatchClient.swift:630 — Sources/CodeIslandCore/AiWorkWatchClient.swift:630-637 | Sources/CodeIslandCore/AiWorkWatchClient.swift:644-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AiWorkWatchClient.swift:630` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×2
  • Duplicated block (7 lines × 6) Sources/CodeIsland/AiWorkView.swift:243 — Sources/CodeIsland/AiWorkView.swift:243-249 | Sources/CodeIsland/BuddyView.swift:215-221 | Sources/CodeIsland/CursorView.swift:217-223 | Sources/CodeIsland/DroidView.swift:193-199 | Sources/CodeIsland/OpenCodeView.swift:209-215 | Sources/CodeIsland/QoderView.swift:190-196 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 95 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 6) Sources/CodeIsland/ClineView.swift:194 — Sources/CodeIsland/ClineView.swift:194-200 | Sources/CodeIsland/CopilotView.swift:207-213 | Sources/CodeIsland/GeminiView.swift:188-194 | Sources/CodeIsland/KimiView.swift:177-183 | Sources/CodeIsland/QwenView.swift:198-204 | Sources/CodeIsland/TraeView.swift:187-193 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/CopilotView.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 136 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ClineView.swift:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/ClineView.swift:204` calls `drawLegs` and `Sources/CodeIsland/KimiView.swift:187` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) Sources/CodeIsland/ConfigInstaller.swift:761 — Sources/CodeIsland/ConfigInstaller.swift:761-766 | Sources/CodeIsland/ConfigInstaller.swift:781-786 | Sources/CodeIsland/ConfigInstaller.swift:846-855 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:761` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 3) Sources/CodeIsland/ConfigInstaller.swift:767 — Sources/CodeIsland/ConfigInstaller.swift:767-772 | Sources/CodeIsland/ConfigInstaller.swift:783-788 | Sources/CodeIsland/ConfigInstaller.swift:854-861 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:767` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 13) · ×2
  • Duplicated block (5 lines × 13) Sources/CodeIsland/BuddyView.swift:284 — Sources/CodeIsland/BuddyView.swift:284-288 | Sources/CodeIsland/ClineView.swift:259-263 | Sources/CodeIsland/CopilotView.swift:285-289 | Sources/CodeIsland/CursorView.swift:285-289 | Sources/CodeIsland/DexView.swift:304-308 | Sources/CodeIsland/DroidView.swift:262-266 | Sources/CodeIsland/GeminiView.swift:254-258 | Sources/CodeIsland/KimiView.swift:242-246 | Sources/CodeIsland/OpenCodeView.swift:273-277 | Sources/CodeIsland/PixelCharacterView.swift:381-385 | Sources/CodeIsland/QoderView.swift:254-258 | Sources/CodeIsland/QwenView.swift:263-267 | Sources/CodeIsland/TraeView.swift:252-256 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/ClineView.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:284` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 13) Sources/CodeIsland/BuddyView.swift:290 — Sources/CodeIsland/BuddyView.swift:290-294 | Sources/CodeIsland/ClineView.swift:265-269 | Sources/CodeIsland/CopilotView.swift:291-295 | Sources/CodeIsland/CursorView.swift:291-295 | Sources/CodeIsland/DexView.swift:310-314 | Sources/CodeIsland/DroidView.swift:268-272 | Sources/CodeIsland/GeminiView.swift:260-264 | Sources/CodeIsland/KimiView.swift:248-252 | Sources/CodeIsland/OpenCodeView.swift:279-283 | Sources/CodeIsland/PixelCharacterView.swift:387-391 | Sources/CodeIsland/QoderView.swift:260-264 | Sources/CodeIsland/QwenView.swift:269-273 | Sources/CodeIsland/TraeView.swift:258-262 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/ClineView.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:290` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (5 lines × 5) · ×2
  • Duplicated block (5 lines × 5) Sources/CodeIsland/ClineView.swift:154 — Sources/CodeIsland/ClineView.swift:154-158 | Sources/CodeIsland/GeminiView.swift:144-148 | Sources/CodeIsland/KimiView.swift:135-139 | Sources/CodeIsland/QwenView.swift:155-159 | Sources/CodeIsland/TraeView.swift:145-149 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/GeminiView.swift` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 155 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ClineView.swift:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/GeminiView.swift:142` calls `truncatingRemainder`, `sin` and `Sources/CodeIsland/ClineView.swift:153` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 5) Sources/CodeIsland/ConfigInstaller.swift:3456 — Sources/CodeIsland/ConfigInstaller.swift:3456-3461 | Sources/CodeIsland/ConfigInstaller.swift:3476-3480 | Sources/CodeIsland/ConfigInstaller.swift:3522-3526 | Sources/CodeIsland/RemoteInstaller.swift:383-391 | Sources/CodeIsland/RemoteInstaller.swift:395-403 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:3456` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) Sources/CodeIsland/AntiGravityView.swift:150 — Sources/CodeIsland/AntiGravityView.swift:150-154 | Sources/CodeIsland/HermesView.swift:158-162 | Sources/CodeIsland/PiView.swift:154-158 | Sources/CodeIsland/WorkBuddyView.swift:142-146 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift:55 — Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift:55-59 | Sources/CodeIsland/Discovery/SessionDiscovery+ConfigRoots.swift:42-46 | Sources/CodeIsland/HostHarnessSupport.swift:76-80 | Sources/CodeIsland/ProcessTable.swift:56-60 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×2
  • Duplicated block (7 lines × 2 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:728 — Sources/CodeIsland/Resources/codeisland-omp.ts:728 · Sources/CodeIsland/Resources/codeisland-omp.ts:735 — 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 locations) Sources/CodeIsland/Resources/codeisland-pi.ts:730 — Sources/CodeIsland/Resources/codeisland-pi.ts:730 · Sources/CodeIsland/Resources/codeisland-pi.ts:740 — 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.
X1 · Async correctness · Sync-over-async (deadlock risk) · ×2
  • Sync-over-async (deadlock risk) windows/CodeIsland.Windows/App.xaml.cs:277 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) windows/CodeIsland.Windows/App.xaml.cs:280 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
X18 · Disposal-pattern correctness · Owned disposable field is never released · ×2
  • Owned disposable field is never released windows/CodeIsland.Ipc/PipeClient.cs:12 — `PipeClient` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_reader` itself (line 12), which makes that instance its own. But `_reader` is named in none of the methods the disposal search covered: `DisposeAsync` (line 63) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_reader?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
  • Owned disposable field is never released windows/CodeIsland.Ipc/PipeClient.cs:13 — `PipeClient` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_writer` itself (line 13), which makes that instance its own. But `_writer` is named in none of the methods the disposal search covered: `DisposeAsync` (line 63) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_writer?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
D1 · Cyclomatic Complexity · SessionSnapshot.swift.applyHookEvent (cyclomatic 163) · ×1
  • SessionSnapshot.swift.applyHookEvent (cyclomatic 163) Sources/CodeIslandCore/SessionSnapshot.swift:1229 — SessionSnapshot.swift.applyHookEvent has cyclomatic complexity 163 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HookIntake.init (cyclomatic 83) · ×1
  • HookIntake.init (cyclomatic 83) Sources/CodeIslandCore/HookIntake.swift:225 — HookIntake.init has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codeisland-omp.codeislandExtension (cyclomatic 79) · ×1
  • codeisland-omp.codeislandExtension (cyclomatic 79) Sources/CodeIsland/Resources/codeisland-omp.ts:494 — codeisland-omp.codeislandExtension has cyclomatic complexity 79 (threshold 15). Most of this is not in the body itself: 6 of the 79 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 656, a function literal at line 1041, formatSingleQuestionResponse, …). 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 · SessionSnapshot.swift.extractMetadata (cyclomatic 77) · ×1
  • SessionSnapshot.swift.extractMetadata (cyclomatic 77) Sources/CodeIslandCore/SessionSnapshot.swift:2047 — SessionSnapshot.swift.extractMetadata has cyclomatic complexity 77 (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 · ConfigInstaller.installExternalHooks (cyclomatic 60) · ×1
  • ConfigInstaller.installExternalHooks (cyclomatic 60) Sources/CodeIsland/ConfigInstaller.swift:1753 — ConfigInstaller.installExternalHooks has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppState.handleEvent (cyclomatic 56) · ×1
  • AppState.handleEvent (cyclomatic 56) Sources/CodeIsland/AppState.swift:1664 — AppState.handleEvent has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HookIntake.addTerminalContext (cyclomatic 56) · ×1
  • HookIntake.addTerminalContext (cyclomatic 56) Sources/CodeIslandCore/HookIntake.swift:520 — HookIntake.addTerminalContext has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppState.integrateDiscovered (cyclomatic 54) · ×1
  • AppState.integrateDiscovered (cyclomatic 54) Sources/CodeIsland/AppState.swift:3568 — AppState.integrateDiscovered 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 · Scanner.enablingHooks (cyclomatic 53) · ×1
  • Scanner.enablingHooks (cyclomatic 53) Sources/CodeIslandCore/CodexHooksConfig.swift:35 — Scanner.enablingHooks 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 · SettingsWindow.RefreshLanguageFixed (cyclomatic 52) · ×1
  • SettingsWindow.RefreshLanguageFixed (cyclomatic 52) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:41 — SettingsWindow.RefreshLanguageFixed has cyclomatic complexity 52 (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 · CodexPermissionRules.plainCommands (cyclomatic 52) · ×1
  • CodexPermissionRules.plainCommands (cyclomatic 52) Sources/CodeIsland/CodexPermissionRules.swift:756 — CodexPermissionRules.plainCommands has cyclomatic complexity 52 (threshold 15). Of this number, 46 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 · NotchPanelView.body (cyclomatic 52) · ×1
  • NotchPanelView.body (cyclomatic 52) Sources/CodeIsland/NotchPanelView.swift:255 — NotchPanelView.body has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfigInstaller.verifyAndRepair (cyclomatic 50) · ×1
  • ConfigInstaller.verifyAndRepair (cyclomatic 50) Sources/CodeIsland/ConfigInstaller.swift:1402 — ConfigInstaller.verifyAndRepair has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionSnapshot.swift.applyEnvMetadata (cyclomatic 50) · ×1
  • SessionSnapshot.swift.applyEnvMetadata (cyclomatic 50) Sources/CodeIslandCore/SessionSnapshot.swift:1788 — SessionSnapshot.swift.applyEnvMetadata has cyclomatic complexity 50 (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 · SessionSnapshot.swift.handleSubagentEvent (cyclomatic 50) · ×1
  • SessionSnapshot.swift.handleSubagentEvent (cyclomatic 50) Sources/CodeIslandCore/SessionSnapshot.swift:2343 — SessionSnapshot.swift.handleSubagentEvent has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codeisland-pi.codeislandExtension (cyclomatic 49) · ×1
  • codeisland-pi.codeislandExtension (cyclomatic 49) Sources/CodeIsland/Resources/codeisland-pi.ts:366 — codeisland-pi.codeislandExtension has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 1 of the 49 points is its own statement and the rest belongs to 14 function items inside it that branch (a function literal at line 635, a function literal at line 529, a function literal at line 470, …). 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 · SessionSnapshot.terminalName (cyclomatic 47) · ×1
  • SessionSnapshot.terminalName (cyclomatic 47) Sources/CodeIslandCore/SessionSnapshot.swift:961 — SessionSnapshot.terminalName has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TerminalActivator.activateTerminal (cyclomatic 43) · ×1
  • TerminalActivator.activateTerminal (cyclomatic 43) Sources/CodeIsland/TerminalActivator.swift:218 — TerminalActivator.activateTerminal has cyclomatic complexity 43 (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 · Scanner.string (cyclomatic 42) · ×1
  • Scanner.string (cyclomatic 42) Sources/CodeIslandCore/CodexHooksConfig.swift:243 — Scanner.string 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 · CLIProcessResolver.sourceMatchesExecutablePath (cyclomatic 42) · ×1
  • CLIProcessResolver.sourceMatchesExecutablePath (cyclomatic 42) Sources/CodeIslandCore/Models.swift:62 — CLIProcessResolver.sourceMatchesExecutablePath has cyclomatic complexity 42 (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 · HookEvent.activityCategory (cyclomatic 42) · ×1
  • HookEvent.activityCategory (cyclomatic 42) Sources/CodeIslandCore/Models.swift:565 — HookEvent.activityCategory has cyclomatic complexity 42 (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 · HookEvent.toolDescription (cyclomatic 41) · ×1
  • HookEvent.toolDescription (cyclomatic 41) Sources/CodeIslandCore/Models.swift:469 — HookEvent.toolDescription has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppState.applyCursorSubsessionModeToKnownSessions (cyclomatic 39) · ×1
  • AppState.applyCursorSubsessionModeToKnownSessions (cyclomatic 39) Sources/CodeIsland/AppState.swift:4001 — AppState.applyCursorSubsessionModeToKnownSessions has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KimiDiscovery.readRecentFromKimiTranscript (cyclomatic 37) · ×1
  • KimiDiscovery.readRecentFromKimiTranscript (cyclomatic 37) Sources/CodeIsland/Discovery/KimiDiscovery.swift:185 — KimiDiscovery.readRecentFromKimiTranscript has cyclomatic complexity 37 (threshold 15). Of this number, 30 points are the body's own statements and 7 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 · SettingsWindow.RefreshLanguageChinese (cyclomatic 35) · ×1
  • SettingsWindow.RefreshLanguageChinese (cyclomatic 35) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:63 — SettingsWindow.RefreshLanguageChinese has cyclomatic complexity 35 (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 · AppState.attachTranscriptTailerIfNeeded (cyclomatic 35) · ×1
  • AppState.attachTranscriptTailerIfNeeded (cyclomatic 35) Sources/CodeIsland/AppState+TranscriptTailer.swift:23 — AppState.attachTranscriptTailerIfNeeded 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 · CodexDiscovery.discoverCodexSessions (cyclomatic 35) · ×1
  • CodexDiscovery.discoverCodexSessions (cyclomatic 35) Sources/CodeIsland/Discovery/CodexDiscovery.swift:462 — CodexDiscovery.discoverCodexSessions 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 · ApprovalCopy.action (cyclomatic 34) · ×1
  • ApprovalCopy.action (cyclomatic 34) Sources/CodeIsland/NotchPanelView.swift:1637 — ApprovalCopy.action has cyclomatic complexity 34 (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 · SettingsWindow.RefreshLanguage (cyclomatic 33) · ×1
  • SettingsWindow.RefreshLanguage (cyclomatic 33) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:72 — SettingsWindow.RefreshLanguage 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 · ClaudeDiscovery.readRecentFromTranscript (cyclomatic 33) · ×1
  • ClaudeDiscovery.readRecentFromTranscript (cyclomatic 33) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:274 — ClaudeDiscovery.readRecentFromTranscript has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppState.cleanupIdleSessions (cyclomatic 32) · ×1
  • AppState.cleanupIdleSessions (cyclomatic 32) Sources/CodeIsland/AppState.swift:561 — AppState.cleanupIdleSessions has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppState.applyCoworkUpdate (cyclomatic 32) · ×1
  • AppState.applyCoworkUpdate (cyclomatic 32) Sources/CodeIsland/AppState+CoworkWatch.swift:239 — AppState.applyCoworkUpdate 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 · JSONLTailer.apply (cyclomatic 32) · ×1
  • JSONLTailer.apply (cyclomatic 32) Sources/CodeIslandCore/JSONLTailer.swift:537 — JSONLTailer.apply 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 · JSONLTailer.quickTypeProbe (cyclomatic 32) · ×1
  • JSONLTailer.quickTypeProbe (cyclomatic 32) Sources/CodeIslandCore/JSONLTailer.swift:870 — JSONLTailer.quickTypeProbe 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 · SessionSnapshot.swift.fillMissingParentMetadataFromSubagentEvent (cyclomatic 32) · ×1
  • SessionSnapshot.swift.fillMissingParentMetadataFromSubagentEvent (cyclomatic 32) Sources/CodeIslandCore/SessionSnapshot.swift:1863 — SessionSnapshot.swift.fillMissingParentMetadataFromSubagentEvent has cyclomatic complexity 32 (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 is NOT this file's highest cyclomatic complexity: SessionSnapshot.sourceLabel (cyclomatic 35) 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 · AppState.handleAiWorkStreamEvent (cyclomatic 31) · ×1
  • AppState.handleAiWorkStreamEvent (cyclomatic 31) Sources/CodeIsland/AppState+AiWorkWatch.swift:324 — AppState.handleAiWorkStreamEvent has cyclomatic complexity 31 (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 · index.register (cyclomatic 31) · ×1
  • index.register (cyclomatic 31) Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:309 — index.register has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 431, a function literal at line 402, onAgentRunStart, …). 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 · ConfigInstaller.install (cyclomatic 30) · ×1
  • ConfigInstaller.install (cyclomatic 30) Sources/CodeIsland/ConfigInstaller.swift:1067 — ConfigInstaller.install has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CoworkSessionWatcher.process (cyclomatic 30) · ×1
  • CoworkSessionWatcher.process (cyclomatic 30) Sources/CodeIsland/CoworkSessionWatcher.swift:335 — CoworkSessionWatcher.process has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeLogoShape.parseSVGPath (cyclomatic 30) · ×1
  • ClaudeLogoShape.parseSVGPath (cyclomatic 30) Sources/CodeIsland/NotchPanelView.swift:5054 — ClaudeLogoShape.parseSVGPath has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · TerminalVisibilityDetector.liveIsSessionTabVisible (cyclomatic 30) · ×1
  • TerminalVisibilityDetector.liveIsSessionTabVisible (cyclomatic 30) Sources/CodeIsland/TerminalVisibilityDetector.swift:147 — TerminalVisibilityDetector.liveIsSessionTabVisible has cyclomatic complexity 30 (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 · CodexDiscovery.readRecentFromCodexTranscript (cyclomatic 30) · ×1
  • CodexDiscovery.readRecentFromCodexTranscript (cyclomatic 30) Sources/CodeIsland/Discovery/CodexDiscovery.swift:909 — CodexDiscovery.readRecentFromCodexTranscript has cyclomatic complexity 30 (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 · PushResponseInterpreter.interpret (cyclomatic 30) · ×1
  • PushResponseInterpreter.interpret (cyclomatic 30) Sources/CodeIslandCore/PushChannel.swift:690 — PushResponseInterpreter.interpret has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppState.backfillClaudeTerminalMetadata (cyclomatic 29) · ×1
  • AppState.backfillClaudeTerminalMetadata (cyclomatic 29) Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift:9 — AppState.backfillClaudeTerminalMetadata has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AppState.applyTranscriptDelta (cyclomatic 29) · ×1
  • AppState.applyTranscriptDelta (cyclomatic 29) Sources/CodeIsland/AppState+TranscriptTailer.swift:222 — AppState.applyTranscriptDelta 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 · HookServer.processRequest (cyclomatic 28) · ×1
  • HookServer.processRequest (cyclomatic 28) Sources/CodeIsland/HookServer.swift:534 — HookServer.processRequest 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 · main.swift.top-level code (cyclomatic 28) · ×1
  • main.swift.top-level code (cyclomatic 28) Sources/CodeIslandBridge/main.swift:28 — main.swift.top-level code has cyclomatic complexity 28 (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 · ConfigInstaller.normalizeTraecliHooksListIndentation (cyclomatic 27) · ×1
  • ConfigInstaller.normalizeTraecliHooksListIndentation (cyclomatic 27) Sources/CodeIsland/ConfigInstaller.swift:2014 — ConfigInstaller.normalizeTraecliHooksListIndentation 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 · AgentTaskList.apply (cyclomatic 27) · ×1
  • AgentTaskList.apply (cyclomatic 27) Sources/CodeIslandCore/AgentTaskList.swift:333 — AgentTaskList.apply 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 · AppState.tryMonitorSession (cyclomatic 25) · ×1
  • AppState.tryMonitorSession (cyclomatic 25) Sources/CodeIsland/AppState.swift:1116 — AppState.tryMonitorSession has cyclomatic complexity 25 (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 · AppState.applyCodexSubsessionModeToKnownSessions (cyclomatic 25) · ×1
  • AppState.applyCodexSubsessionModeToKnownSessions (cyclomatic 25) Sources/CodeIsland/AppState.swift:3873 — AppState.applyCodexSubsessionModeToKnownSessions 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 · ScreenDetector.frontmostApplicationWindowBounds (cyclomatic 25) · ×1
  • ScreenDetector.frontmostApplicationWindowBounds (cyclomatic 25) Sources/CodeIsland/ScreenDetector.swift:216 — ScreenDetector.frontmostApplicationWindowBounds has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · codeisland-remote-hook._scan_session_jsonl (cyclomatic 25) · ×1
  • codeisland-remote-hook._scan_session_jsonl (cyclomatic 25) Sources/CodeIsland/Resources/codeisland-remote-hook.py:162 — codeisland-remote-hook._scan_session_jsonl 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 · AppDelegate.applicationDidFinishLaunching (cyclomatic 24) · ×1
  • AppDelegate.applicationDidFinishLaunching (cyclomatic 24) Sources/CodeIsland/AppDelegate.swift:22 — AppDelegate.applicationDidFinishLaunching has cyclomatic complexity 24 (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 · ConfigInstaller.setEnabled (cyclomatic 24) · ×1
  • ConfigInstaller.setEnabled (cyclomatic 24) Sources/CodeIsland/ConfigInstaller.swift:1337 — ConfigInstaller.setEnabled 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 · CodexDiscovery.codexSpawnEdgeRecords (cyclomatic 24) · ×1
  • CodexDiscovery.codexSpawnEdgeRecords (cyclomatic 24) Sources/CodeIsland/Discovery/CodexDiscovery.swift:726 — CodexDiscovery.codexSpawnEdgeRecords 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 · CopilotDiscovery.readRecentFromCopilotTranscript (cyclomatic 24) · ×1
  • CopilotDiscovery.readRecentFromCopilotTranscript (cyclomatic 24) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:113 — CopilotDiscovery.readRecentFromCopilotTranscript 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 · AttentionPolicy.intents (cyclomatic 24) · ×1
  • AttentionPolicy.intents (cyclomatic 24) Sources/CodeIslandCore/AttentionPolicy.swift:27 — AttentionPolicy.intents has cyclomatic complexity 24 (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 · Scanner.withoutAppendedFeaturesTable (cyclomatic 24) · ×1
  • Scanner.withoutAppendedFeaturesTable (cyclomatic 24) Sources/CodeIslandCore/CodexHooksConfig.swift:131 — Scanner.withoutAppendedFeaturesTable 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 · ApprovalToolDetailView.body (cyclomatic 23) · ×1
  • ApprovalToolDetailView.body (cyclomatic 23) Sources/CodeIsland/NotchPanelView.swift:1399 — ApprovalToolDetailView.body 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 · CodexDiscovery.recentCodexDesktopThreadRecords (cyclomatic 23) · ×1
  • CodexDiscovery.recentCodexDesktopThreadRecords (cyclomatic 23) Sources/CodeIsland/Discovery/CodexDiscovery.swift:308 — CodexDiscovery.recentCodexDesktopThreadRecords 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 · KimiDiscovery.findActiveKimiSessions (cyclomatic 23) · ×1
  • KimiDiscovery.findActiveKimiSessions (cyclomatic 23) Sources/CodeIsland/Discovery/KimiDiscovery.swift:14 — KimiDiscovery.findActiveKimiSessions 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 · CoworkAuditParser.event (cyclomatic 23) · ×1
  • CoworkAuditParser.event (cyclomatic 23) Sources/CodeIslandCore/CoworkAuditLog.swift:56 — CoworkAuditParser.event 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 · KimiDiscovery.discoverKimiCodeSessionFromIndex (cyclomatic 22) · ×1
  • KimiDiscovery.discoverKimiCodeSessionFromIndex (cyclomatic 22) Sources/CodeIsland/Discovery/KimiDiscovery.swift:98 — KimiDiscovery.discoverKimiCodeSessionFromIndex 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 · OpenCodeDiscovery.readRecentFromOpenCodeSession (cyclomatic 22) · ×1
  • OpenCodeDiscovery.readRecentFromOpenCodeSession (cyclomatic 22) Sources/CodeIsland/Discovery/OpenCodeDiscovery.swift:150 — OpenCodeDiscovery.readRecentFromOpenCodeSession 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 · ProcArgsParser.completeEnvironment (cyclomatic 22) · ×1
  • ProcArgsParser.completeEnvironment (cyclomatic 22) Sources/CodeIslandCore/HostHarness.swift:361 — ProcArgsParser.completeEnvironment has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownInlineLiterals.escapingWordDelimiters (cyclomatic 22) · ×1
  • MarkdownInlineLiterals.escapingWordDelimiters (cyclomatic 22) Sources/CodeIslandCore/MarkdownInlineLiterals.swift:23 — MarkdownInlineLiterals.escapingWordDelimiters has cyclomatic complexity 22 (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 · HookEvent.codexToolDescription (cyclomatic 22) · ×1
  • HookEvent.codexToolDescription (cyclomatic 22) Sources/CodeIslandCore/Models.swift:630 — HookEvent.codexToolDescription 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 · AppState.showNextPending (cyclomatic 21) · ×1
  • AppState.showNextPending (cyclomatic 21) Sources/CodeIsland/AppState.swift:3205 — AppState.showNextPending 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 · AppState.applyAiWorkStreamEvent (cyclomatic 21) · ×1
  • AppState.applyAiWorkStreamEvent (cyclomatic 21) Sources/CodeIsland/AppState+AiWorkWatch.swift:455 — AppState.applyAiWorkStreamEvent 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 · TerminalActivator.activate (cyclomatic 21) · ×1
  • TerminalActivator.activate (cyclomatic 21) Sources/CodeIsland/TerminalActivator.swift:113 — TerminalActivator.activate 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 · TerminalVisibilityDetector.isGhosttySessionVisibleInAnyWindow (cyclomatic 21) · ×1
  • TerminalVisibilityDetector.isGhosttySessionVisibleInAnyWindow (cyclomatic 21) Sources/CodeIsland/TerminalVisibilityDetector.swift:259 — TerminalVisibilityDetector.isGhosttySessionVisibleInAnyWindow has cyclomatic complexity 21 (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 · Scanner.statements (cyclomatic 21) · ×1
  • Scanner.statements (cyclomatic 21) Sources/CodeIslandCore/CodexHooksConfig.swift:185 — Scanner.statements 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 · MarkdownBlockParser.listMarker (cyclomatic 21) · ×1
  • MarkdownBlockParser.listMarker (cyclomatic 21) Sources/CodeIslandCore/MarkdownBlockParser.swift:379 — MarkdownBlockParser.listMarker has cyclomatic complexity 21 (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 · SessionSnapshot.normalizedSupportedSource (cyclomatic 21) · ×1
  • SessionSnapshot.normalizedSupportedSource (cyclomatic 21) Sources/CodeIslandCore/SessionSnapshot.swift:318 — SessionSnapshot.normalizedSupportedSource 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. This is NOT this file's highest cyclomatic complexity: SessionSnapshot.sourceLabel (cyclomatic 35) 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 · AppState.restoreSessions (cyclomatic 20) · ×1
  • AppState.restoreSessions (cyclomatic 20) Sources/CodeIsland/AppState.swift:3360 — AppState.restoreSessions 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 · CodexTmuxRouting.resolve (cyclomatic 20) · ×1
  • CodexTmuxRouting.resolve (cyclomatic 20) Sources/CodeIsland/CodexTmuxRouting.swift:97 — CodexTmuxRouting.resolve 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 · ConfigInstaller.cliExists (cyclomatic 20) · ×1
  • ConfigInstaller.cliExists (cyclomatic 20) Sources/CodeIsland/ConfigInstaller.swift:1215 — ConfigInstaller.cliExists 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 · ConfigInstaller.removeManagedTraecliHooksLegacy (cyclomatic 20) · ×1
  • ConfigInstaller.removeManagedTraecliHooksLegacy (cyclomatic 20) Sources/CodeIsland/ConfigInstaller.swift:2203 — ConfigInstaller.removeManagedTraecliHooksLegacy 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 · ConfigInstaller.uninstallHooks (cyclomatic 20) · ×1
  • ConfigInstaller.uninstallHooks (cyclomatic 20) Sources/CodeIsland/ConfigInstaller.swift:3133 — ConfigInstaller.uninstallHooks 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 · TerminalActivator.activateGhostty (cyclomatic 20) · ×1
  • TerminalActivator.activateGhostty (cyclomatic 20) Sources/CodeIsland/TerminalActivator.swift:456 — TerminalActivator.activateGhostty has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PushMessageFormatter.lines (cyclomatic 20) · ×1
  • PushMessageFormatter.lines (cyclomatic 20) Sources/CodeIslandCore/PushNotification.swift:297 — PushMessageFormatter.lines 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 · AppState.applyCodexRequestUserInput (cyclomatic 19) · ×1
  • AppState.applyCodexRequestUserInput (cyclomatic 19) Sources/CodeIsland/AppState+CodexAppServer.swift:273 — AppState.applyCodexRequestUserInput 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 · JSONMinimalEditor.readStringLiteral (cyclomatic 19) · ×1
  • JSONMinimalEditor.readStringLiteral (cyclomatic 19) Sources/CodeIsland/JSONMinimalEditor.swift:180 — JSONMinimalEditor.readStringLiteral 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 · MenuBarIconAvoidance.occupiedMenuBarRanges (cyclomatic 19) · ×1
  • MenuBarIconAvoidance.occupiedMenuBarRanges (cyclomatic 19) Sources/CodeIsland/MenuBarIconAvoidance.swift:24 — MenuBarIconAvoidance.occupiedMenuBarRanges 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 · PushNotifier.decide (cyclomatic 19) · ×1
  • PushNotifier.decide (cyclomatic 19) Sources/CodeIsland/PushNotifier.swift:298 — PushNotifier.decide 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 · TerminalActivator.activateWeztermFamily (cyclomatic 19) · ×1
  • TerminalActivator.activateWeztermFamily (cyclomatic 19) Sources/CodeIsland/TerminalActivator.swift:959 — TerminalActivator.activateWeztermFamily 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 · TerminalActivator.bringToFront (cyclomatic 19) · ×1
  • TerminalActivator.bringToFront (cyclomatic 19) Sources/CodeIsland/TerminalActivator.swift:1451 — TerminalActivator.bringToFront 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 · FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp (cyclomatic 19) · ×1
  • FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp (cyclomatic 19) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:192 — FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp 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 · CoworkAuditState.apply (cyclomatic 19) · ×1
  • CoworkAuditState.apply (cyclomatic 19) Sources/CodeIslandCore/CoworkAuditLog.swift:268 — CoworkAuditState.apply 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 · SessionSnapshot.applyHermesStore (cyclomatic 19) · ×1
  • SessionSnapshot.applyHermesStore (cyclomatic 19) Sources/CodeIslandCore/HermesSessionStore.swift:239 — SessionSnapshot.applyHermesStore 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 · SubsessionRouter.placement (cyclomatic 19) · ×1
  • SubsessionRouter.placement (cyclomatic 19) Sources/CodeIslandCore/SubsessionRouter.swift:102 — SubsessionRouter.placement 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 · BuddyMascotView.drawAlert (cyclomatic 19) · ×1
  • BuddyMascotView.drawAlert (cyclomatic 19) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:125 — BuddyMascotView.drawAlert 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 · codeisland-remote-hook._scan_codex_jsonl (cyclomatic 19) · ×1
  • codeisland-remote-hook._scan_codex_jsonl (cyclomatic 19) Sources/CodeIsland/Resources/codeisland-remote-hook.py:268 — codeisland-remote-hook._scan_codex_jsonl 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 · AppState.handleAskUserQuestion (cyclomatic 18) · ×1
  • AppState.handleAskUserQuestion (cyclomatic 18) Sources/CodeIsland/AppState.swift:2630 — AppState.handleAskUserQuestion 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 · CodexPermissionRules.repairingOrphanedMCPToolTables (cyclomatic 18) · ×1
  • CodexPermissionRules.repairingOrphanedMCPToolTables (cyclomatic 18) Sources/CodeIsland/CodexPermissionRules.swift:413 — CodexPermissionRules.repairingOrphanedMCPToolTables has cyclomatic complexity 18 (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 · ConfigInstaller.stripJSONComments (cyclomatic 18) · ×1
  • ConfigInstaller.stripJSONComments (cyclomatic 18) Sources/CodeIsland/ConfigInstaller.swift:1523 — ConfigInstaller.stripJSONComments 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 · ESP32StatePublisher.flush (cyclomatic 18) · ×1
  • ESP32StatePublisher.flush (cyclomatic 18) Sources/CodeIsland/ESP32StatePublisher.swift:87 — ESP32StatePublisher.flush 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 · JSONMinimalEditor.skipObjectOrArray (cyclomatic 18) · ×1
  • JSONMinimalEditor.skipObjectOrArray (cyclomatic 18) Sources/CodeIsland/JSONMinimalEditor.swift:245 — JSONMinimalEditor.skipObjectOrArray 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 · SessionListView.body (cyclomatic 18) · ×1
  • SessionListView.body (cyclomatic 18) Sources/CodeIsland/NotchPanelView.swift:3039 — SessionListView.body 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 · HooksPage.body (cyclomatic 18) · ×1
  • HooksPage.body (cyclomatic 18) Sources/CodeIsland/SettingsView.swift:827 — HooksPage.body 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 · ProcArgsParser.parse (cyclomatic 18) · ×1
  • ProcArgsParser.parse (cyclomatic 18) Sources/CodeIslandCore/HostHarness.swift:313 — ProcArgsParser.parse has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codeisland-remote-hook._scan_hermes_store (cyclomatic 18) · ×1
  • codeisland-remote-hook._scan_hermes_store (cyclomatic 18) Sources/CodeIsland/Resources/codeisland-remote-hook.py:373 — codeisland-remote-hook._scan_hermes_store 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 · AppState.handleProcessExit (cyclomatic 17) · ×1
  • AppState.handleProcessExit (cyclomatic 17) Sources/CodeIsland/AppState.swift:865 — AppState.handleProcessExit 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 · AppState.separateMergedCodexSubagents (cyclomatic 17) · ×1
  • AppState.separateMergedCodexSubagents (cyclomatic 17) Sources/CodeIsland/AppState.swift:4492 — AppState.separateMergedCodexSubagents 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 · AppState.routeDiscoveredSubsessionIfNeeded (cyclomatic 17) · ×1
  • AppState.routeDiscoveredSubsessionIfNeeded (cyclomatic 17) Sources/CodeIsland/AppState.swift:4711 — AppState.routeDiscoveredSubsessionIfNeeded 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 · AppState.applyAiWorkStatsBackfill (cyclomatic 17) · ×1
  • AppState.applyAiWorkStatsBackfill (cyclomatic 17) Sources/CodeIsland/AppState+AiWorkWatch.swift:814 — AppState.applyAiWorkStatsBackfill 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 · AppState.maybeBackfillSubagentModel (cyclomatic 17) · ×1
  • AppState.maybeBackfillSubagentModel (cyclomatic 17) Sources/CodeIsland/AppState+SessionMetadata.swift:44 — AppState.maybeBackfillSubagentModel 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 · JSONMinimalEditor.skipSpace (cyclomatic 17) · ×1
  • JSONMinimalEditor.skipSpace (cyclomatic 17) Sources/CodeIsland/JSONMinimalEditor.swift:158 — JSONMinimalEditor.skipSpace has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: one other method here (JSONMinimalEditor.findNextNonSpace) 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 · JSONMinimalEditor.findNextNonSpace (cyclomatic 17) · ×1
  • JSONMinimalEditor.findNextNonSpace (cyclomatic 17) Sources/CodeIsland/JSONMinimalEditor.swift:271 — JSONMinimalEditor.findNextNonSpace has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: one other method here (JSONMinimalEditor.skipSpace) 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 · SessionInlineButton.label (cyclomatic 17) · ×1
  • SessionInlineButton.label (cyclomatic 17) Sources/CodeIsland/NotchPanelView.swift:4985 — SessionInlineButton.label 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 · CodexDiscovery.latestCodexTurnStatus (cyclomatic 17) · ×1
  • CodexDiscovery.latestCodexTurnStatus (cyclomatic 17) Sources/CodeIsland/Discovery/CodexDiscovery.swift:230 — CodexDiscovery.latestCodexTurnStatus 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 · FlatStoreDiscovery.readRecentFromCodeBuddyTranscript (cyclomatic 17) · ×1
  • FlatStoreDiscovery.readRecentFromCodeBuddyTranscript (cyclomatic 17) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:132 — FlatStoreDiscovery.readRecentFromCodeBuddyTranscript 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 · AiWorkStatusMapper.toolName (cyclomatic 17) · ×1
  • AiWorkStatusMapper.toolName (cyclomatic 17) Sources/CodeIslandCore/AiWorkWatchClient.swift:592 — AiWorkStatusMapper.toolName 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 · CodexThreadSubsession.link (cyclomatic 17) · ×1
  • CodexThreadSubsession.link (cyclomatic 17) Sources/CodeIslandCore/CodexThreadSubsession.swift:128 — CodexThreadSubsession.link 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 · codeisland-remote-hook.main (cyclomatic 17) · ×1
  • codeisland-remote-hook.main (cyclomatic 17) Sources/CodeIsland/Resources/codeisland-remote-hook.py:669 — codeisland-remote-hook.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 · ToolDetector.Detect (cyclomatic 16) · ×1
  • ToolDetector.Detect (cyclomatic 16) windows/CodeIsland.Hooks/ToolDetector.cs:17 — ToolDetector.Detect 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 · AppState.reconcileAiWorkLiveStatuses (cyclomatic 16) · ×1
  • AppState.reconcileAiWorkLiveStatuses (cyclomatic 16) Sources/CodeIsland/AppState+AiWorkWatch.swift:141 — AppState.reconcileAiWorkLiveStatuses 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 · AppState.applyAiWorkSessionMetadata (cyclomatic 16) · ×1
  • AppState.applyAiWorkSessionMetadata (cyclomatic 16) Sources/CodeIsland/AppState+AiWorkWatch.swift:630 — AppState.applyAiWorkSessionMetadata 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 · AppState.applyAiWorkListEntry (cyclomatic 16) · ×1
  • AppState.applyAiWorkListEntry (cyclomatic 16) Sources/CodeIsland/AppState+AiWorkWatch.swift:931 — AppState.applyAiWorkListEntry 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 · ConfigInstaller.isInstalled (cyclomatic 16) · ×1
  • ConfigInstaller.isInstalled (cyclomatic 16) Sources/CodeIsland/ConfigInstaller.swift:1191 — ConfigInstaller.isInstalled 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 · JSONMinimalEditor.skipValue (cyclomatic 16) · ×1
  • JSONMinimalEditor.skipValue (cyclomatic 16) Sources/CodeIsland/JSONMinimalEditor.swift:218 — JSONMinimalEditor.skipValue 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 · ClawdView.workCanvas (cyclomatic 16) · ×1
  • ClawdView.workCanvas (cyclomatic 16) Sources/CodeIsland/PixelCharacterView.swift:178 — ClawdView.workCanvas 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 · CodexDiscovery.inspectCodexSubagentMetadata (cyclomatic 16) · ×1
  • CodexDiscovery.inspectCodexSubagentMetadata (cyclomatic 16) Sources/CodeIsland/Discovery/CodexDiscovery.swift:643 — CodexDiscovery.inspectCodexSubagentMetadata 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 · CopilotDiscovery.copilotSessionMatchesCwd (cyclomatic 16) · ×1
  • CopilotDiscovery.copilotSessionMatchesCwd (cyclomatic 16) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:85 — CopilotDiscovery.copilotSessionMatchesCwd 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 · AgentTaskTranscript.claudeResultEvents (cyclomatic 16) · ×1
  • AgentTaskTranscript.claudeResultEvents (cyclomatic 16) Sources/CodeIslandCore/AgentTaskParsing.swift:353 — AgentTaskTranscript.claudeResultEvents 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 · ClaudeUsageScanner.scan (cyclomatic 16) · ×1
  • ClaudeUsageScanner.scan (cyclomatic 16) Sources/CodeIslandCore/ClaudeUsageScanner.swift:89 — ClaudeUsageScanner.scan 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 · SessionSnapshot.swift.deriveSessionSummary (cyclomatic 16) · ×1
  • SessionSnapshot.swift.deriveSessionSummary (cyclomatic 16) Sources/CodeIslandCore/SessionSnapshot.swift:1062 — SessionSnapshot.swift.deriveSessionSummary 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. This is NOT this file's highest cyclomatic complexity: SessionSnapshot.sourceLabel (cyclomatic 35) 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 · MainActivity.render (cyclomatic 16) · ×1
  • MainActivity.render (cyclomatic 16) android-watch/app/src/main/java/com/codeisland/buddywatch/MainActivity.kt:238 — MainActivity.render 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.
D2 · Cognitive Complexity · SessionSnapshot.swift.applyHookEvent (cognitive 241) · ×1
  • SessionSnapshot.swift.applyHookEvent (cognitive 241) Sources/CodeIslandCore/SessionSnapshot.swift:1229 — SessionSnapshot.swift.applyHookEvent has cognitive complexity 241 (threshold 15). Drivers by points: if/else 91 (175 pts), boolean chains 59, match/switch 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 88). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HookIntake.init (cognitive 108) · ×1
  • HookIntake.init (cognitive 108) Sources/CodeIslandCore/HookIntake.swift:225 — HookIntake.init has cognitive complexity 108 (threshold 15). Drivers by points: if/else 45 (69 pts), boolean chains 35, ternaries 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppState.integrateDiscovered (cognitive 107) · ×1
  • AppState.integrateDiscovered (cognitive 107) Sources/CodeIsland/AppState.swift:3568 — AppState.integrateDiscovered has cognitive complexity 107 (threshold 15). Drivers by points: if/else 36 (85 pts), boolean chains 17, ternaries 2 (4 pts), loops 1 (nesting depth added 51). 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 · codeisland-omp.codeislandExtension (cognitive 95) · ×1
  • codeisland-omp.codeislandExtension (cognitive 95) Sources/CodeIsland/Resources/codeisland-omp.ts:494 — codeisland-omp.codeislandExtension has cognitive complexity 95 (threshold 15). Drivers by points: if/else 41 (49 pts), ternaries 21 (30 pts), boolean chains 13, loops 2 (3 pts) (nesting depth added 18). Most of this is not in the body itself: 5 of the 95 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 656, formatSingleQuestionResponse, a function literal at line 1041, …). 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 · ConfigInstaller.verifyAndRepair (cognitive 93) · ×1
  • ConfigInstaller.verifyAndRepair (cognitive 93) Sources/CodeIsland/ConfigInstaller.swift:1402 — ConfigInstaller.verifyAndRepair has cognitive complexity 93 (threshold 15). Drivers by points: if/else 41 (83 pts), boolean chains 9, loops 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scanner.enablingHooks (cognitive 91) · ×1
  • Scanner.enablingHooks (cognitive 91) Sources/CodeIslandCore/CodexHooksConfig.swift:35 — Scanner.enablingHooks has cognitive complexity 91 (threshold 15). Drivers by points: if/else 26 (52 pts), boolean chains 21, ternaries 6 (16 pts), loops 2 (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 · Scanner.string (cognitive 90) · ×1
  • Scanner.string (cognitive 90) Sources/CodeIslandCore/CodexHooksConfig.swift:243 — Scanner.string has cognitive complexity 90 (threshold 15). Drivers by points: if/else 18 (58 pts), boolean chains 18, loops 3 (9 pts), ternaries 2 (5 pts) (nesting depth added 49). 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 · CodexPermissionRules.plainCommands (cognitive 85) · ×1
  • CodexPermissionRules.plainCommands (cognitive 85) Sources/CodeIsland/CodexPermissionRules.swift:756 — CodexPermissionRules.plainCommands has cognitive complexity 85 (threshold 15). Drivers by points: if/else 22 (57 pts), boolean chains 19, loops 2 (4 pts), ternaries 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 39). Of this number, 79 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionSnapshot.terminalName (cognitive 81) · ×1
  • SessionSnapshot.terminalName (cognitive 81) Sources/CodeIslandCore/SessionSnapshot.swift:961 — SessionSnapshot.terminalName has cognitive complexity 81 (threshold 15). Drivers by points: if/else 41 (76 pts), boolean chains 5 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionSnapshot.swift.extractMetadata (cognitive 78) · ×1
  • SessionSnapshot.swift.extractMetadata (cognitive 78) Sources/CodeIslandCore/SessionSnapshot.swift:2047 — SessionSnapshot.swift.extractMetadata has cognitive complexity 78 (threshold 15). Drivers by points: boolean chains 41, if/else 34 (35 pts), ternaries 1 (2 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 · HookEvent.toolDescription (cognitive 77) · ×1
  • HookEvent.toolDescription (cognitive 77) Sources/CodeIslandCore/Models.swift:469 — HookEvent.toolDescription has cognitive complexity 77 (threshold 15). Drivers by points: if/else 27 (71 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotchPanelView.body (cognitive 76) · ×1
  • NotchPanelView.body (cognitive 76) Sources/CodeIsland/NotchPanelView.swift:255 — NotchPanelView.body has cognitive complexity 76 (threshold 15). Drivers by points: if/else 32 (49 pts), ternaries 6 (11 pts), boolean chains 10, match/switch 3 (6 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONLTailer.quickTypeProbe (cognitive 74) · ×1
  • JSONLTailer.quickTypeProbe (cognitive 74) Sources/CodeIslandCore/JSONLTailer.swift:870 — JSONLTailer.quickTypeProbe has cognitive complexity 74 (threshold 15). Drivers by points: if/else 17 (55 pts), ternaries 1 (6 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 48). 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 · SessionSnapshot.swift.handleSubagentEvent (cognitive 72) · ×1
  • SessionSnapshot.swift.handleSubagentEvent (cognitive 72) Sources/CodeIslandCore/SessionSnapshot.swift:2343 — SessionSnapshot.swift.handleSubagentEvent has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (58 pts), boolean chains 13, match/switch 1 (nesting depth added 30). 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 · AppState.handleEvent (cognitive 71) · ×1
  • AppState.handleEvent (cognitive 71) Sources/CodeIsland/AppState.swift:1664 — AppState.handleEvent has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (39 pts), boolean chains 23, ternaries 3 (8 pts), 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 · AppState.applyCursorSubsessionModeToKnownSessions (cognitive 71) · ×1
  • AppState.applyCursorSubsessionModeToKnownSessions (cognitive 71) Sources/CodeIsland/AppState.swift:4001 — AppState.applyCursorSubsessionModeToKnownSessions has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (54 pts), boolean chains 11, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigInstaller.installExternalHooks (cognitive 66) · ×1
  • ConfigInstaller.installExternalHooks (cognitive 66) Sources/CodeIsland/ConfigInstaller.swift:1753 — ConfigInstaller.installExternalHooks has cognitive complexity 66 (threshold 15). Drivers by points: if/else 29 (43 pts), boolean chains 16, ternaries 2 (4 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HookIntake.addTerminalContext (cognitive 66) · ×1
  • HookIntake.addTerminalContext (cognitive 66) Sources/CodeIslandCore/HookIntake.swift:520 — HookIntake.addTerminalContext has cognitive complexity 66 (threshold 15). Drivers by points: if/else 29 (39 pts), boolean chains 27 (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 · KimiDiscovery.readRecentFromKimiTranscript (cognitive 64) · ×1
  • KimiDiscovery.readRecentFromKimiTranscript (cognitive 64) Sources/CodeIsland/Discovery/KimiDiscovery.swift:185 — KimiDiscovery.readRecentFromKimiTranscript has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (46 pts), boolean chains 12, match/switch 2 (5 pts), loops 1 (nesting depth added 28). Of this number, 55 points are the body's own statements and 9 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 · CodexDiscovery.discoverCodexSessions (cognitive 62) · ×1
  • CodexDiscovery.discoverCodexSessions (cognitive 62) Sources/CodeIsland/Discovery/CodexDiscovery.swift:462 — CodexDiscovery.discoverCodexSessions has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 4 (11 pts), boolean chains 7, match/switch 2 (6 pts), loops 3 (5 pts) (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 · codeisland-pi.codeislandExtension (cognitive 57) · ×1
  • codeisland-pi.codeislandExtension (cognitive 57) Sources/CodeIsland/Resources/codeisland-pi.ts:366 — codeisland-pi.codeislandExtension has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (30 pts), ternaries 14 (17 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 11). None of this is in the body itself: all 57 points belong to 14 function items inside it that branch (a function literal at line 635, a function literal at line 529, a function literal at line 470, …). 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 · AppState.cleanupIdleSessions (cognitive 56) · ×1
  • AppState.cleanupIdleSessions (cognitive 56) Sources/CodeIsland/AppState.swift:561 — AppState.cleanupIdleSessions has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 8 (9 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 23). Of this number, 55 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 · ConfigInstaller.normalizeTraecliHooksListIndentation (cognitive 55) · ×1
  • ConfigInstaller.normalizeTraecliHooksListIndentation (cognitive 55) Sources/CodeIsland/ConfigInstaller.swift:2014 — ConfigInstaller.normalizeTraecliHooksListIndentation has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (40 pts), boolean chains 9, loops 3 (6 pts) (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 · ClaudeDiscovery.readRecentFromTranscript (cognitive 51) · ×1
  • ClaudeDiscovery.readRecentFromTranscript (cognitive 51) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:274 — ClaudeDiscovery.readRecentFromTranscript has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 9, match/switch 1 (5 pts), ternaries 1 (4 pts), loops 3 (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 · SessionSnapshot.swift.applyEnvMetadata (cognitive 51) · ×1
  • SessionSnapshot.swift.applyEnvMetadata (cognitive 51) Sources/CodeIslandCore/SessionSnapshot.swift:1788 — SessionSnapshot.swift.applyEnvMetadata has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 32, if/else 18 (19 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 · TerminalActivator.activateTerminal (cognitive 49) · ×1
  • TerminalActivator.activateTerminal (cognitive 49) Sources/CodeIsland/TerminalActivator.swift:218 — TerminalActivator.activateTerminal has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (27 pts), boolean chains 22 (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 · SettingsWindow.RefreshLanguageFixed (cognitive 48) · ×1
  • SettingsWindow.RefreshLanguageFixed (cognitive 48) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:41 — SettingsWindow.RefreshLanguageFixed has cognitive complexity 48 (threshold 15). 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 · ConfigInstaller.install (cognitive 48) · ×1
  • ConfigInstaller.install (cognitive 48) Sources/CodeIsland/ConfigInstaller.swift:1067 — ConfigInstaller.install has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (42 pts), boolean chains 4, loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigInstaller.removeManagedTraecliHooksLegacy (cognitive 47) · ×1
  • ConfigInstaller.removeManagedTraecliHooksLegacy (cognitive 47) Sources/CodeIsland/ConfigInstaller.swift:2203 — ConfigInstaller.removeManagedTraecliHooksLegacy has cognitive complexity 47 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 5 (13 pts), boolean chains 7 (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 · CoworkSessionWatcher.process (cognitive 46) · ×1
  • CoworkSessionWatcher.process (cognitive 46) Sources/CodeIsland/CoworkSessionWatcher.swift:335 — CoworkSessionWatcher.process has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 13, ternaries 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeUsageScanner.scan (cognitive 46) · ×1
  • ClaudeUsageScanner.scan (cognitive 46) Sources/CodeIslandCore/ClaudeUsageScanner.swift:89 — ClaudeUsageScanner.scan has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (33 pts), loops 4 (10 pts), boolean chains 3 (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 · AppState.attachTranscriptTailerIfNeeded (cognitive 45) · ×1
  • AppState.attachTranscriptTailerIfNeeded (cognitive 45) Sources/CodeIsland/AppState+TranscriptTailer.swift:23 — AppState.attachTranscriptTailerIfNeeded has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 17, match/switch 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 · KimiDiscovery.findActiveKimiSessions (cognitive 43) · ×1
  • KimiDiscovery.findActiveKimiSessions (cognitive 43) Sources/CodeIsland/Discovery/KimiDiscovery.swift:14 — KimiDiscovery.findActiveKimiSessions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 9, loops 3 (6 pts), ternaries 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 · JSONLTailer.apply (cognitive 43) · ×1
  • JSONLTailer.apply (cognitive 43) Sources/CodeIslandCore/JSONLTailer.swift:537 — JSONLTailer.apply has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (34 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigInstaller.stripJSONComments (cognitive 42) · ×1
  • ConfigInstaller.stripJSONComments (cognitive 42) Sources/CodeIsland/ConfigInstaller.swift:1523 — ConfigInstaller.stripJSONComments has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 4 (12 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppState.applyCodexSubsessionModeToKnownSessions (cognitive 41) · ×1
  • AppState.applyCodexSubsessionModeToKnownSessions (cognitive 41) Sources/CodeIsland/AppState.swift:3873 — AppState.applyCodexSubsessionModeToKnownSessions has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 6, match/switch 1 (3 pts), loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppState.applyTranscriptDelta (cognitive 41) · ×1
  • AppState.applyTranscriptDelta (cognitive 41) Sources/CodeIsland/AppState+TranscriptTailer.swift:222 — AppState.applyTranscriptDelta has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 3, 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 · HookEvent.activityCategory (cognitive 41) · ×1
  • HookEvent.activityCategory (cognitive 41) Sources/CodeIslandCore/Models.swift:565 — HookEvent.activityCategory has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 32, 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.
D2 · Cognitive Complexity · codeisland-remote-hook._scan_session_jsonl (cognitive 40) · ×1
  • codeisland-remote-hook._scan_session_jsonl (cognitive 40) Sources/CodeIsland/Resources/codeisland-remote-hook.py:162 — codeisland-remote-hook._scan_session_jsonl has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 8, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppState.answerQuestionMulti (cognitive 39) · ×1
  • AppState.answerQuestionMulti (cognitive 39) Sources/CodeIsland/AppState.swift:2855 — AppState.answerQuestionMulti has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 22). 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 · PushResponseInterpreter.interpret (cognitive 39) · ×1
  • PushResponseInterpreter.interpret (cognitive 39) Sources/CodeIslandCore/PushChannel.swift:690 — PushResponseInterpreter.interpret has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 6 (12 pts), boolean chains 8, match/switch 1 (nesting depth added 15). Of this number, 37 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppState.separateMergedCodexSubagents (cognitive 38) · ×1
  • AppState.separateMergedCodexSubagents (cognitive 38) Sources/CodeIsland/AppState.swift:4492 — AppState.separateMergedCodexSubagents has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (26 pts), ternaries 2 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigInstaller.setEnabled (cognitive 38) · ×1
  • ConfigInstaller.setEnabled (cognitive 38) Sources/CodeIsland/ConfigInstaller.swift:1337 — ConfigInstaller.setEnabled has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 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 · CodexDiscovery.readRecentFromCodexTranscript (cognitive 37) · ×1
  • CodexDiscovery.readRecentFromCodexTranscript (cognitive 37) Sources/CodeIsland/Discovery/CodexDiscovery.swift:909 — CodexDiscovery.readRecentFromCodexTranscript has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 18, if/else 8 (16 pts), loops 3 (nesting depth added 8). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AppState.applyCoworkUpdate (cognitive 35) · ×1
  • AppState.applyCoworkUpdate (cognitive 35) Sources/CodeIsland/AppState+CoworkWatch.swift:239 — AppState.applyCoworkUpdate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 12, ternaries 5 (8 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 · ConfigInstaller.uninstallHooks (cognitive 35) · ×1
  • ConfigInstaller.uninstallHooks (cognitive 35) Sources/CodeIsland/ConfigInstaller.swift:3133 — ConfigInstaller.uninstallHooks has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (8 pts), boolean chains 6 (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 · HookServer.processRequest (cognitive 35) · ×1
  • HookServer.processRequest (cognitive 35) Sources/CodeIsland/HookServer.swift:534 — HookServer.processRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 7, match/switch 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 · TerminalVisibilityDetector.liveIsSessionTabVisible (cognitive 34) · ×1
  • TerminalVisibilityDetector.liveIsSessionTabVisible (cognitive 34) Sources/CodeIsland/TerminalVisibilityDetector.swift:147 — TerminalVisibilityDetector.liveIsSessionTabVisible has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 5, match/switch 1 (2 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 · NotchPanelView.swift.stripDirectives (cognitive 34) · ×1
  • NotchPanelView.swift.stripDirectives (cognitive 34) Sources/CodeIsland/NotchPanelView.swift:5829 — NotchPanelView.swift.stripDirectives has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (7 pts), boolean chains 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 · SessionSnapshot.swift.fillMissingParentMetadataFromSubagentEvent (cognitive 34) · ×1
  • SessionSnapshot.swift.fillMissingParentMetadataFromSubagentEvent (cognitive 34) Sources/CodeIslandCore/SessionSnapshot.swift:1863 — SessionSnapshot.swift.fillMissingParentMetadataFromSubagentEvent has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 19, if/else 12 (15 pts) (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 · CompanionDisplayText.stripDirectives (cognitive 34) · ×1
  • CompanionDisplayText.stripDirectives (cognitive 34) ios/CodeIslandCompanion/Shared/CompanionDisplayText.swift:171 — CompanionDisplayText.stripDirectives has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (7 pts), boolean chains 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 · ApprovalCopy.action (cognitive 33) · ×1
  • ApprovalCopy.action (cognitive 33) Sources/CodeIsland/NotchPanelView.swift:1637 — ApprovalCopy.action has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 26, if/else 7. 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 · CodexDiscovery.recentCodexDesktopThreadRecords (cognitive 33) · ×1
  • CodexDiscovery.recentCodexDesktopThreadRecords (cognitive 33) Sources/CodeIsland/Discovery/CodexDiscovery.swift:308 — CodexDiscovery.recentCodexDesktopThreadRecords has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 6, ternaries 4 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexDiscovery.codexSpawnEdgeRecords (cognitive 33) · ×1
  • CodexDiscovery.codexSpawnEdgeRecords (cognitive 33) Sources/CodeIsland/Discovery/CodexDiscovery.swift:726 — CodexDiscovery.codexSpawnEdgeRecords has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, loops 4 (7 pts), ternaries 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 · SettingsWindow.RefreshLanguageChinese (cognitive 32) · ×1
  • SettingsWindow.RefreshLanguageChinese (cognitive 32) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:63 — SettingsWindow.RefreshLanguageChinese has cognitive complexity 32 (threshold 15). 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 · AppState.applyCodexRequestUserInput (cognitive 32) · ×1
  • AppState.applyCodexRequestUserInput (cognitive 32) Sources/CodeIsland/AppState+CodexAppServer.swift:273 — AppState.applyCodexRequestUserInput has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (7 pts), ternaries 2 (4 pts), boolean chains 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 · ApprovalToolDetailView.body (cognitive 32) · ×1
  • ApprovalToolDetailView.body (cognitive 32) Sources/CodeIsland/NotchPanelView.swift:1399 — ApprovalToolDetailView.body has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 2, match/switch 1 (nesting depth added 14). 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 · Scanner.withoutAppendedFeaturesTable (cognitive 32) · ×1
  • Scanner.withoutAppendedFeaturesTable (cognitive 32) Sources/CodeIslandCore/CodexHooksConfig.swift:131 — Scanner.withoutAppendedFeaturesTable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 9, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scanner.statements (cognitive 32) · ×1
  • Scanner.statements (cognitive 32) Sources/CodeIslandCore/CodexHooksConfig.swift:185 — Scanner.statements has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownInlineLiterals.escapingWordDelimiters (cognitive 32) · ×1
  • MarkdownInlineLiterals.escapingWordDelimiters (cognitive 32) Sources/CodeIslandCore/MarkdownInlineLiterals.swift:23 — MarkdownInlineLiterals.escapingWordDelimiters has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (10 pts), loops 4 (10 pts), match/switch 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 · ConfigInstaller.removeManagedTraecliHooks (cognitive 31) · ×1
  • ConfigInstaller.removeManagedTraecliHooks (cognitive 31) Sources/CodeIsland/ConfigInstaller.swift:2289 — ConfigInstaller.removeManagedTraecliHooks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TerminalActivator.activateGhostty (cognitive 31) · ×1
  • TerminalActivator.activateGhostty (cognitive 31) Sources/CodeIsland/TerminalActivator.swift:456 — TerminalActivator.activateGhostty has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 10). Of this number, 29 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexDiscovery.latestCodexTurnStatus (cognitive 31) · ×1
  • CodexDiscovery.latestCodexTurnStatus (cognitive 31) Sources/CodeIsland/Discovery/CodexDiscovery.swift:230 — CodexDiscovery.latestCodexTurnStatus has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenCodeDiscovery.readRecentFromOpenCodeSession (cognitive 31) · ×1
  • OpenCodeDiscovery.readRecentFromOpenCodeSession (cognitive 31) Sources/CodeIsland/Discovery/OpenCodeDiscovery.swift:150 — OpenCodeDiscovery.readRecentFromOpenCodeSession has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 13, 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 · codeisland-remote-hook._scan_hermes_store (cognitive 31) · ×1
  • codeisland-remote-hook._scan_hermes_store (cognitive 31) Sources/CodeIsland/Resources/codeisland-remote-hook.py:373 — codeisland-remote-hook._scan_hermes_store has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (8 pts), boolean chains 2, error handling 2, loops 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 · AppDelegate.applicationDidFinishLaunching (cognitive 30) · ×1
  • AppDelegate.applicationDidFinishLaunching (cognitive 30) Sources/CodeIsland/AppDelegate.swift:22 — AppDelegate.applicationDidFinishLaunching has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24 (27 pts), ternaries 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AppState.restoreSessions (cognitive 30) · ×1
  • AppState.restoreSessions (cognitive 30) Sources/CodeIsland/AppState.swift:3360 — AppState.restoreSessions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 7, 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 · SettingsWindow.RefreshLanguage (cognitive 29) · ×1
  • SettingsWindow.RefreshLanguage (cognitive 29) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:72 — SettingsWindow.RefreshLanguage has cognitive complexity 29 (threshold 15). 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 · AppState.tryMonitorSession (cognitive 29) · ×1
  • AppState.tryMonitorSession (cognitive 29) Sources/CodeIsland/AppState.swift:1116 — AppState.tryMonitorSession has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 8 (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 · AppState.showNextPending (cognitive 29) · ×1
  • AppState.showNextPending (cognitive 29) Sources/CodeIsland/AppState.swift:3205 — AppState.showNextPending has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (23 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 · AppState.handleAiWorkStreamEvent (cognitive 29) · ×1
  • AppState.handleAiWorkStreamEvent (cognitive 29) Sources/CodeIsland/AppState+AiWorkWatch.swift:324 — AppState.handleAiWorkStreamEvent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 13, match/switch 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AppState.applyAiWorkStreamEvent (cognitive 29) · ×1
  • AppState.applyAiWorkStreamEvent (cognitive 29) Sources/CodeIsland/AppState+AiWorkWatch.swift:455 — AppState.applyAiWorkStreamEvent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 2 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 14). 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 · CLIProcessResolver.sourceMatchesExecutablePath (cognitive 29) · ×1
  • CLIProcessResolver.sourceMatchesExecutablePath (cognitive 29) Sources/CodeIslandCore/Models.swift:62 — CLIProcessResolver.sourceMatchesExecutablePath has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 26, if/else 2, match/switch 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 · index.register (cognitive 29) · ×1
  • index.register (cognitive 29) Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:309 — index.register has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 8, ternaries 5 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 431, a function literal at line 402, onAgentRunStart, …). 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 · AppState.backfillClaudeTerminalMetadata (cognitive 28) · ×1
  • AppState.backfillClaudeTerminalMetadata (cognitive 28) Sources/CodeIsland/AppState+ClaudeTerminalMetadata.swift:9 — AppState.backfillClaudeTerminalMetadata has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 23, if/else 5. Of this number, 25 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ClaudeLogoShape.parseSVGPath (cognitive 28) · ×1
  • ClaudeLogoShape.parseSVGPath (cognitive 28) Sources/CodeIsland/NotchPanelView.swift:5054 — ClaudeLogoShape.parseSVGPath has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7, loops 3, match/switch 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (num, skipWS, peekNum). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ScreenDetector.frontmostApplicationWindowBounds (cognitive 28) · ×1
  • ScreenDetector.frontmostApplicationWindowBounds (cognitive 28) Sources/CodeIsland/ScreenDetector.swift:216 — ScreenDetector.frontmostApplicationWindowBounds has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (11 pts), loops 2, ternaries 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 · CopilotDiscovery.readRecentFromCopilotTranscript (cognitive 28) · ×1
  • CopilotDiscovery.readRecentFromCopilotTranscript (cognitive 28) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:113 — CopilotDiscovery.readRecentFromCopilotTranscript has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 11, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp (cognitive 28) · ×1
  • FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp (cognitive 28) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:192 — FlatStoreDiscovery.qoderLatestTerminalTurnTimestamp has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 11, 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 · main.swift.top-level code (cognitive 28) · ×1
  • main.swift.top-level code (cognitive 28) Sources/CodeIslandBridge/main.swift:28 — main.swift.top-level code has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 6, 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 · PushMessageFormatter.lines (cognitive 28) · ×1
  • PushMessageFormatter.lines (cognitive 28) Sources/CodeIslandCore/PushNotification.swift:297 — PushMessageFormatter.lines has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 4 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 14). 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 · SessionSnapshot.applyHermesStore (cognitive 28) · ×1
  • SessionSnapshot.applyHermesStore (cognitive 28) Sources/CodeIslandCore/HermesSessionStore.swift:239 — SessionSnapshot.applyHermesStore has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, 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 · AppState.handleAskUserQuestion (cognitive 27) · ×1
  • AppState.handleAskUserQuestion (cognitive 27) Sources/CodeIsland/AppState.swift:2630 — AppState.handleAskUserQuestion has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 1 (3 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 · KimiDiscovery.discoverKimiCodeSessionFromIndex (cognitive 27) · ×1
  • KimiDiscovery.discoverKimiCodeSessionFromIndex (cognitive 27) Sources/CodeIsland/Discovery/KimiDiscovery.swift:98 — KimiDiscovery.discoverKimiCodeSessionFromIndex has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 10, ternaries 2 (3 pts), 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 · ProcArgsParser.completeEnvironment (cognitive 27) · ×1
  • ProcArgsParser.completeEnvironment (cognitive 27) Sources/CodeIslandCore/HostHarness.swift:361 — ProcArgsParser.completeEnvironment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5, boolean chains 4, match/switch 1 (2 pts), ternaries 1 (nesting depth added 8). Of this number, 23 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONMinimalEditor.skipSpace (cognitive 26) · ×1
  • JSONMinimalEditor.skipSpace (cognitive 26) Sources/CodeIsland/JSONMinimalEditor.swift:158 — JSONMinimalEditor.skipSpace has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 9, loops 3 (7 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. This shape REPEATS in the file: one other method here (JSONMinimalEditor.findNextNonSpace) 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 · JSONMinimalEditor.findNextNonSpace (cognitive 26) · ×1
  • JSONMinimalEditor.findNextNonSpace (cognitive 26) Sources/CodeIsland/JSONMinimalEditor.swift:271 — JSONMinimalEditor.findNextNonSpace has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 9, loops 3 (7 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. This shape REPEATS in the file: one other method here (JSONMinimalEditor.skipSpace) 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 · SessionListView.groupedSessions (cognitive 26) · ×1
  • SessionListView.groupedSessions (cognitive 26) Sources/CodeIsland/NotchPanelView.swift:2987 — SessionListView.groupedSessions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts), 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 · TerminalVisibilityDetector.isKittyWindowActive (cognitive 26) · ×1
  • TerminalVisibilityDetector.isKittyWindowActive (cognitive 26) Sources/CodeIsland/TerminalVisibilityDetector.swift:486 — TerminalVisibilityDetector.isKittyWindowActive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentTaskList.apply (cognitive 26) · ×1
  • AgentTaskList.apply (cognitive 26) Sources/CodeIslandCore/AgentTaskList.swift:333 — AgentTaskList.apply has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 6, ternaries 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoworkAuditParser.event (cognitive 26) · ×1
  • CoworkAuditParser.event (cognitive 26) Sources/CodeIslandCore/CoworkAuditLog.swift:56 — CoworkAuditParser.event has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 8, match/switch 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 · AppState.applyAiWorkStatsBackfill (cognitive 25) · ×1
  • AppState.applyAiWorkStatsBackfill (cognitive 25) Sources/CodeIsland/AppState+AiWorkWatch.swift:814 — AppState.applyAiWorkStatsBackfill has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TerminalActivator.activate (cognitive 25) · ×1
  • TerminalActivator.activate (cognitive 25) Sources/CodeIsland/TerminalActivator.swift:113 — TerminalActivator.activate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 6 (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 · HookEvent.codexToolDescription (cognitive 25) · ×1
  • HookEvent.codexToolDescription (cognitive 25) Sources/CodeIslandCore/Models.swift:630 — HookEvent.codexToolDescription has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (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 · AppState.separateMergedCursorSubagents (cognitive 24) · ×1
  • AppState.separateMergedCursorSubagents (cognitive 24) Sources/CodeIsland/AppState.swift:4607 — AppState.separateMergedCursorSubagents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (3 pts), boolean chains 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 · FollowUpReminderController.tick (cognitive 24) · ×1
  • FollowUpReminderController.tick (cognitive 24) Sources/CodeIsland/FollowUpReminderController.swift:230 — FollowUpReminderController.tick has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONMinimalEditor.skipObjectOrArray (cognitive 24) · ×1
  • JSONMinimalEditor.skipObjectOrArray (cognitive 24) Sources/CodeIsland/JSONMinimalEditor.swift:245 — JSONMinimalEditor.skipObjectOrArray has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 9, 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 · SessionListView.body (cognitive 24) · ×1
  • SessionListView.body (cognitive 24) Sources/CodeIsland/NotchPanelView.swift:3039 — SessionListView.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 6 (9 pts), boolean chains 2 (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 · SessionInlineButton.label (cognitive 24) · ×1
  • SessionInlineButton.label (cognitive 24) Sources/CodeIsland/NotchPanelView.swift:4985 — SessionInlineButton.label has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 1, match/switch 1 (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 · HooksPage.body (cognitive 24) · ×1
  • HooksPage.body (cognitive 24) Sources/CodeIsland/SettingsView.swift:827 — HooksPage.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 4 (8 pts), loops 2 (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 · ESP32StatePublisher.flush (cognitive 23) · ×1
  • ESP32StatePublisher.flush (cognitive 23) Sources/CodeIsland/ESP32StatePublisher.swift:87 — ESP32StatePublisher.flush has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8 (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 · JSONMinimalEditor.readStringLiteral (cognitive 23) · ×1
  • JSONMinimalEditor.readStringLiteral (cognitive 23) Sources/CodeIsland/JSONMinimalEditor.swift:180 — JSONMinimalEditor.readStringLiteral has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentTaskTranscript.claudeResultEvents (cognitive 23) · ×1
  • AgentTaskTranscript.claudeResultEvents (cognitive 23) Sources/CodeIslandCore/AgentTaskParsing.swift:353 — AgentTaskTranscript.claudeResultEvents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AttentionPolicy.intents (cognitive 23) · ×1
  • AttentionPolicy.intents (cognitive 23) Sources/CodeIslandCore/AttentionPolicy.swift:27 — AttentionPolicy.intents has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (11 pts), match/switch 4 (8 pts), if/else 2 (4 pts) (nesting depth added 12). 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 · ProcArgsParser.parse (cognitive 23) · ×1
  • ProcArgsParser.parse (cognitive 23) Sources/CodeIslandCore/HostHarness.swift:313 — ProcArgsParser.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (6 pts), boolean chains 5 (nesting depth added 6). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownBlockParser.listMarker (cognitive 23) · ×1
  • MarkdownBlockParser.listMarker (cognitive 23) Sources/CodeIslandCore/MarkdownBlockParser.swift:379 — MarkdownBlockParser.listMarker has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (7 pts), loops 1 (2 pts), ternaries 1 (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 · JSONMinimalEditor.parseTopLevelObject (cognitive 22) · ×1
  • JSONMinimalEditor.parseTopLevelObject (cognitive 22) Sources/CodeIsland/JSONMinimalEditor.swift:105 — JSONMinimalEditor.parseTopLevelObject has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, 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 · MenuBarIconAvoidance.occupiedMenuBarRanges (cognitive 22) · ×1
  • MenuBarIconAvoidance.occupiedMenuBarRanges (cognitive 22) Sources/CodeIsland/MenuBarIconAvoidance.swift:24 — MenuBarIconAvoidance.occupiedMenuBarRanges has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (10 pts), loops 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 · TerminalActivator.activateWeztermFamily (cognitive 22) · ×1
  • TerminalActivator.activateWeztermFamily (cognitive 22) Sources/CodeIsland/TerminalActivator.swift:959 — TerminalActivator.activateWeztermFamily has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuddyMascotView.drawAlert (cognitive 22) · ×1
  • BuddyMascotView.drawAlert (cognitive 22) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:125 — BuddyMascotView.drawAlert has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, match/switch 1 (nesting depth added 6). 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 · codeisland-remote-hook._scan_codex_jsonl (cognitive 22) · ×1
  • codeisland-remote-hook._scan_codex_jsonl (cognitive 22) Sources/CodeIsland/Resources/codeisland-remote-hook.py:268 — codeisland-remote-hook._scan_codex_jsonl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, error handling 2 (3 pts), 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 · ToolDetector.Detect (cognitive 21) · ×1
  • ToolDetector.Detect (cognitive 21) windows/CodeIsland.Hooks/ToolDetector.cs:17 — ToolDetector.Detect has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · AppState.applyAiWorkListBackfill (cognitive 21) · ×1
  • AppState.applyAiWorkListBackfill (cognitive 21) Sources/CodeIsland/AppState+AiWorkWatch.swift:868 — AppState.applyAiWorkListBackfill has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, 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 · AppState.performCardShortcut (cognitive 21) · ×1
  • AppState.performCardShortcut (cognitive 21) Sources/CodeIsland/AppState+CardShortcuts.swift:26 — AppState.performCardShortcut has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 10). 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 · CodexPermissionRules.repairingOrphanedMCPToolTables (cognitive 21) · ×1
  • CodexPermissionRules.repairingOrphanedMCPToolTables (cognitive 21) Sources/CodeIsland/CodexPermissionRules.swift:413 — CodexPermissionRules.repairingOrphanedMCPToolTables has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), loops 4 (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 · CodexTmuxRouting.resolve (cognitive 21) · ×1
  • CodexTmuxRouting.resolve (cognitive 21) Sources/CodeIsland/CodexTmuxRouting.swift:97 — CodexTmuxRouting.resolve has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (7 pts), loops 1, ternaries 1 (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 · ConfigInstaller.trySurgicalMergeTraecliHooks (cognitive 21) · ×1
  • ConfigInstaller.trySurgicalMergeTraecliHooks (cognitive 21) Sources/CodeIsland/ConfigInstaller.swift:2383 — ConfigInstaller.trySurgicalMergeTraecliHooks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1 (2 pts), 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 · JSONMinimalEditor.deleteTopLevelKey (cognitive 21) · ×1
  • JSONMinimalEditor.deleteTopLevelKey (cognitive 21) Sources/CodeIsland/JSONMinimalEditor.swift:42 — JSONMinimalEditor.deleteTopLevelKey has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactRightWing.body (cognitive 21) · ×1
  • CompactRightWing.body (cognitive 21) Sources/CodeIsland/NotchPanelView.swift:817 — CompactRightWing.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownBlockParser.parseBlocks (cognitive 21) · ×1
  • MarkdownBlockParser.parseBlocks (cognitive 21) Sources/CodeIslandCore/MarkdownBlockParser.swift:124 — MarkdownBlockParser.parseBlocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (nesting depth added 8). Of this number, 20 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 · WarpPaneResolver.performQuery (cognitive 21) · ×1
  • WarpPaneResolver.performQuery (cognitive 21) Sources/CodeIslandCore/WarpPaneResolver.swift:116 — WarpPaneResolver.performQuery has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (4 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 · codeisland-remote-hook.main (cognitive 21) · ×1
  • codeisland-remote-hook.main (cognitive 21) Sources/CodeIsland/Resources/codeisland-remote-hook.py:669 — codeisland-remote-hook.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexPermissionRules.latestTurnContextPayload (cognitive 20) · ×1
  • CodexPermissionRules.latestTurnContextPayload (cognitive 20) Sources/CodeIsland/CodexPermissionRules.swift:123 — CodexPermissionRules.latestTurnContextPayload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (5 pts), boolean chains 2, 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 · CodexPermissionRules.tomlTableSegments (cognitive 20) · ×1
  • CodexPermissionRules.tomlTableSegments (cognitive 20) Sources/CodeIsland/CodexPermissionRules.swift:686 — CodexPermissionRules.tomlTableSegments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 4). Of this number, 19 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 · ConfigInstaller.cliExists (cognitive 20) · ×1
  • ConfigInstaller.cliExists (cognitive 20) Sources/CodeIsland/ConfigInstaller.swift:1215 — ConfigInstaller.cliExists has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (18 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 · ConfigInstaller.removeManagedHermesHooks (cognitive 20) · ×1
  • ConfigInstaller.removeManagedHermesHooks (cognitive 20) Sources/CodeIsland/ConfigInstaller.swift:2540 — ConfigInstaller.removeManagedHermesHooks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PanelWindowController.setupHorizontalDragMonitor (cognitive 20) · ×1
  • PanelWindowController.setupHorizontalDragMonitor (cognitive 20) Sources/CodeIsland/PanelWindowController.swift:619 — PanelWindowController.setupHorizontalDragMonitor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, match/switch 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 · TerminalActivator.bringToFront (cognitive 20) · ×1
  • TerminalActivator.bringToFront (cognitive 20) Sources/CodeIsland/TerminalActivator.swift:1451 — TerminalActivator.bringToFront has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 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 · TerminalVisibilityDetector.isGhosttySessionVisibleInAnyWindow (cognitive 20) · ×1
  • TerminalVisibilityDetector.isGhosttySessionVisibleInAnyWindow (cognitive 20) Sources/CodeIsland/TerminalVisibilityDetector.swift:259 — TerminalVisibilityDetector.isGhosttySessionVisibleInAnyWindow has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, 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.
D2 · Cognitive Complexity · GrokDiscovery.grokDirectorySessionCandidates (cognitive 20) · ×1
  • GrokDiscovery.grokDirectorySessionCandidates (cognitive 20) Sources/CodeIsland/Discovery/GrokDiscovery.swift:229 — GrokDiscovery.grokDirectorySessionCandidates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AiWorkStatusMapper.toolName (cognitive 20) · ×1
  • AiWorkStatusMapper.toolName (cognitive 20) Sources/CodeIslandCore/AiWorkWatchClient.swift:592 — AiWorkStatusMapper.toolName 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 · AiWorkStatusMapper.toolDescription (cognitive 20) · ×1
  • AiWorkStatusMapper.toolDescription (cognitive 20) Sources/CodeIslandCore/AiWorkWatchClient.swift:613 — AiWorkStatusMapper.toolDescription has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5 (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 · ClaudeQuotaSnapshot.parse (cognitive 20) · ×1
  • ClaudeQuotaSnapshot.parse (cognitive 20) Sources/CodeIslandCore/ClaudeQuota.swift:150 — ClaudeQuotaSnapshot.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONLTailer.extractText (cognitive 20) · ×1
  • JSONLTailer.extractText (cognitive 20) Sources/CodeIslandCore/JSONLTailer.swift:1055 — JSONLTailer.extractText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionSnapshot.normalizedSupportedSource (cognitive 20) · ×1
  • SessionSnapshot.normalizedSupportedSource (cognitive 20) Sources/CodeIslandCore/SessionSnapshot.swift:318 — SessionSnapshot.normalizedSupportedSource has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 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 · SubsessionRouter.placement (cognitive 20) · ×1
  • SubsessionRouter.placement (cognitive 20) Sources/CodeIslandCore/SubsessionRouter.swift:102 — SubsessionRouter.placement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 1 (2 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 · codeisland-remote-hook._extract_text (cognitive 20) · ×1
  • codeisland-remote-hook._extract_text (cognitive 20) Sources/CodeIsland/Resources/codeisland-remote-hook.py:139 — codeisland-remote-hook._extract_text has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppState.maybeBackfillSubagentModel (cognitive 19) · ×1
  • AppState.maybeBackfillSubagentModel (cognitive 19) Sources/CodeIsland/AppState+SessionMetadata.swift:44 — AppState.maybeBackfillSubagentModel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 1 (2 pts), match/switch 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 · QuestionBar.multiQuestionContent (cognitive 19) · ×1
  • QuestionBar.multiQuestionContent (cognitive 19) Sources/CodeIsland/NotchPanelView.swift:2618 — QuestionBar.multiQuestionContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PushNotifier.decide (cognitive 19) · ×1
  • PushNotifier.decide (cognitive 19) Sources/CodeIsland/PushNotifier.swift:298 — PushNotifier.decide has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, loops 1, ternaries 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 · FlatStoreDiscovery.readRecentFromCodeBuddyTranscript (cognitive 19) · ×1
  • FlatStoreDiscovery.readRecentFromCodeBuddyTranscript (cognitive 19) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:132 — FlatStoreDiscovery.readRecentFromCodeBuddyTranscript has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 3 (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 · FlatStoreDiscovery.codeBuddyLatestTerminalTurnTimestamp (cognitive 19) · ×1
  • FlatStoreDiscovery.codeBuddyLatestTerminalTurnTimestamp (cognitive 19) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:227 — FlatStoreDiscovery.codeBuddyLatestTerminalTurnTimestamp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionSnapshot.swift.deriveSessionSummary (cognitive 19) · ×1
  • SessionSnapshot.swift.deriveSessionSummary (cognitive 19) Sources/CodeIslandCore/SessionSnapshot.swift:1062 — SessionSnapshot.swift.deriveSessionSummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuddyMascotView.drawClaudeWork (cognitive 19) · ×1
  • BuddyMascotView.drawClaudeWork (cognitive 19) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:203 — BuddyMascotView.drawClaudeWork has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AppState.routeDiscoveredSubsessionIfNeeded (cognitive 18) · ×1
  • AppState.routeDiscoveredSubsessionIfNeeded (cognitive 18) Sources/CodeIsland/AppState.swift:4711 — AppState.routeDiscoveredSubsessionIfNeeded has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7 (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 · AppState.reconcileAiWorkLiveStatuses (cognitive 18) · ×1
  • AppState.reconcileAiWorkLiveStatuses (cognitive 18) Sources/CodeIsland/AppState+AiWorkWatch.swift:141 — AppState.reconcileAiWorkLiveStatuses has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4, boolean chains 2, ternaries 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 · CodexPermissionRules.configEnablesAutoReview (cognitive 18) · ×1
  • CodexPermissionRules.configEnablesAutoReview (cognitive 18) Sources/CodeIsland/CodexPermissionRules.swift:196 — CodexPermissionRules.configEnablesAutoReview has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 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 · ESP32BridgeManager.peripheral (cognitive 18) · ×1
  • ESP32BridgeManager.peripheral (cognitive 18) Sources/CodeIsland/ESP32BridgeManager.swift:959 — ESP32BridgeManager.peripheral has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, match/switch 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 · HookConnection.readAvailable (cognitive 18) · ×1
  • HookConnection.readAvailable (cognitive 18) Sources/CodeIsland/HookSocket.swift:662 — HookConnection.readAvailable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostHarnessSupport.lookupT3ThreadId (cognitive 18) · ×1
  • HostHarnessSupport.lookupT3ThreadId (cognitive 18) Sources/CodeIsland/HostHarnessSupport.swift:137 — HostHarnessSupport.lookupT3ThreadId has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClawdView.workCanvas (cognitive 18) · ×1
  • ClawdView.workCanvas (cognitive 18) Sources/CodeIsland/PixelCharacterView.swift:178 — ClawdView.workCanvas has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 5, loops 3 (4 pts), if/else 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CopilotDiscovery.copilotSessionMatchesCwd (cognitive 18) · ×1
  • CopilotDiscovery.copilotSessionMatchesCwd (cognitive 18) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:85 — CopilotDiscovery.copilotSessionMatchesCwd has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (8 pts), loops 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 · GeminiDiscovery.findActiveGeminiSessions (cognitive 18) · ×1
  • GeminiDiscovery.findActiveGeminiSessions (cognitive 18) Sources/CodeIsland/Discovery/GeminiDiscovery.swift:27 — GeminiDiscovery.findActiveGeminiSessions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentTaskTool.resultEvents (cognitive 18) · ×1
  • AgentTaskTool.resultEvents (cognitive 18) Sources/CodeIslandCore/AgentTaskParsing.swift:72 — AgentTaskTool.resultEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 8). 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 · CoworkAuditState.apply (cognitive 18) · ×1
  • CoworkAuditState.apply (cognitive 18) Sources/CodeIslandCore/CoworkAuditLog.swift:268 — CoworkAuditState.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, match/switch 1 (nesting depth added 6). 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 · ModelObservation.latestCodexTurnContext (cognitive 18) · ×1
  • ModelObservation.latestCodexTurnContext (cognitive 18) Sources/CodeIslandCore/ModelLabel.swift:65 — ModelObservation.latestCodexTurnContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 2 (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 · SettingsWindow.RefreshAllLanguage (cognitive 17) · ×1
  • SettingsWindow.RefreshAllLanguage (cognitive 17) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:108 — SettingsWindow.RefreshAllLanguage has cognitive complexity 17 (threshold 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 · AppState.resolveMergedSubagentAfterUI (cognitive 17) · ×1
  • AppState.resolveMergedSubagentAfterUI (cognitive 17) Sources/CodeIsland/AppState.swift:4211 — AppState.resolveMergedSubagentAfterUI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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 · AppState.applyCoworkAuditState (cognitive 17) · ×1
  • AppState.applyCoworkAuditState (cognitive 17) Sources/CodeIsland/AppState+CoworkWatch.swift:349 — AppState.applyCoworkAuditState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (6 pts), boolean chains 2, match/switch 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 · AppState.esp32DisplayContext (cognitive 17) · ×1
  • AppState.esp32DisplayContext (cognitive 17) Sources/CodeIsland/ESP32StatePublisher.swift:216 — AppState.esp32DisplayContext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigInstaller.removeKimiHooks (cognitive 17) · ×1
  • ConfigInstaller.removeKimiHooks (cognitive 17) Sources/CodeIsland/ConfigInstaller.swift:3030 — ConfigInstaller.removeKimiHooks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONMinimalEditor.skipValue (cognitive 17) · ×1
  • JSONMinimalEditor.skipValue (cognitive 17) Sources/CodeIsland/JSONMinimalEditor.swift:218 — JSONMinimalEditor.skipValue has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), loops 2 (4 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 · AgentProcessFinder.findCodexProcesses (cognitive 17) · ×1
  • AgentProcessFinder.findCodexProcesses (cognitive 17) Sources/CodeIsland/Discovery/AgentProcessFinder.swift:692 — AgentProcessFinder.findCodexProcesses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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 · AgentTaskList.applyCreated (cognitive 17) · ×1
  • AgentTaskList.applyCreated (cognitive 17) Sources/CodeIslandCore/AgentTaskList.swift:493 — AgentTaskList.applyCreated has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentTaskTool.callEvents (cognitive 17) · ×1
  • AgentTaskTool.callEvents (cognitive 17) Sources/CodeIslandCore/AgentTaskParsing.swift:38 — AgentTaskTool.callEvents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 8). 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 · Scanner.key (cognitive 17) · ×1
  • Scanner.key (cognitive 17) Sources/CodeIslandCore/CodexHooksConfig.swift:220 — Scanner.key has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 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 · CodexThreadSubsession.link (cognitive 17) · ×1
  • CodexThreadSubsession.link (cognitive 17) Sources/CodeIslandCore/CodexThreadSubsession.swift:128 — CodexThreadSubsession.link has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 7. 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 · MarkdownPreviewText.previewSource (cognitive 17) · ×1
  • MarkdownPreviewText.previewSource (cognitive 17) Sources/CodeIslandCore/MarkdownPreviewText.swift:43 — MarkdownPreviewText.previewSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (2 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 · PrivateFiles.write (cognitive 17) · ×1
  • PrivateFiles.write (cognitive 17) Sources/CodeIslandCore/PrivateFiles.swift:60 — PrivateFiles.write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 1 (2 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 · codeisland-remote-hook._codex_public_text (cognitive 17) · ×1
  • codeisland-remote-hook._codex_public_text (cognitive 17) Sources/CodeIsland/Resources/codeisland-remote-hook.py:241 — codeisland-remote-hook._codex_public_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 2 (3 pts), 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 · NativeHookInstaller.Uninstall (cognitive 16) · ×1
  • NativeHookInstaller.Uninstall (cognitive 16) windows/CodeIsland.Hooks/NativeHookInstaller.cs:43 — NativeHookInstaller.Uninstall has cognitive complexity 16 (threshold 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 · AppState.handleProcessExit (cognitive 16) · ×1
  • AppState.handleProcessExit (cognitive 16) Sources/CodeIsland/AppState.swift:865 — AppState.handleProcessExit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. 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 · AppState.applyAiWorkListEntry (cognitive 16) · ×1
  • AppState.applyAiWorkListEntry (cognitive 16) Sources/CodeIsland/AppState+AiWorkWatch.swift:931 — AppState.applyAiWorkListEntry has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 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 · ConfigInstaller.isInstalled (cognitive 16) · ×1
  • ConfigInstaller.isInstalled (cognitive 16) Sources/CodeIsland/ConfigInstaller.swift:1191 — ConfigInstaller.isInstalled has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 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 · ConfigInstaller.mergeHermesHooks (cognitive 16) · ×1
  • ConfigInstaller.mergeHermesHooks (cognitive 16) Sources/CodeIsland/ConfigInstaller.swift:2500 — ConfigInstaller.mergeHermesHooks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigInstaller.contentsContainsKimiHook (cognitive 16) · ×1
  • ConfigInstaller.contentsContainsKimiHook (cognitive 16) Sources/CodeIsland/ConfigInstaller.swift:3100 — ConfigInstaller.contentsContainsKimiHook has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, 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 · CoworkSessionWatcher.forEachSession (cognitive 16) · ×1
  • CoworkSessionWatcher.forEachSession (cognitive 16) Sources/CodeIsland/CoworkSessionWatcher.swift:520 — CoworkSessionWatcher.forEachSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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 · DiagnosticsRedaction.words (cognitive 16) · ×1
  • DiagnosticsRedaction.words (cognitive 16) Sources/CodeIsland/DiagnosticsRedaction.swift:127 — DiagnosticsRedaction.words has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, 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 · FollowUpReminderController.perform (cognitive 16) · ×1
  • FollowUpReminderController.perform (cognitive 16) Sources/CodeIsland/FollowUpReminderController.swift:398 — FollowUpReminderController.perform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 3 (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 · IdleSessionRemovalPolicy.selection (cognitive 16) · ×1
  • IdleSessionRemovalPolicy.selection (cognitive 16) Sources/CodeIsland/IdleSessionRemoval.swift:18 — IdleSessionRemovalPolicy.selection has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 3 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · L10n.effectiveLanguage (cognitive 16) · ×1
  • L10n.effectiveLanguage (cognitive 16) Sources/CodeIsland/L10n.swift:15 — L10n.effectiveLanguage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionCard.compactActivity (cognitive 16) · ×1
  • SessionCard.compactActivity (cognitive 16) Sources/CodeIsland/NotchPanelView.swift:4666 — SessionCard.compactActivity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MiniAgentIcon.body (cognitive 16) · ×1
  • MiniAgentIcon.body (cognitive 16) Sources/CodeIsland/NotchPanelView.swift:5660 — MiniAgentIcon.body has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6, if/else 2 (4 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PanelWindowController.showPanel (cognitive 16) · ×1
  • PanelWindowController.showPanel (cognitive 16) Sources/CodeIsland/PanelWindowController.swift:277 — PanelWindowController.showPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ProcessTable.getProcessArgs (cognitive 16) · ×1
  • ProcessTable.getProcessArgs (cognitive 16) Sources/CodeIsland/ProcessTable.swift:55 — ProcessTable.getProcessArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PushNotifier.pump (cognitive 16) · ×1
  • PushNotifier.pump (cognitive 16) Sources/CodeIsland/PushNotifier.swift:412 — PushNotifier.pump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuddyPage.body (cognitive 16) · ×1
  • BuddyPage.body (cognitive 16) Sources/CodeIsland/SettingsView.swift:2088 — BuddyPage.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, ternaries 2, 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 · CodexDiscovery.inspectCodexSubagentMetadata (cognitive 16) · ×1
  • CodexDiscovery.inspectCodexSubagentMetadata (cognitive 16) Sources/CodeIsland/Discovery/CodexDiscovery.swift:643 — CodexDiscovery.inspectCodexSubagentMetadata has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 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 · CursorDiscovery.findActiveCursorSessions (cognitive 16) · ×1
  • CursorDiscovery.findActiveCursorSessions (cognitive 16) Sources/CodeIsland/Discovery/CursorDiscovery.swift:33 — CursorDiscovery.findActiveCursorSessions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, ternaries 1 (2 pts), 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 · GrokDiscovery.grokSessionProcessMatchScore (cognitive 16) · ×1
  • GrokDiscovery.grokSessionProcessMatchScore (cognitive 16) Sources/CodeIsland/Discovery/GrokDiscovery.swift:89 — GrokDiscovery.grokSessionProcessMatchScore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentTaskTranscript.claudeUserEvents (cognitive 16) · ×1
  • AgentTaskTranscript.claudeUserEvents (cognitive 16) Sources/CodeIslandCore/AgentTaskParsing.swift:313 — AgentTaskTranscript.claudeUserEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 2 (3 pts), 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 · CoworkPaths.classify (cognitive 16) · ×1
  • CoworkPaths.classify (cognitive 16) Sources/CodeIslandCore/CoworkSession.swift:73 — CoworkPaths.classify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · FollowUpReminderScheduler.collectDue (cognitive 16) · ×1
  • FollowUpReminderScheduler.collectDue (cognitive 16) Sources/CodeIslandCore/FollowUpReminderScheduler.swift:361 — FollowUpReminderScheduler.collectDue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HookIntake.stdout (cognitive 16) · ×1
  • HookIntake.stdout (cognitive 16) Sources/CodeIslandCore/HookIntake.swift:677 — HookIntake.stdout has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 1 (3 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 · MarkdownBlockParser.collectItemLines (cognitive 16) · ×1
  • MarkdownBlockParser.collectItemLines (cognitive 16) Sources/CodeIslandCore/MarkdownBlockParser.swift:445 — MarkdownBlockParser.collectItemLines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PushMessageFormatter.clean (cognitive 16) · ×1
  • PushMessageFormatter.clean (cognitive 16) Sources/CodeIslandCore/PushNotification.swift:415 — PushMessageFormatter.clean has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 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 · MainActivity.render (cognitive 16) · ×1
  • MainActivity.render (cognitive 16) android-watch/app/src/main/java/com/codeisland/buddywatch/MainActivity.kt:238 — MainActivity.render has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, 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 · codeisland-remote-hook._get_tty (cognitive 16) · ×1
  • codeisland-remote-hook._get_tty (cognitive 16) Sources/CodeIsland/Resources/codeisland-remote-hook.py:586 — codeisland-remote-hook._get_tty has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (7 members, 11 shared lines) · ×1
  • Near-duplicate member family (7 members, 11 shared lines) Sources/CodeIsland/ClineView.swift:173 — Sources/CodeIsland/ClineView.swift:173-208 | Sources/CodeIsland/CopilotView.swift:176-222 | Sources/CodeIsland/DexView.swift:192-239 | Sources/CodeIsland/GeminiView.swift:163-201 | Sources/CodeIsland/KimiView.swift:154-190 | Sources/CodeIsland/QwenView.swift:174-211 | Sources/CodeIsland/TraeView.swift:164-200 — These 7 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 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 7 times.
D4 · Code Duplication · Near-duplicate member family (6 members, 11 shared lines) · ×1
  • Near-duplicate member family (6 members, 11 shared lines) Sources/CodeIsland/AiWorkView.swift:219 — Sources/CodeIsland/AiWorkView.swift:219-259 | Sources/CodeIsland/BuddyView.swift:193-228 | Sources/CodeIsland/CursorView.swift:194-230 | Sources/CodeIsland/DroidView.swift:171-206 | Sources/CodeIsland/OpenCodeView.swift:187-222 | Sources/CodeIsland/QoderView.swift:168-203 — These 6 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 · Near-duplicate member family (4 members, 17 shared lines) · ×1
  • Near-duplicate member family (4 members, 17 shared lines) Sources/CodeIsland/AntiGravityView.swift:150 — Sources/CodeIsland/AntiGravityView.swift:150-175 | Sources/CodeIsland/HermesView.swift:158-183 | Sources/CodeIsland/StepFunView.swift:152-178 | Sources/CodeIsland/WorkBuddyView.swift:142-167 — These 4 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 · Near-duplicate member family (4 members, 11 shared lines) · ×1
  • Near-duplicate member family (4 members, 11 shared lines) Sources/CodeIsland/AntiGravityView.swift:150 — Sources/CodeIsland/AntiGravityView.swift:150-175 | Sources/CodeIsland/HermesView.swift:158-183 | Sources/CodeIsland/PiView.swift:154-178 | Sources/CodeIsland/WorkBuddyView.swift:142-167 — These 4 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 · Near-duplicate member pair (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:268 — ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:268-427 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchConnection.swift:166-240 — These two members are variants of one another: 30 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 (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) Sources/CodeIsland/ClineView.swift:57 — Sources/CodeIsland/ClineView.swift:57-87 | Sources/CodeIsland/KimiView.swift:57-77 — These two members are one piece of code written twice and then edited apart: 16 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 · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) windows/CodeIsland.Windows/SettingsWindow.xaml.cs:42 — windows/CodeIsland.Windows/SettingsWindow.xaml.cs:42-61 | windows/CodeIsland.Windows/SettingsWindow.xaml.cs:73-87 — These two members are one piece of code written twice and then edited apart: 13 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 (24 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (24 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift:64 — Sources/CodeIsland/AiWorkView.swift:64-69 | Sources/CodeIsland/AntiGravityView.swift:34-39 | Sources/CodeIsland/BuddyView.swift:34-39 | Sources/CodeIsland/ClineView.swift:34-39 | Sources/CodeIsland/CopilotView.swift:37-42 | Sources/CodeIsland/CursorView.swift:35-40 | Sources/CodeIsland/DeepSeekView.swift:36-41 | Sources/CodeIsland/DexView.swift:35-40 | Sources/CodeIsland/DroidView.swift:34-39 | Sources/CodeIsland/GeminiView.swift:34-39 | Sources/CodeIsland/HermesView.swift:33-38 | Sources/CodeIsland/KimiView.swift:33-38 | Sources/CodeIsland/KiroView.swift:36-41 | Sources/CodeIsland/MiMoView.swift:34-39 | Sources/CodeIsland/MinimaxView.swift:39-44 | Sources/CodeIsland/OpenClawView.swift:38-43 | Sources/CodeIsland/OpenCodeView.swift:34-39 | Sources/CodeIsland/PiView.swift:38-43 | Sources/CodeIsland/PixelCharacterView.swift:44-49 | Sources/CodeIsland/QoderView.swift:33-38 | Sources/CodeIsland/QwenView.swift:34-39 | Sources/CodeIsland/StepFunView.swift:33-38 | Sources/CodeIsland/TraeView.swift:35-40 | Sources/CodeIsland/WorkBuddyView.swift:33-38 — These 24 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 24 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 24 times.
D4 · Code Duplication · Members sharing a duplicated core (20 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (20 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift:75 — Sources/CodeIsland/AiWorkView.swift:75-85 | Sources/CodeIsland/AntiGravityView.swift:45-55 | Sources/CodeIsland/BuddyView.swift:45-55 | Sources/CodeIsland/ClineView.swift:45-55 | Sources/CodeIsland/CopilotView.swift:48-58 | Sources/CodeIsland/CursorView.swift:49-59 | Sources/CodeIsland/DexView.swift:47-57 | Sources/CodeIsland/DroidView.swift:45-55 | Sources/CodeIsland/GeminiView.swift:45-55 | Sources/CodeIsland/HermesView.swift:44-54 | Sources/CodeIsland/KimiView.swift:44-54 | Sources/CodeIsland/MiMoView.swift:48-58 | Sources/CodeIsland/OpenCodeView.swift:45-55 | Sources/CodeIsland/PiView.swift:50-60 | Sources/CodeIsland/PixelCharacterView.swift:287-297 | Sources/CodeIsland/QoderView.swift:44-54 | Sources/CodeIsland/QwenView.swift:45-55 | Sources/CodeIsland/StepFunView.swift:44-54 | Sources/CodeIsland/TraeView.swift:46-56 | Sources/CodeIsland/WorkBuddyView.swift:44-54 — These 20 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 20 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 20 times.
D4 · Code Duplication · Members sharing a duplicated core (19 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (19 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift:177 — Sources/CodeIsland/AiWorkView.swift:177-192 | Sources/CodeIsland/AntiGravityView.swift:93-122 | Sources/CodeIsland/BuddyView.swift:154-169 | Sources/CodeIsland/ClineView.swift:130-148 | Sources/CodeIsland/CopilotView.swift:133-151 | Sources/CodeIsland/CursorView.swift:156-171 | Sources/CodeIsland/DexView.swift:139-157 | Sources/CodeIsland/DroidView.swift:128-143 | Sources/CodeIsland/GeminiView.swift:118-136 | Sources/CodeIsland/HermesView.swift:101-130 | Sources/CodeIsland/KimiView.swift:111-129 | Sources/CodeIsland/MiMoView.swift:168-183 | Sources/CodeIsland/OpenCodeView.swift:149-164 | Sources/CodeIsland/PiView.swift:99-129 | Sources/CodeIsland/QoderView.swift:129-144 | Sources/CodeIsland/QwenView.swift:129-147 | Sources/CodeIsland/StepFunView.swift:89-122 | Sources/CodeIsland/TraeView.swift:121-139 | Sources/CodeIsland/WorkBuddyView.swift:85-114 — These 19 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 19 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 19 times.
D4 · Code Duplication · Members sharing a duplicated core (15 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (15 members, 50+ identical tokens) Sources/CodeIsland/AiWorkView.swift:272 — Sources/CodeIsland/AiWorkView.swift:272-324 | Sources/CodeIsland/BuddyView.swift:241-294 | Sources/CodeIsland/ClineView.swift:221-269 | Sources/CodeIsland/CopilotView.swift:237-295 | Sources/CodeIsland/CursorView.swift:243-295 | Sources/CodeIsland/DexView.swift:254-314 | Sources/CodeIsland/DroidView.swift:219-272 | Sources/CodeIsland/GeminiView.swift:214-264 | Sources/CodeIsland/KimiView.swift:203-252 | Sources/CodeIsland/MiMoView.swift:234-276 | Sources/CodeIsland/OpenCodeView.swift:235-283 | Sources/CodeIsland/PixelCharacterView.swift:299-391 | Sources/CodeIsland/QoderView.swift:216-264 | Sources/CodeIsland/QwenView.swift:224-273 | Sources/CodeIsland/TraeView.swift:213-262 — These 15 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 15 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 15 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:125 — android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:125-175 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:258-307 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:350-386 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:424-461 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:502-537 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:574-609 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:643-672 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:705-737 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:771-798 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:832-860 — These 10 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 10 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 10 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Sources/CodeIsland/CopilotView.swift:133 — Sources/CodeIsland/CopilotView.swift:133-151 | Sources/CodeIsland/DexView.swift:139-157 | Sources/CodeIsland/GeminiView.swift:118-136 | Sources/CodeIsland/KimiView.swift:111-129 | Sources/CodeIsland/KiroView.swift:75-101 | Sources/CodeIsland/OpenClawView.swift:104-118 | Sources/CodeIsland/QwenView.swift:129-147 | Sources/CodeIsland/StepFunView.swift:89-122 — 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 · Duplicated block (28–32 lines × 2) · ×1
  • Duplicated block (28–32 lines × 2) Sources/CodeIsland/NotchPanelView.swift:5832 — Sources/CodeIsland/NotchPanelView.swift:5832-5863 | ios/CodeIslandCompanion/Shared/CompanionDisplayText.swift:172-199 — 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 (27–29 lines × 2) · ×1
  • Duplicated block (27–29 lines × 2) Sources/CodeIslandCore/ChatMessageTextFormatter.swift:68 — Sources/CodeIslandCore/ChatMessageTextFormatter.swift:68-96 | ios/CodeIslandCompanion/Shared/CompanionDisplayText.swift:142-168 — 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 (17–25 lines × 3) · ×1
  • Duplicated block (17–25 lines × 3) Sources/CodeIsland/AppState.swift:2081 — Sources/CodeIsland/AppState.swift:2081-2105 | Sources/CodeIsland/AppState.swift:2573-2589 | Sources/CodeIsland/AppState.swift:2631-2648 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AppState.swift:2081` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:1634 — Sources/CodeIslandCore/SessionSnapshot.swift:1634-1654 | Sources/CodeIslandCore/SessionSnapshot.swift:2135-2159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/SessionSnapshot.swift:1634` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–21 lines × 4) · ×1
  • Duplicated block (4–21 lines × 4) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:332 — ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:332-352 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:388-408 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchConnection.swift:175-178 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchConnection.swift:202-222 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandWatchApp/WatchConnection.swift:175` 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 (14–17 lines × 5) · ×1
  • Duplicated block (14–17 lines × 5) Sources/CodeIslandCore/AppleCompanionPayload.swift:145 — Sources/CodeIslandCore/AppleCompanionPayload.swift:145-158 | Sources/CodeIslandCore/HookIntake.swift:117-133 | Sources/CodeIslandCore/JSONLTailer.swift:71-85 | Sources/CodeIslandCore/PushNotification.swift:173-186 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:214-227 — before extracting anything, compare `Sources/CodeIslandCore/AppleCompanionPayload.swift` and `ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AppleCompanionPayload.swift:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) Sources/CodeIsland/AppState.swift:2820 — Sources/CodeIsland/AppState.swift:2820-2836 | Sources/CodeIsland/AppState.swift:2946-2962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AppState.swift:2820` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) Sources/CodeIslandCore/AppleCompanionPayload.swift:51 — Sources/CodeIslandCore/AppleCompanionPayload.swift:51-66 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:99-115 — before extracting anything, compare `Sources/CodeIslandCore/AppleCompanionPayload.swift` and `ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AppleCompanionPayload.swift:51` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) Sources/CodeIsland/KiroView.swift:17 — Sources/CodeIsland/KiroView.swift:17-32 | Sources/CodeIsland/OpenClawView.swift:18-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 (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) Sources/CodeIsland/ConfigInstaller.swift:791 — Sources/CodeIsland/ConfigInstaller.swift:791-804 | Sources/CodeIsland/ConfigInstaller.swift:930-944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:791` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:826 — ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:826-840 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1054-1068 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:826` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:841` calls `frame` and `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1069` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–14 lines × 3) · ×1
  • Duplicated block (10–14 lines × 3) Sources/CodeIsland/KiroView.swift:126 — Sources/CodeIsland/KiroView.swift:126-135 | Sources/CodeIsland/MinimaxView.swift:155-168 | Sources/CodeIsland/OpenClawView.swift:143-153 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/KiroView.swift:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) Sources/CodeIsland/AppState.swift:4053 — Sources/CodeIsland/AppState.swift:4053-4063 | Sources/CodeIsland/AppState.swift:4093-4106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AppState.swift:4053` 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 (11–13 lines × 4) · ×1
  • Duplicated block (11–13 lines × 4) Sources/CodeIsland/BuddyView.swift:72 — Sources/CodeIsland/BuddyView.swift:72-83 | Sources/CodeIsland/DexView.swift:81-93 | Sources/CodeIsland/OpenCodeView.swift:71-81 | Sources/CodeIsland/QoderView.swift:72-83 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/DexView.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 125 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:72` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (3–13 lines × 3) · ×1
  • Duplicated block (3–13 lines × 3) Sources/CodeIsland/GeminiView.swift:59 — Sources/CodeIsland/GeminiView.swift:59-70 | Sources/CodeIsland/QwenView.swift:59-71 | Sources/CodeIsland/QwenView.swift:88-90 — before extracting anything, compare `Sources/CodeIsland/GeminiView.swift` and `Sources/CodeIsland/QwenView.swift` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 185 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/GeminiView.swift:59` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/GeminiView.swift:70` calls `sin` and `Sources/CodeIsland/QwenView.swift:90` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) Sources/CodeIslandCore/AiWorkWatchClient.swift:197 — Sources/CodeIslandCore/AiWorkWatchClient.swift:197-209 | Sources/CodeIslandCore/CodexAppServerClient.swift:238-249 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIslandCore/AiWorkWatchClient.swift:197` 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 (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) Sources/CodeIsland/BuddyView.swift:63 — Sources/CodeIsland/BuddyView.swift:63-74 | Sources/CodeIsland/DexView.swift:67-78 | Sources/CodeIsland/QoderView.swift:62-73 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/DexView.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 125 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:63` 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–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) Sources/CodeIsland/RemoteInstaller.swift:1709 — Sources/CodeIsland/RemoteInstaller.swift:1709-1718 | Sources/CodeIsland/SSHForwarder.swift:162-171 | Sources/CodeIsland/SSHForwarder.swift:207-218 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/RemoteInstaller.swift:1709` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) Sources/CodeIsland/DebugHarness.swift:279 — Sources/CodeIsland/DebugHarness.swift:279-290 | Sources/CodeIsland/DebugHarness.swift:472-482 — 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 (10–11 lines × 6) · ×1
  • Duplicated block (10–11 lines × 6) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:344 — Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:344-354 | Sources/CodeIsland/Discovery/ClineDiscovery.swift:89-98 | Sources/CodeIsland/Discovery/CodexDiscovery.swift:965-974 | Sources/CodeIsland/Discovery/CopilotDiscovery.swift:153-162 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:120-129 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:166-175 — before extracting anything, compare `Sources/CodeIsland/Discovery/CopilotDiscovery.swift` and `Sources/CodeIsland/Discovery/CursorDiscovery.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:344` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–11 lines × 4) · ×1
  • Duplicated block (5–11 lines × 4) Sources/CodeIsland/SettingsView.swift:864 — Sources/CodeIsland/SettingsView.swift:864-874 | Sources/CodeIsland/SettingsView.swift:877-887 | Sources/CodeIsland/SettingsView.swift:890-899 | Sources/CodeIsland/SettingsView.swift:901-905 — 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 `Sources/CodeIsland/SettingsView.swift:864` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (3–10 lines × 18) · ×1
  • Duplicated block (3–10 lines × 18) Sources/CodeIsland/AiWorkView.swift:288 — Sources/CodeIsland/AiWorkView.swift:288-290 | Sources/CodeIsland/AntiGravityView.swift:158-160 | Sources/CodeIsland/BuddyView.swift:265-272 | Sources/CodeIsland/ClineView.swift:241-248 | Sources/CodeIsland/CopilotView.swift:264-271 | Sources/CodeIsland/CursorView.swift:264-271 | Sources/CodeIsland/DexView.swift:281-289 | Sources/CodeIsland/DroidView.swift:243-250 | Sources/CodeIsland/GeminiView.swift:234-242 | Sources/CodeIsland/HermesView.swift:166-168 | Sources/CodeIsland/KimiView.swift:223-230 | Sources/CodeIsland/OpenCodeView.swift:255-262 | Sources/CodeIsland/PixelCharacterView.swift:341-350 | Sources/CodeIsland/QoderView.swift:236-243 | Sources/CodeIsland/QwenView.swift:244-251 | Sources/CodeIsland/StepFunView.swift:161-163 | Sources/CodeIsland/TraeView.swift:233-240 | Sources/CodeIsland/WorkBuddyView.swift:150-152 — 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 18 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:288` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/BuddyView.swift:265` calls `lerp` and `Sources/CodeIsland/AiWorkView.swift:288` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–10 lines × 4) · ×1
  • Duplicated block (4–10 lines × 4) Sources/CodeIsland/AntiGravityView.swift:103 — Sources/CodeIsland/AntiGravityView.swift:103-112 | Sources/CodeIsland/HermesView.swift:111-120 | Sources/CodeIsland/StepFunView.swift:96-99 | Sources/CodeIsland/WorkBuddyView.swift:95-104 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:103` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/AntiGravityView.swift:101` calls `V`, `drawShadow`, `abs` and `Sources/CodeIsland/StepFunView.swift:96` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) Sources/CodeIsland/ConfigInstaller.swift:3509 — Sources/CodeIsland/ConfigInstaller.swift:3509-3516 | Sources/CodeIsland/ConfigInstaller.swift:3550-3559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ConfigInstaller.swift:3509` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 5) · ×1
  • Duplicated block (8–9 lines × 5) Sources/CodeIsland/ClineView.swift:179 — Sources/CodeIsland/ClineView.swift:179-186 | Sources/CodeIsland/GeminiView.swift:170-178 | Sources/CodeIsland/KimiView.swift:160-167 | Sources/CodeIsland/QwenView.swift:181-188 | Sources/CodeIsland/TraeView.swift:170-177 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/GeminiView.swift` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 155 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ClineView.swift:179` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/KimiView.swift:171` calls `drawLegs` and `Sources/CodeIsland/ClineView.swift:191` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) Sources/CodeIsland/DebugHarness.swift:158 — Sources/CodeIsland/DebugHarness.swift:158-166 | Sources/CodeIsland/DebugHarness.swift:193-201 | Sources/CodeIsland/DebugHarness.swift:366-374 | Sources/CodeIsland/DebugHarness.swift:485-493 — 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 (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) Sources/CodeIsland/ConfigInstaller.swift:742 — Sources/CodeIsland/ConfigInstaller.swift:742-749 | Sources/CodeIsland/ConfigInstaller.swift:817-825 — 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 (3–8 lines × 15) · ×1
  • Duplicated block (3–8 lines × 15) Sources/CodeIsland/AiWorkView.swift:272 — Sources/CodeIsland/AiWorkView.swift:272-278 | Sources/CodeIsland/BuddyView.swift:241-247 | Sources/CodeIsland/ClineView.swift:221-227 | Sources/CodeIsland/CopilotView.swift:237-243 | Sources/CodeIsland/CursorView.swift:243-249 | Sources/CodeIsland/DexView.swift:254-260 | Sources/CodeIsland/DroidView.swift:219-225 | Sources/CodeIsland/GeminiView.swift:214-220 | Sources/CodeIsland/KimiView.swift:203-209 | Sources/CodeIsland/MiMoView.swift:237-239 | Sources/CodeIsland/OpenCodeView.swift:235-241 | Sources/CodeIsland/PixelCharacterView.swift:299-306 | Sources/CodeIsland/QoderView.swift:216-222 | Sources/CodeIsland/QwenView.swift:224-230 | Sources/CodeIsland/TraeView.swift:213-219 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 95 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:272` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/MiMoView.swift:235` calls `CGFloat`, `truncatingRemainder`, `lerp` and `Sources/CodeIsland/AiWorkView.swift:272` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 12) · ×1
  • Duplicated block (7–8 lines × 12) Sources/CodeIsland/BuddyView.swift:282 — Sources/CodeIsland/BuddyView.swift:282-288 | Sources/CodeIsland/ClineView.swift:257-263 | Sources/CodeIsland/CopilotView.swift:282-289 | Sources/CodeIsland/CursorView.swift:283-289 | Sources/CodeIsland/DexView.swift:301-308 | Sources/CodeIsland/DroidView.swift:260-266 | Sources/CodeIsland/GeminiView.swift:251-258 | Sources/CodeIsland/KimiView.swift:239-246 | Sources/CodeIsland/OpenCodeView.swift:271-277 | Sources/CodeIsland/QoderView.swift:252-258 | Sources/CodeIsland/QwenView.swift:260-267 | Sources/CodeIsland/TraeView.swift:249-256 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/ClineView.swift` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:282` 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 (3–8 lines × 11) · ×1
  • Duplicated block (3–8 lines × 11) Sources/CodeIsland/AiWorkView.swift:281 — Sources/CodeIsland/AiWorkView.swift:281-283 | Sources/CodeIsland/AiWorkView.swift:287-289 | Sources/CodeIsland/ClineView.swift:231-238 | Sources/CodeIsland/CopilotView.swift:246-248 | Sources/CodeIsland/CursorView.swift:252-254 | Sources/CodeIsland/GeminiView.swift:224-231 | Sources/CodeIsland/KimiView.swift:213-220 | Sources/CodeIsland/OpenCodeView.swift:252-254 | Sources/CodeIsland/QoderView.swift:233-235 | Sources/CodeIsland/QwenView.swift:234-241 | Sources/CodeIsland/TraeView.swift:223-230 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/ClineView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 96 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:281` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/AiWorkView.swift:285` calls `sin` and `Sources/CodeIsland/AiWorkView.swift:290` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 4) · ×1
  • Duplicated block (7–8 lines × 4) Sources/CodeIsland/AntiGravityView.swift:105 — Sources/CodeIsland/AntiGravityView.swift:105-111 | Sources/CodeIsland/HermesView.swift:113-119 | Sources/CodeIsland/StepFunView.swift:101-108 | Sources/CodeIsland/WorkBuddyView.swift:97-103 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:105` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) Sources/CodeIsland/SettingsView.swift:682 — Sources/CodeIsland/SettingsView.swift:682-689 | Sources/CodeIsland/SettingsView.swift:691-698 | Sources/CodeIsland/SettingsView.swift:1475-1482 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/SettingsView.swift:682` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/SettingsView.swift:1474` calls `Text`, `tag` and `Sources/CodeIsland/SettingsView.swift:690` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) Sources/CodeIsland/DebugHarness.swift:135 — Sources/CodeIsland/DebugHarness.swift:135-142 | Sources/CodeIsland/DebugHarness.swift:397-403 — 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 (7 lines × 12) · ×1
  • Duplicated block (7 lines × 12) Sources/CodeIsland/DebugHarness.swift:100 — Sources/CodeIsland/DebugHarness.swift:100-106 | Sources/CodeIsland/DebugHarness.swift:118-124 | Sources/CodeIsland/DebugHarness.swift:182-188 | Sources/CodeIsland/DebugHarness.swift:254-260 | Sources/CodeIsland/DebugHarness.swift:285-291 | Sources/CodeIsland/DebugHarness.swift:304-310 | Sources/CodeIsland/DebugHarness.swift:323-329 | Sources/CodeIsland/DebugHarness.swift:382-388 | Sources/CodeIsland/DebugHarness.swift:409-415 | Sources/CodeIsland/DebugHarness.swift:424-430 | Sources/CodeIsland/DebugHarness.swift:439-445 | Sources/CodeIsland/DebugHarness.swift:506-512 — all 12 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/DebugHarness.swift:107` calls `recordTool` and `Sources/CodeIsland/DebugHarness.swift:125` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (2–7 lines × 15) · ×1
  • Duplicated block (2–7 lines × 15) Sources/CodeIsland/AiWorkView.swift:280 — Sources/CodeIsland/AiWorkView.swift:280-281 | Sources/CodeIsland/BuddyView.swift:250-255 | Sources/CodeIsland/ClineView.swift:229-230 | Sources/CodeIsland/CopilotView.swift:245-246 | Sources/CodeIsland/CursorView.swift:251-252 | Sources/CodeIsland/DexView.swift:263-268 | Sources/CodeIsland/DroidView.swift:228-233 | Sources/CodeIsland/GeminiView.swift:222-223 | Sources/CodeIsland/KimiView.swift:211-212 | Sources/CodeIsland/MiMoView.swift:242-247 | Sources/CodeIsland/OpenCodeView.swift:244-249 | Sources/CodeIsland/PixelCharacterView.swift:309-315 | Sources/CodeIsland/QoderView.swift:225-230 | Sources/CodeIsland/QwenView.swift:232-233 | Sources/CodeIsland/TraeView.swift:221-222 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 95 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:250` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/BuddyView.swift:259` calls `sin` and `Sources/CodeIsland/OpenCodeView.swift:252` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (2–7 lines × 9) · ×1
  • Duplicated block (2–7 lines × 9) Sources/CodeIsland/AntiGravityView.swift:133 — Sources/CodeIsland/AntiGravityView.swift:133-134 | Sources/CodeIsland/BuddyView.swift:199-205 | Sources/CodeIsland/CursorView.swift:201-207 | Sources/CodeIsland/DroidView.swift:177-183 | Sources/CodeIsland/HermesView.swift:141-142 | Sources/CodeIsland/OpenCodeView.swift:193-199 | Sources/CodeIsland/QoderView.swift:174-180 | Sources/CodeIsland/StepFunView.swift:133-134 | Sources/CodeIsland/WorkBuddyView.swift:125-126 — 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 9 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/BuddyView.swift:205` calls `abs` and `Sources/CodeIsland/AntiGravityView.swift:134` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–7 lines × 5) · ×1
  • Duplicated block (3–7 lines × 5) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:92 — Sources/CodeIsland/Discovery/CopilotDiscovery.swift:92-94 | Sources/CodeIsland/Discovery/CopilotDiscovery.swift:124-130 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:102-108 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:143-149 | Sources/CodeIsland/Discovery/KimiDiscovery.swift:111-113 — before extracting anything, compare `Sources/CodeIsland/Discovery/CopilotDiscovery.swift` and `Sources/CodeIsland/Discovery/CursorDiscovery.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/Discovery/CopilotDiscovery.swift:92` 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) Sources/CodeIsland/SettingsView.swift:2884 — Sources/CodeIsland/SettingsView.swift:2884-2890 | Sources/CodeIsland/SettingsView.swift:2979-2984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/SettingsView.swift:2884` 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 (6 lines × 16) · ×1
  • Duplicated block (6 lines × 16) Sources/CodeIsland/AiWorkView.swift:178 — Sources/CodeIsland/AiWorkView.swift:178-183 | Sources/CodeIsland/BuddyView.swift:155-160 | Sources/CodeIsland/ClineView.swift:131-136 | Sources/CodeIsland/CopilotView.swift:134-139 | Sources/CodeIsland/CursorView.swift:157-162 | Sources/CodeIsland/DexView.swift:140-145 | Sources/CodeIsland/DroidView.swift:129-134 | Sources/CodeIsland/GeminiView.swift:119-124 | Sources/CodeIsland/KimiView.swift:112-117 | Sources/CodeIsland/MiMoView.swift:169-174 | Sources/CodeIsland/OpenCodeView.swift:150-155 | Sources/CodeIsland/PiView.swift:115-120 | Sources/CodeIsland/QoderView.swift:130-135 | Sources/CodeIsland/QwenView.swift:130-135 | Sources/CodeIsland/StepFunView.swift:105-110 | Sources/CodeIsland/TraeView.swift:122-127 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 95 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:178` 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 (6 lines × 13) · ×1
  • Duplicated block (6 lines × 13) Sources/CodeIsland/AiWorkView.swift:242 — Sources/CodeIsland/AiWorkView.swift:242-247 | Sources/CodeIsland/BuddyView.swift:214-219 | Sources/CodeIsland/ClineView.swift:193-198 | Sources/CodeIsland/CopilotView.swift:206-211 | Sources/CodeIsland/CursorView.swift:216-221 | Sources/CodeIsland/DexView.swift:221-226 | Sources/CodeIsland/DroidView.swift:192-197 | Sources/CodeIsland/GeminiView.swift:187-192 | Sources/CodeIsland/KimiView.swift:176-181 | Sources/CodeIsland/OpenCodeView.swift:208-213 | Sources/CodeIsland/QoderView.swift:189-194 | Sources/CodeIsland/QwenView.swift:197-202 | Sources/CodeIsland/TraeView.swift:186-191 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 95 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:242` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/BuddyView.swift:209` calls `drawLegs` and `Sources/CodeIsland/ClineView.swift:188` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 8) · ×1
  • Duplicated block (6 lines × 8) Sources/CodeIsland/CopilotView.swift:146 — Sources/CodeIsland/CopilotView.swift:146-151 | Sources/CodeIsland/DexView.swift:152-157 | Sources/CodeIsland/GeminiView.swift:131-136 | Sources/CodeIsland/KimiView.swift:124-129 | Sources/CodeIsland/KiroView.swift:95-100 | Sources/CodeIsland/OpenClawView.swift:113-118 | Sources/CodeIsland/QwenView.swift:142-147 | Sources/CodeIsland/StepFunView.swift:115-120 — before extracting anything, compare `Sources/CodeIsland/CopilotView.swift` and `Sources/CodeIsland/DexView.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/CopilotView.swift:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (3–6 lines × 17) · ×1
  • Duplicated block (3–6 lines × 17) Sources/CodeIsland/AiWorkView.swift:222 — Sources/CodeIsland/AiWorkView.swift:222-224 | Sources/CodeIsland/AntiGravityView.swift:126-128 | Sources/CodeIsland/BuddyView.swift:198-203 | Sources/CodeIsland/ClineView.swift:178-183 | Sources/CodeIsland/CopilotView.swift:179-181 | Sources/CodeIsland/CursorView.swift:197-199 | Sources/CodeIsland/DroidView.swift:176-181 | Sources/CodeIsland/GeminiView.swift:166-168 | Sources/CodeIsland/HermesView.swift:134-136 | Sources/CodeIsland/KimiView.swift:159-164 | Sources/CodeIsland/MiMoView.swift:194-196 | Sources/CodeIsland/OpenCodeView.swift:192-197 | Sources/CodeIsland/QoderView.swift:173-178 | Sources/CodeIsland/QwenView.swift:177-179 | Sources/CodeIsland/StepFunView.swift:126-128 | Sources/CodeIsland/TraeView.swift:169-174 | Sources/CodeIsland/WorkBuddyView.swift:118-120 — 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 17 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/BuddyView.swift:197` calls `sin` and `Sources/CodeIsland/AiWorkView.swift:222` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (1–6 lines × 6) · ×1
  • Duplicated block (1–6 lines × 6) Sources/CodeIsland/AntiGravityView.swift:143 — Sources/CodeIsland/AntiGravityView.swift:143-148 | Sources/CodeIsland/HermesView.swift:151-156 | Sources/CodeIsland/PiView.swift:147-147 | Sources/CodeIsland/PiView.swift:148-148 | Sources/CodeIsland/StepFunView.swift:145-150 | Sources/CodeIsland/WorkBuddyView.swift:135-140 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 105 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AntiGravityView.swift:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `dy` to `CGFloat = 0` in one and `CGFloat` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:181 — ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:181-185 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:207-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:207` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 first that the copies are not typed on the same thing: the declarations holding them bind `placeholder` to `L10n.t(zh: "输入你的回答", en: "Type your answer")) submitButton(title: L10n.t(zh: "提交回答", en: "Submit Answer")` in one and `L10n.t(zh: "其他(请输入)", en: "Other (type here)")) submitButton(title: L10n.t(zh: "提交", en: "Submit")` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (5 lines × 24) · ×1
  • Duplicated block (5 lines × 24) Sources/CodeIsland/AiWorkView.swift:65 — Sources/CodeIsland/AiWorkView.swift:65-69 | Sources/CodeIsland/AntiGravityView.swift:35-39 | Sources/CodeIsland/BuddyView.swift:35-39 | Sources/CodeIsland/ClineView.swift:35-39 | Sources/CodeIsland/CopilotView.swift:38-42 | Sources/CodeIsland/CursorView.swift:36-40 | Sources/CodeIsland/DeepSeekView.swift:37-41 | Sources/CodeIsland/DexView.swift:36-40 | Sources/CodeIsland/DroidView.swift:35-39 | Sources/CodeIsland/GeminiView.swift:35-39 | Sources/CodeIsland/HermesView.swift:34-38 | Sources/CodeIsland/KimiView.swift:34-38 | Sources/CodeIsland/KiroView.swift:37-41 | Sources/CodeIsland/MiMoView.swift:35-39 | Sources/CodeIsland/MinimaxView.swift:40-44 | Sources/CodeIsland/OpenClawView.swift:39-43 | Sources/CodeIsland/OpenCodeView.swift:35-39 | Sources/CodeIsland/PiView.swift:39-43 | Sources/CodeIsland/PixelCharacterView.swift:45-49 | Sources/CodeIsland/QoderView.swift:34-38 | Sources/CodeIsland/QwenView.swift:35-39 | Sources/CodeIsland/StepFunView.swift:34-38 | Sources/CodeIsland/TraeView.swift:36-40 | Sources/CodeIsland/WorkBuddyView.swift:34-38 — 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 24 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `svgH` to `CGFloat = 14` in one and `CGFloat = 10` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (5 lines × 20) · ×1
  • Duplicated block (5 lines × 20) Sources/CodeIsland/AiWorkView.swift:81 — Sources/CodeIsland/AiWorkView.swift:81-85 | Sources/CodeIsland/AntiGravityView.swift:51-55 | Sources/CodeIsland/BuddyView.swift:51-55 | Sources/CodeIsland/ClineView.swift:51-55 | Sources/CodeIsland/CopilotView.swift:54-58 | Sources/CodeIsland/CursorView.swift:55-59 | Sources/CodeIsland/DexView.swift:53-57 | Sources/CodeIsland/DroidView.swift:51-55 | Sources/CodeIsland/GeminiView.swift:51-55 | Sources/CodeIsland/HermesView.swift:50-54 | Sources/CodeIsland/KimiView.swift:50-54 | Sources/CodeIsland/MiMoView.swift:54-58 | Sources/CodeIsland/OpenCodeView.swift:51-55 | Sources/CodeIsland/PiView.swift:56-60 | Sources/CodeIsland/PixelCharacterView.swift:293-297 | Sources/CodeIsland/QoderView.swift:50-54 | Sources/CodeIsland/QwenView.swift:51-55 | Sources/CodeIsland/StepFunView.swift:50-54 | Sources/CodeIsland/TraeView.swift:52-56 | Sources/CodeIsland/WorkBuddyView.swift:50-54 — 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 20 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) Sources/CodeIsland/ClineView.swift:182 — Sources/CodeIsland/ClineView.swift:182-186 | Sources/CodeIsland/CopilotView.swift:192-197 | Sources/CodeIsland/DexView.swift:207-212 | Sources/CodeIsland/GeminiView.swift:173-178 | Sources/CodeIsland/KimiView.swift:163-167 | Sources/CodeIsland/PixelCharacterView.swift:213-218 | Sources/CodeIsland/QwenView.swift:184-188 | Sources/CodeIsland/TraeView.swift:173-177 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/CopilotView.swift` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 136 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ClineView.swift:182` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/CopilotView.swift:201` calls `drawLegs` and `Sources/CodeIsland/ClineView.swift:191` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–5 lines × 15) · ×1
  • Duplicated block (3–5 lines × 15) Sources/CodeIsland/AiWorkView.swift:184 — Sources/CodeIsland/AiWorkView.swift:184-186 | Sources/CodeIsland/BuddyView.swift:161-163 | Sources/CodeIsland/ClineView.swift:138-142 | Sources/CodeIsland/CopilotView.swift:141-145 | Sources/CodeIsland/CursorView.swift:163-165 | Sources/CodeIsland/DexView.swift:147-151 | Sources/CodeIsland/DroidView.swift:135-137 | Sources/CodeIsland/GeminiView.swift:126-130 | Sources/CodeIsland/KimiView.swift:119-123 | Sources/CodeIsland/MiMoView.swift:175-177 | Sources/CodeIsland/OpenCodeView.swift:156-158 | Sources/CodeIsland/QoderView.swift:136-138 | Sources/CodeIsland/QwenView.swift:137-141 | Sources/CodeIsland/StepFunView.swift:111-113 | Sources/CodeIsland/TraeView.swift:129-133 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 95 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. 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 (2–5 lines × 14) · ×1
  • Duplicated block (2–5 lines × 14) Sources/CodeIsland/AntiGravityView.swift:161 — Sources/CodeIsland/AntiGravityView.swift:161-162 | Sources/CodeIsland/BuddyView.swift:274-278 | Sources/CodeIsland/ClineView.swift:249-250 | Sources/CodeIsland/CursorView.swift:273-277 | Sources/CodeIsland/DroidView.swift:252-256 | Sources/CodeIsland/GeminiView.swift:243-244 | Sources/CodeIsland/HermesView.swift:169-170 | Sources/CodeIsland/KimiView.swift:231-232 | Sources/CodeIsland/OpenCodeView.swift:264-268 | Sources/CodeIsland/QoderView.swift:245-249 | Sources/CodeIsland/QwenView.swift:252-253 | Sources/CodeIsland/StepFunView.swift:164-165 | Sources/CodeIsland/TraeView.swift:241-242 | Sources/CodeIsland/WorkBuddyView.swift:153-154 — 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 14 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/BuddyView.swift:274` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/BuddyView.swift:274` calls `color`, `opacity`, `max` and `Sources/CodeIsland/AntiGravityView.swift:161` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (2–5 lines × 4) · ×1
  • Duplicated block (2–5 lines × 4) Sources/CodeIsland/ClineView.swift:160 — Sources/CodeIsland/ClineView.swift:160-164 | Sources/CodeIsland/KimiView.swift:141-145 | Sources/CodeIsland/QwenView.swift:160-161 | Sources/CodeIsland/TraeView.swift:150-151 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/KimiView.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 175 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/ClineView.swift:160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/ClineView.swift:160` calls `drawLegs` and `Sources/CodeIsland/QwenView.swift:160` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (2–5 lines × 3) · ×1
  • Duplicated block (2–5 lines × 3) Sources/CodeIsland/CopilotView.swift:274 — Sources/CodeIsland/CopilotView.swift:274-278 | Sources/CodeIsland/DexView.swift:292-298 | Sources/CodeIsland/PixelCharacterView.swift:352-353 — before extracting anything, compare `Sources/CodeIsland/CopilotView.swift` and `Sources/CodeIsland/DexView.swift` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/CopilotView.swift:274` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/CodeIsland/CopilotView.swift:274` calls `color`, `opacity` and `Sources/CodeIsland/PixelCharacterView.swift:352` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–5 lines × 4) · ×1
  • Duplicated block (4–5 lines × 4) Sources/CodeIsland/NotchPanelView.swift:1402 — Sources/CodeIsland/NotchPanelView.swift:1402-1406 | Sources/CodeIsland/NotchPanelView.swift:1433-1436 | Sources/CodeIsland/NotchPanelView.swift:1443-1446 | Sources/CodeIsland/NotchPanelView.swift:1491-1495 — 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 `Sources/CodeIsland/NotchPanelView.swift:1402` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `alignment` to `.top` in one and `.leading` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/CodeIsland/NotchPanelView.swift:1406` calls `Text` and `Sources/CodeIsland/NotchPanelView.swift:1446` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) Sources/CodeIsland/SettingsView.swift:2907 — Sources/CodeIsland/SettingsView.swift:2907-2911 | Sources/CodeIsland/SettingsView.swift:2947-2950 | Sources/CodeIsland/SettingsView.swift:2994-2998 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/SettingsView.swift:2907` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (11 lines × 21) · ×1
  • Duplicated block (11 lines × 21) Sources/CodeIsland/AiWorkView.swift:48 — Sources/CodeIsland/AiWorkView.swift:48-58 | Sources/CodeIsland/AntiGravityView.swift:19-29 | Sources/CodeIsland/BuddyView.swift:19-29 | Sources/CodeIsland/ClineView.swift:20-30 | Sources/CodeIsland/CopilotView.swift:20-30 | Sources/CodeIsland/CursorView.swift:20-30 | Sources/CodeIsland/DeepSeekView.swift:19-29 | Sources/CodeIsland/DexView.swift:18-28 | Sources/CodeIsland/DroidView.swift:19-29 | Sources/CodeIsland/GeminiView.swift:19-29 | Sources/CodeIsland/HermesView.swift:18-28 | Sources/CodeIsland/KimiView.swift:19-29 | Sources/CodeIsland/MiMoView.swift:19-29 | Sources/CodeIsland/OpenCodeView.swift:19-29 | Sources/CodeIsland/PiView.swift:19-32 | Sources/CodeIsland/PixelCharacterView.swift:17-27 | Sources/CodeIsland/QoderView.swift:18-28 | Sources/CodeIsland/QwenView.swift:19-29 | Sources/CodeIsland/StepFunView.swift:18-28 | Sources/CodeIsland/TraeView.swift:20-30 | Sources/CodeIsland/WorkBuddyView.swift:18-28 — 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 21 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (10 lines × 14) · ×1
  • Duplicated block (10 lines × 14) Sources/CodeIsland/AiWorkView.swift:166 — Sources/CodeIsland/AiWorkView.swift:166-175 | Sources/CodeIsland/BuddyView.swift:143-152 | Sources/CodeIsland/ClineView.swift:119-128 | Sources/CodeIsland/CopilotView.swift:122-131 | Sources/CodeIsland/CursorView.swift:145-154 | Sources/CodeIsland/DexView.swift:128-137 | Sources/CodeIsland/DroidView.swift:117-126 | Sources/CodeIsland/GeminiView.swift:107-116 | Sources/CodeIsland/KimiView.swift:100-109 | Sources/CodeIsland/MiMoView.swift:141-150 | Sources/CodeIsland/OpenCodeView.swift:138-147 | Sources/CodeIsland/QoderView.swift:118-127 | Sources/CodeIsland/QwenView.swift:118-127 | Sources/CodeIsland/TraeView.swift:110-119 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 95 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 (6 lines × 20) · ×1
  • Duplicated block (6 lines × 20) Sources/CodeIsland/AiWorkView.swift:75 — Sources/CodeIsland/AiWorkView.swift:75-80 | Sources/CodeIsland/AntiGravityView.swift:45-50 | Sources/CodeIsland/BuddyView.swift:45-50 | Sources/CodeIsland/ClineView.swift:45-50 | Sources/CodeIsland/CopilotView.swift:48-53 | Sources/CodeIsland/CursorView.swift:49-54 | Sources/CodeIsland/DexView.swift:47-52 | Sources/CodeIsland/DroidView.swift:45-50 | Sources/CodeIsland/GeminiView.swift:45-50 | Sources/CodeIsland/HermesView.swift:44-49 | Sources/CodeIsland/KimiView.swift:44-49 | Sources/CodeIsland/MiMoView.swift:48-53 | Sources/CodeIsland/OpenCodeView.swift:45-50 | Sources/CodeIsland/PiView.swift:50-55 | Sources/CodeIsland/PixelCharacterView.swift:287-292 | Sources/CodeIsland/QoderView.swift:44-49 | Sources/CodeIsland/QwenView.swift:45-50 | Sources/CodeIsland/StepFunView.swift:44-49 | Sources/CodeIsland/TraeView.swift:46-51 | Sources/CodeIsland/WorkBuddyView.swift:44-49 — 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 20 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CodeIsland/AiWorkView.swift:75` 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 (13 lines × 10) · ×1
  • Duplicated block (13 lines × 10) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:137 — android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:137-149 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:259-271 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:351-363 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:425-437 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:503-515 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:575-587 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:644-656 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:706-718 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:772-784 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:833-845 — all 10 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:365` calls `sin` and `android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:589` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: CodeIslandCore — CodeIslandCore: abstractness 0.01, instability 0.00, distance 0.99 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
R10 · Code Duplication · Duplicated block with local edits (148 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (148 matched lines × 2 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:52 — Sources/CodeIsland/Resources/codeisland-omp.ts:52 · Sources/CodeIsland/Resources/codeisland-pi.ts:77 — the two spans are one implementation copied and then locally edited — 894 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (91 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (91 matched lines × 2 locations) Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:139 — Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:139 · Sources/CodeIsland/Resources/codeisland-pi.ts:207 — the two spans are one implementation copied and then locally edited — 526 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 (42 lines × 3 locations) · ×1
  • Duplicated block (42 lines × 3 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:188 — Sources/CodeIsland/Resources/codeisland-omp.ts:188 · Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:139 · Sources/CodeIsland/Resources/codeisland-pi.ts:207 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:352 — Sources/CodeIsland/Resources/codeisland-omp.ts:352 · Sources/CodeIsland/Resources/codeisland-pi.ts:334 — 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 (21 lines × 3 locations) · ×1
  • Duplicated block (21 lines × 3 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:280 — Sources/CodeIsland/Resources/codeisland-omp.ts:280 · Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:210 · Sources/CodeIsland/Resources/codeisland-pi.ts:278 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:1066 — Sources/CodeIsland/Resources/codeisland-omp.ts:1066 · Sources/CodeIsland/Resources/codeisland-pi.ts:672 — 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 (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:558 — Sources/CodeIsland/Resources/codeisland-omp.ts:558 · Sources/CodeIsland/Resources/codeisland-pi.ts:414 — 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 (12 lines × 2 locations) · ×1
  • Duplicated block (12 lines × 2 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:1044 — Sources/CodeIsland/Resources/codeisland-omp.ts:1044 · Sources/CodeIsland/Resources/codeisland-pi.ts:638 — 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 (10 lines × 2 locations) · ×1
  • Duplicated block (10 lines × 2 locations) Sources/CodeIsland/Resources/codeisland-omp.ts:1002 — Sources/CodeIsland/Resources/codeisland-omp.ts:1002 · Sources/CodeIsland/Resources/codeisland-pi.ts:583 — 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 (6 lines × 2 locations) · ×1
  • Duplicated block (6 lines × 2 locations) Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:505 — Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:505 · Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:515 — 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 16, cognitive 22) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 22) Sources/CodeIsland/Resources/codeisland-pi.ts:635 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 22; 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 16, cognitive 14) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 14) Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:431 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 14; 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 (anonymous) (cyclomatic 15, cognitive 17) · ×1
  • Complex function (anonymous) (cyclomatic 15, cognitive 17) Sources/CodeIsland/Resources/codeisland-omp.ts:656 — (anonymous) has cyclomatic complexity 15 and cognitive complexity 17; 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 classifyCodeIslandAskResponse (cyclomatic 13, cognitive 12) · ×1
  • Complex function classifyCodeIslandAskResponse (cyclomatic 13, cognitive 12) Sources/CodeIsland/Resources/codeisland-omp.ts:459 — classifyCodeIslandAskResponse has cyclomatic complexity 13 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 (anonymous) (cyclomatic 11, cognitive 13) · ×1
  • Complex function (anonymous) (cyclomatic 11, cognitive 13) Sources/CodeIsland/Resources/codeisland-omp.ts:1041 — (anonymous) has cyclomatic complexity 11 and cognitive complexity 13; 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 ompAgentIdentity (cyclomatic 11, cognitive 10) · ×1
  • Complex function ompAgentIdentity (cyclomatic 11, cognitive 10) Sources/CodeIsland/Resources/codeisland-omp.ts:155 — ompAgentIdentity has cyclomatic complexity 11 and cognitive complexity 10; 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.
R3 · Large Files · Sources/CodeIsland/Resources/codeisland-omp.ts · ×1
  • Sources/CodeIsland/Resources/codeisland-omp.ts: 1018 lines of code Sources/CodeIsland/Resources/codeisland-omp.ts:1 — Sources/CodeIsland/Resources/codeisland-omp.ts has 1018 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 · Sources/CodeIsland/Resources/codeisland-pi.ts · ×1
  • Sources/CodeIsland/Resources/codeisland-pi.ts: 673 lines of code Sources/CodeIsland/Resources/codeisland-pi.ts:1 — Sources/CodeIsland/Resources/codeisland-pi.ts has 673 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 · Sources/CodeIsland/Resources/codeisland-openclaw/index.ts · ×1
  • Sources/CodeIsland/Resources/codeisland-openclaw/index.ts: 489 lines of code Sources/CodeIsland/Resources/codeisland-openclaw/index.ts:1 — Sources/CodeIsland/Resources/codeisland-openclaw/index.ts has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · No lint script · ×1
  • No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
SC1 · Supply-chain hygiene · NuGet dependencies are not locked · ×1
  • NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
X2 · Cancellation propagation · Async local function without CancellationToken · ×1
  • Async local function without CancellationToken: ExpectAck windows/CodeIsland.Bridge/Program.cs:102 — Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) windows/CodeIsland.Windows.Smoke/Program.cs:190 — `catch (InvalidDataException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
Minor — 36 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×13
  • Duplicated predicate Sources/CodeIsland/Resources/codeisland-omp.ts:273 — `!existsSync(BRIDGE_PATH) || !socketIsOwnedByUser(SOCKET_PATH)` appears character-identically in 3 files — Sources/CodeIsland/Resources/codeisland-omp.ts, Sources/CodeIsland/Resources/codeisland-openclaw/index.ts, Sources/CodeIsland/Resources/codeisland-pi.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/CodeIsland/Resources/codeisland-omp.ts:132 — `env.HERDR_ENV !== "1" || !pane || !socket` appears character-identically in 2 files — Sources/CodeIsland/Resources/codeisland-omp.ts, Sources/CodeIsland/Resources/codeisland-pi.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/CodeIsland/Resources/codeisland-omp.ts:1060 — `event.toolName === "bash" && typeof event.input.command === "string" && isDangerous(event.input.command)` appears character-identically in 2 files — Sources/CodeIsland/Resources/codeisland-omp.ts, Sources/CodeIsland/Resources/codeisland-pi.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/CodeIsland/Resources/codeisland-omp.ts:1053 — `event.toolName === "edit" || event.toolName === "write"` appears character-identically in 2 files — Sources/CodeIsland/Resources/codeisland-omp.ts, Sources/CodeIsland/Resources/codeisland-pi.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate windows/CodeIsland.Bridge/Program.cs:98 — `message.Type == PipeMessageType.Event && message.Event is not null` appears character-identically in 2 files — windows/CodeIsland.Bridge/Program.cs, windows/CodeIsland.Windows/App.xaml.cs. 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 Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:41 — `cwd.contains("/.claude/worktrees/agent-") || cwd.contains("/.git/worktrees/agent-")` appears character-identically in 2 files — Sources/CodeIsland/Discovery/ClaudeDiscovery.swift, Sources/CodeIsland/Discovery/SessionDiscovery.swift. 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 Sources/CodeIsland/PushNotifier.swift:322 — `kind == .permission || kind == .question` appears character-identically in 2 files — Sources/CodeIsland/PushNotifier.swift, Sources/CodeIslandCore/PushPolicy.swift. 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 Sources/CodeIsland/TerminalActivator.swift:371 — `lower.contains("wezterm") || lower.contains("wez")` appears character-identically in 2 files — Sources/CodeIsland/TerminalActivator.swift, Sources/CodeIsland/TerminalVisibilityDetector.swift. 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 Sources/CodeIsland/AiWorkView.swift:299 — `pct > 0.03 && pct < 0.55 && sin(pct * 25) > 0` appears character-identically in 3 files — Sources/CodeIsland/AiWorkView.swift, Sources/CodeIsland/BuddyView.swift, Sources/CodeIsland/CursorView.swift. 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 Sources/CodeIslandCore/BackgroundCompactionFilter.swift:48 — `session == nil || session?.status == .idle` appears character-identically in 2 files — Sources/CodeIslandCore/BackgroundCompactionFilter.swift, Sources/CodeIslandCore/SessionSnapshot.swift. 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 Sources/CodeIsland/AppState+TranscriptTailer.swift:91 — `session.source == "cursor" || session.source == "cursor-cli"` appears character-identically in 2 files — Sources/CodeIsland/AppState+TranscriptTailer.swift, Sources/CodeIsland/AppState.swift. 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 Sources/CodeIsland/AppState+AiWorkWatch.swift:96 — `source == "aiwork" || source == "aiwork-cli"` appears character-identically in 3 files — Sources/CodeIsland/AppState+AiWorkWatch.swift, Sources/CodeIsland/ConfigInstaller.swift, Sources/CodeIsland/SettingsView.swift. 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 Sources/CodeIsland/AppState.swift:1843 — `source == "cursor" || source == "cursor-cli"` appears character-identically in 2 files — Sources/CodeIsland/AppState.swift, Sources/CodeIslandCore/SessionSnapshot.swift. 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 · ×8
  • Silent fallback default in catch windows/CodeIsland.Windows/SettingsStore.cs:24 — `Load` swallows `JsonException` into `return new AppSettings();` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Sources/CodeIsland/Resources/codeisland-remote-hook.py:219 — `_scan_session_jsonl` 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 Sources/CodeIsland/Resources/codeisland-remote-hook.py:314 — `_scan_codex_jsonl` 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 Sources/CodeIsland/Resources/codeisland-remote-hook.py:431 — `_read_stdin` swallows every exception into `return b''` — 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 Sources/CodeIsland/SessionPersistence.swift:181 — `load` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). 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`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Sources/CodeIsland/Discovery/GrokDiscovery.swift:236 — `grokDirectorySessionCandidates` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). 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`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Sources/CodeIslandCore/AiWorkWatchClient.swift:413 — `discoverReadyDaemons` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). 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`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Sources/CodeIslandCore/PushChannel.swift:190 — `encodeList` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). 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`, `guard` or `??`, or in the doc comment, and the row stops firing.
X9 · Subsumed condition operand · Subsumed condition operand · ×2
  • Subsumed condition operand Sources/CodeIsland/ConfigInstaller.swift:3042 — `trimmed.hasPrefix("[[")` can never decide this `||` — every value satisfying `trimmed.hasPrefix("[[")` also satisfies `trimmed.hasPrefix("[")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand Sources/CodeIsland/ConfigInstaller.swift:3111 — `trimmed.hasPrefix("[[")` can never decide this `||` — every value satisfying `trimmed.hasPrefix("[[")` also satisfies `trimmed.hasPrefix("[")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 2/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:7 — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 10237 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 · No dependency-update automation · ×1
  • No dependency-update automation windows/CodeIsland.Core.Tests/CodeIsland.Core.Tests.csproj:13 — `windows/CodeIsland.Core.Tests/CodeIsland.Core.Tests.csproj` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
PF1 · Benchmark discipline · No performance benchmarks · ×1
  • No performance benchmarks — No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
X2 · Cancellation propagation · Not all async methods take a CancellationToken · ×1
  • Not all async methods take a CancellationToken — Only 5/6 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
X5 · Nullable reference types · Null-forgiving operator (`!`) suppressions reduce the NRT score · ×1
  • Null-forgiving operator (`!`) suppressions reduce the NRT score — ~1.0 `!` suppressions per 1k syntax nodes — 34 suppression(s) across the 34205 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure windows/CodeIsland.Protocol/CodexTranscriptParser.cs:22 — `ParseLine` falls back to `DateTimeOffset.UtcNow` when `DateTimeOffset.TryParse(String(root, "timestamp"), out var parsed)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-b323914d39554e60929d13081c89b2ad/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-b323914d39554e60929d13081c89b2ad/tree.json --exit-code 0 --source .0artifacts/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/watchdog-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 .8artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnuget—nuget: not applicable — nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan0—
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update1artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
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 26 file(s) — `Sources/CodeIsland/AppState+CodexAppServer.swift`, `Sources/CodeIsland/AppState+ToolUseCache.swift`, `Sources/CodeIsland/AppState.swift`, `Sources/CodeIsland/ClineView.swift`, `Sources/CodeIsland/CodexPermissionRules.swift`, … (+21 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.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 01a186e1-0a83-7902-a2ce-a8684a324ee4 · 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