Public report of wxtsky/CodeIsland, published 15 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured 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 15 November 2026, 00:56 UTC, at code version 03c77e9
Code coverage is not measured: Suite not runnable in-image.
Boundary Type-Coupling is not measured: Bounded contexts not declared.
Knowledge freshness is not measured: Freshness signal contradicted by repo activity.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 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, 41
Findings by how serious they are
14 critical773 serious47 minor
17 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
15 November 2026, 00:56 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
51of 51 dimensions measured by tools.
821of 834 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
51dimensions across 6 lenses, read from 89,744 lines of product code in 10 projects.
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 53 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 41, is the weakest lens and counts most in the score. The best first step is removing the unread values, worth about 8 points. Removing the copied code would lift Code Health itself, worth about 7 points. Raising Code Health to 70 would lift the score to about 62.
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 €170,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 forThe 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.
If Code Health rose from 41 to 70, the lowest score rated Strong, the score would rise from 53 to about 62.
Code composition: what the lines of code are
Business logic 3%Supporting code 4%Tests 93%
New since the last survey: 139 findings
These 139 critical or serious findings weren't in the previous survey, on 29 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Code Duplication · Near-duplicate member family (12 members, 11 shared lines) Sources/CodeIsland/AiWorkView.swift
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copy of a member (22 corresponding lines) Sources/CodeIsland/CopilotView.swift
Code Duplication · Edited copy of a member (37 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift
Code Duplication · Edited copy of a member (29 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (36 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (40 corresponding lines) Sources/CodeIslandCore/HostHarness.swift
Code Duplication · Edited copy of a member (33 corresponding lines) Sources/CodeIsland/TerminalActivator.swift
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/CodeIsland/HermesView.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift
Code Duplication · Edited copies of one member (8 members, 17+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copy of a member (23 corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copy of a member (31 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) Sources/CodeIsland/CopilotView.swift
Code Duplication · Edited copy of a member (20 corresponding lines) Sources/CodeIsland/JSONMinimalEditor.swift
Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) Sources/CodeIsland/KiroView.swift
Code Duplication · Edited copy of a member (24 corresponding lines) Sources/CodeIsland/Discovery/GeminiDiscovery.swift
Code Duplication · Edited copy of a member (17 corresponding lines) windows/CodeIsland.Windows/DockShoulderGeometry.cs
Code Duplication · Edited copy of a member (29 corresponding lines) Sources/CodeIsland/NotchAnimation.swift
Code Duplication · Edited copy of a member (11 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift
Code Duplication · Edited copy of a member (24 corresponding lines) Sources/CodeIslandCore/AiWorkWatchClient.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/CodeIsland/AiWorkView.swift
Code Duplication · Edited copy of a member (22 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift
Code Duplication · Edited copy of a member (16 corresponding lines) Sources/CodeIsland/MinimaxView.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/StepFunView.swift
Code Duplication · Edited copy of a member (13 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (11 corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) Sources/CodeIsland/ClineView.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (28 corresponding lines) Sources/CodeIsland/AppState.swift
Code Duplication · Edited copy of a member (27 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift
Code Duplication · Edited copies of one member (6 members, 6+ corresponding lines) Sources/CodeIsland/AntiGravityView.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIsland/CodexPermissionRules.swift
Code Duplication · Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/PushChannel.swift
Code Duplication · Edited copy of a member (13 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift
Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copies of one member (7 members, 5+ corresponding lines) Sources/CodeIsland/ClineView.swift
Code Duplication · Edited copy of a member (18 corresponding lines) Sources/CodeIsland/AppState+AiWorkWatch.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/CodeIsland/RemoteInstaller.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/CodeIsland/AppState+SessionMetadata.swift
Code Duplication · Edited copy of a member (11 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift
Code Duplication · Edited copy of a member (18 corresponding lines) Sources/CodeIsland/Discovery/SessionDiscoveryCoordinator.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/CodeIslandCore/AiWorkWatchClient.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/AppState+PushNotifications.swift
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/CodeIslandCore/PushNotification.swift
Code Duplication · Edited copy of a member (5 corresponding lines) Sources/CodeIsland/PiView.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIslandCore/CoworkAuditLog.swift
Code Duplication · Edited copy of a member (11 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift
Code Duplication · Edited copy of a member (15 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift
Code Duplication · Edited copy of a member (12 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodeIsland/ConfigInstaller.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/Discovery/CopilotDiscovery.swift
Code Duplication · Edited copy of a member (19 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift
Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodeIsland/ConfigInstaller.swift
Code Duplication · Edited copy of a member (8 corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift
Code Duplication · Edited copy of a member (7 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/TerminalActivator.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/CodeIslandCore/Models.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIslandCore/ESP32Protocol.swift
Code Duplication · Edited copy of a member (13 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift
Code Duplication · Edited copies of one member (7 members, 4+ corresponding lines) Sources/CodeIsland/BuddyView.swift
Code Duplication · Edited copy of a member (11 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift
Code Duplication · Edited copy of a member (13 corresponding lines) Sources/CodeIsland/RemoteInstaller.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/CodeIslandCore/PushChannel.swift
Code Duplication · Edited copy of a member (9 corresponding lines) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift
Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodeIsland/ConfigInstaller.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/CodeIsland/NotchAnimation.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/CodeIsland/PanelWindowController.swift
Code Duplication · Edited copy of a member (7 corresponding lines) Sources/CodeIsland/SessionListOrdering.swift
Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/CodeIslandCore/MarkdownInlineLiterals.swift
Code Duplication · Edited copy of a member (13 corresponding lines) Sources/CodeIslandCore/Models.swift
Code Duplication · Edited copy of a member (16 corresponding lines) Sources/CodeIsland/TerminalVisibilityDetector.swift
Code Duplication · Edited copy of a member (6 corresponding lines) Sources/CodeIsland/Discovery/CodexDiscovery.swift
Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIsland/AppState+PushNotifications.swift
Code Duplication · Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/FollowUpReminderScheduler.swift
Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) Sources/CodeIsland/HostHarnessSupport.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIslandCore/ESP32Protocol.swift
Code Duplication · Edited copy of a member (3 corresponding lines) Sources/CodeIsland/AiWorkView.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIslandCore/SessionSnapshot.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/AppState.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIsland/SoundManager.swift
Code Duplication · Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/ModelLabel.swift
Code Duplication · Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift
Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodeIsland/CodexPermissionRules.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift
Code Duplication · Edited copy of a member (5 corresponding lines) Sources/CodeIsland/NotchPanelView.swift
Code Duplication · Edited copy of a member (6 corresponding lines) windows/CodeIsland.Windows/MainWindow.xaml.cs
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/CodeIsland/AppleCompanionPublisher.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/CodeIsland/Discovery/SQLiteReader.swift
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 55 findings
These 55 critical or serious findings were in the previous survey, on 29 October 2026, and are gone from this one.
Code Duplication · Near-duplicate member family (6 members, 11 shared lines) Sources/CodeIsland/AiWorkView.swift
Code Duplication · Near-duplicate member pair (30 shared lines) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift
Code Duplication · Edited copy of a member (13 corresponding lines) windows/CodeIsland.Windows/SettingsWindow.xaml.cs
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/CodeIslandCore/AppleCompanionPayload.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt
Exception handling · Swallowed exception (caught, then discarded) windows/CodeIsland.Windows.Smoke/Program.cs
Rebuild cost: about €170,000 · Estimate
Cost to rebuild
€58,000 to €290,000, for 968 to 3,073 hours of work, about 1.2 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 53. 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.
Size
Medium: 89,744 lines of product code
Comment lines
The estimate prices 89,736 lines. Comment lines count towards the size of 89,744 lines but aren't priced as work.
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.
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 8 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 8 points · Low effort · Explicit Debt
3
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.
Raises the score by about 7 points · Medium effort · Code Duplication
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 €170,000 to build again, about 1.2 person-years of work. Its weakest lens is Code Health, at 41 (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 8 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 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 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 75 to 449.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
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.
CodeIsland.Bluetooth uses CodeIsland.Core, so a change to CodeIsland.Core can break CodeIsland.Bluetooth, while a change to CodeIsland.Bluetooth can't break CodeIsland.Core.
Position
Below the diagonal: CodeIsland.Bluetooth uses a module listed above it, which is the healthy direction.
CodeIsland.Hooks uses CodeIsland.Core, so a change to CodeIsland.Core can break CodeIsland.Hooks, while a change to CodeIsland.Hooks can't break CodeIsland.Core.
Position
Below the diagonal: CodeIsland.Hooks uses a module listed above it, which is the healthy direction.
CodeIsland.Ipc uses CodeIsland.Core, so a change to CodeIsland.Core can break CodeIsland.Ipc, while a change to CodeIsland.Ipc can't break CodeIsland.Core.
Position
Below the diagonal: CodeIsland.Ipc uses a module listed above it, which is the healthy direction.
CodeIsland.Protocol uses CodeIsland.Core, so a change to CodeIsland.Core can break CodeIsland.Protocol, while a change to CodeIsland.Protocol can't break CodeIsland.Core.
Position
Below the diagonal: CodeIsland.Protocol uses a module listed above it, which is the healthy direction.
11→16 CodeIslandCore uses CodeIslandpart of a loop✕
Connections
208 pairs of types, where a type in CodeIslandCore uses a type in CodeIsland. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Sources.CodeIsland.Resources uses Sources.CodeIsland.Resources.codeisland-omp, so a change to Sources.CodeIsland.Resources.codeisland-omp can break Sources.CodeIsland.Resources, while a change to Sources.CodeIsland.Resources can't break Sources.CodeIsland.Resources.codeisland-omp.
Position
Below the diagonal: Sources.CodeIsland.Resources uses a module listed above it, which is the healthy direction.
Sources.CodeIsland.Resources uses Sources.CodeIsland.Resources.codeisland-openclaw, so a change to Sources.CodeIsland.Resources.codeisland-openclaw can break Sources.CodeIsland.Resources, while a change to Sources.CodeIsland.Resources can't break Sources.CodeIsland.Resources.codeisland-openclaw.
Position
Below the diagonal: Sources.CodeIsland.Resources uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.BuddyMascotView.Scene uses com.codeisland.buddywatch.BuddyMascotView, so a change to com.codeisland.buddywatch.BuddyMascotView can break com.codeisland.buddywatch.BuddyMascotView.Scene, while a change to com.codeisland.buddywatch.BuddyMascotView.Scene can't break com.codeisland.buddywatch.BuddyMascotView.
Position
Below the diagonal: com.codeisland.buddywatch.BuddyMascotView.Scene uses a module listed above it, which is the healthy direction.
14→18 com.codeisland.buddywatch.IncomingCommand uses com.codeisland.buddywatchpart of a loop✕
Connections
5 pairs of types, where a type in com.codeisland.buddywatch.IncomingCommand uses a type in com.codeisland.buddywatch.
com.codeisland.buddywatch.IncomingCommand uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.IncomingCommand, while a change to com.codeisland.buddywatch.IncomingCommand can't break com.codeisland.buddywatch.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
140 pairs of types, where a type in repository uses a type in CodeIsland. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
220 pairs of types, where a type in CodeIsland uses a type in CodeIslandCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
CodeIsland.Windows uses CodeIsland.Core, so a change to CodeIsland.Core can break CodeIsland.Windows, while a change to CodeIsland.Windows can't break CodeIsland.Core.
Position
Below the diagonal: CodeIsland.Windows uses a module listed above it, which is the healthy direction.
CodeIsland.Windows uses CodeIsland.Hooks, so a change to CodeIsland.Hooks can break CodeIsland.Windows, while a change to CodeIsland.Windows can't break CodeIsland.Hooks.
Position
Below the diagonal: CodeIsland.Windows uses a module listed above it, which is the healthy direction.
CodeIsland.Windows uses CodeIsland.Ipc, so a change to CodeIsland.Ipc can break CodeIsland.Windows, while a change to CodeIsland.Windows can't break CodeIsland.Ipc.
Position
Below the diagonal: CodeIsland.Windows uses a module listed above it, which is the healthy direction.
CodeIsland.Windows uses CodeIsland.Protocol, so a change to CodeIsland.Protocol can break CodeIsland.Windows, while a change to CodeIsland.Windows can't break CodeIsland.Protocol.
Position
Below the diagonal: CodeIsland.Windows uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch uses com.codeisland.buddywatch.BuddyMascotView, so a change to com.codeisland.buddywatch.BuddyMascotView can break com.codeisland.buddywatch, while a change to com.codeisland.buddywatch can't break com.codeisland.buddywatch.BuddyMascotView.
Position
Below the diagonal: com.codeisland.buddywatch uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch uses com.codeisland.buddywatch.IncomingCommand, so a change to com.codeisland.buddywatch.IncomingCommand can break com.codeisland.buddywatch, while a change to com.codeisland.buddywatch can't break com.codeisland.buddywatch.IncomingCommand.
Position
Below the diagonal: com.codeisland.buddywatch uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.AgentStatusCode uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.AgentStatusCode, while a change to com.codeisland.buddywatch.AgentStatusCode can't break com.codeisland.buddywatch.
Position
Below the diagonal: com.codeisland.buddywatch.AgentStatusCode uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.DisplayMode uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.DisplayMode, while a change to com.codeisland.buddywatch.DisplayMode can't break com.codeisland.buddywatch.
Position
Below the diagonal: com.codeisland.buddywatch.DisplayMode uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.HostUplinkDeliveryMode uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.HostUplinkDeliveryMode, while a change to com.codeisland.buddywatch.HostUplinkDeliveryMode can't break com.codeisland.buddywatch.
Position
Below the diagonal: com.codeisland.buddywatch.HostUplinkDeliveryMode uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.MainActivity uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.MainActivity, while a change to com.codeisland.buddywatch.MainActivity can't break com.codeisland.buddywatch.
Position
Below the diagonal: com.codeisland.buddywatch.MainActivity uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.Mascot uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.Mascot, while a change to com.codeisland.buddywatch.Mascot can't break com.codeisland.buddywatch.
Position
Below the diagonal: com.codeisland.buddywatch.Mascot uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.PeripheralState uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.PeripheralState, while a change to com.codeisland.buddywatch.PeripheralState can't break com.codeisland.buddywatch.
Position
Below the diagonal: com.codeisland.buddywatch.PeripheralState uses a module listed above it, which is the healthy direction.
com.codeisland.buddywatch.ScreenOrientation uses com.codeisland.buddywatch, so a change to com.codeisland.buddywatch can break com.codeisland.buddywatch.ScreenOrientation, while a change to com.codeisland.buddywatch.ScreenOrientation can't break com.codeisland.buddywatch.
Position
Below the diagonal: com.codeisland.buddywatch.ScreenOrientation uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 41% · Weak · gated by D2, R10, R3 ·
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 category
Findings
Severity
A05:2025 — Injection
8
High / Critical
A03:2025 — Software Supply Chain Failures
6
Medium
Roadmap
Top priorities: Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt — start with HookManager.cs; Resolve the 5 EmptyCatchBlock finding(s) in Explicit Debt — start with PipeServer.cs, App.xaml.cs, AppLogger.cs; 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.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt — start with HookManager.cs.
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.
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.
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.
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 — 773
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 — 47
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 17
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 51 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 51 dimensions across the health lenses
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
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, 821 of 834 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the test suite could not be built/run in-image (commonly external-service dependencies — a database, a broker — we won't provision). To have it measured, make the suite runnable without them. For context only, test code is ≈ 66% of production LoC (57,199 test / 86,647 production) — a rough proxy, NOT a coverage measurement, so it is excluded from the score. You can widen what we reach: optional: make the suite runnable without a database, broker or other service we do not provision, and real coverage is measured on the next scan.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Sources/CodeIsland/AppState+CodexAppServer.swift`, `Sources/CodeIsland/AppState+ToolUseCache.swift`, `Sources/CodeIsland/AppState.swift`, `Sources/CodeIsland/ClineView.swift`, `Sources/CodeIsland/CodexPermissionRules.swift`, … (+20 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. File-level freshness contradicts repo activity: 405 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.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (android-watch/app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:181)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConn…; runtime evidence skipped (launch chosen because android-watch/app/build.gradle.kts applies the Android application plugin and android-watch/gradlew builds it).
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X21 Side-effecting pattern guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
131 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.
+ 126 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 195 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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.2 to about 3.7/10.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
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).
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).
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).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
162 duplicated block group(s) detected. 8.0 % of the production lines (6,889 of 86,647) are in a reported copy. A further 139 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 131 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 18 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with AiWorkView.swift (2), SessionSnapshot.swift (2), DockShoulderGeometry.cs. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 11 Edited copy of a member (10 corresponding lines) finding(s) in Code Duplication — start with NotchPanelView.swift (2), StepFunView.swift, AppState+PushNotifications.swift. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 11 Edited copy of a member (9 corresponding lines) finding(s) in Code Duplication — start with NotchPanelView.swift (2), CodexPermissionRules.swift, CoworkAuditLog.swift. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
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
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
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.
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.
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.
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.
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.
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)
Resolve the 26 Hotspot finding(s) in Churn × Complexity Hotspots — start with SessionSnapshot.swift, AppState.swift, NotchPanelView.swift. — One of this dimension's main actionable groups (26 warning-level).
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.
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.
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).
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).
Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt — start with HookManager.cs. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
2 of 2 documentation facets pass in full. 11 document(s) read across 11 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
No ADRs foundwindows/CodeIsland.Bridge/CodeIsland.Bridge.csproj:10
What to do
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with CodeIsland.Bridge.csproj. — 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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
9 naming inconsistencies among 477 declarations measured against a convention their peers follow.
`peerID` spells `ID` where 470 names in the project spell it `Id` · ×2Sources/CodeIsland/AppleCompanionPublisher.swift:32
`serverID` spells `ID` where 470 names in the project spell it `Id` · ×2Sources/CodeIsland/CodexPermissionRules.swift:351
`declaredMCPServerID` spells `ID` where 470 names in the project spell it `Id`Sources/CodeIsland/CodexPermissionRules.swift:490
`nextID` spells `ID` where 470 names in the project spell it `Id`Sources/CodeIsland/GlobalHotKeyManager.swift:30
`CodexRequestID` spells `ID` where 470 names in the project spell it `Id`Sources/CodeIslandCore/CodexAppServerClient.swift:26
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 `peerID` spells `ID` where 470 names in the project spell it `Id` finding(s) in Naming Consistency — start with AppleCompanionPublisher.swift, CompanionConnection.swift. — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 2 `serverID` spells `ID` where 470 names in the project spell it `Id` finding(s) in Naming Consistency — start with CodexPermissionRules.swift (2). — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 `declaredMCPServerID` spells `ID` where 470 names in the project spell… finding(s) in Naming Consistency — start with CodexPermissionRules.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
Resolve the 4 redundant comment finding(s) in Comment Value — start with AssemblyInfo.cs (4). — One of this dimension's main actionable groups (4 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
12 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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.
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).
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
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
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.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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
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.
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.
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.
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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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.
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.
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.
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.
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.
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.
Do you agree with this assessment?
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.
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.
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.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
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.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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 3 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.
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.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
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().
Do you agree with this assessment?
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.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. 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.
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
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
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.
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 (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — 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)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.
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. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
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.
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 — 72 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.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX6 Interface segregation — AX6 reached only 7% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:181)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConn…; 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.
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.
D25 ADR Conformance — no ADRs to check
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) — 25 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.
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
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
IC1 Incompleteness & stubs — IC1 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found by the two searches this check runs — a BenchmarkDotNet package reference in any project file (loaded, or on disk), and a script whose name contains `benchmark` that this repository's CI runs. Neither can see a suite in another ecosystem's idiom, so this is not a verdict that the repository has none. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted, and nothing is asked of a repository that has none.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
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.
X1 Async correctness — X1 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X12 Unreachable branch — X12 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — X13 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — X18 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — X2 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X21 Side-effecting pattern guard — X21 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — X25 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — X27 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — X29 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X3 Exception handling — X3 reached only 4% of this repository's production lines — swift (76,829 lines), kotlin (2,996 lines), typescript (2,180 lines), c (1,614 lines), cpp (1,483 lines), python (619 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
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.
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.
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/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/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.
Hotspot: Sources/CodeIslandCore/PushNotification.swift Sources/CodeIslandCore/PushNotification.swift:297— Sources/CodeIslandCore/PushNotification.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in PushMessageFormatter.lines at line 297. 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/PushNotification.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/CodexThreadSubsession.swift Sources/CodeIslandCore/CodexThreadSubsession.swift:128— Sources/CodeIslandCore/CodexThreadSubsession.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in CodexThreadSubsession.link at line 128. 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/CodexThreadSubsession.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.
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.
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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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), AT OR 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.
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:194— Sources/CodeIsland/AiWorkView.swift:194-198 | Sources/CodeIsland/MiMoView.swift:152-156 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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:194` 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/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/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/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) 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 36 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.
Duplicated block (5 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:174— ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:174-178 | ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:431-435 — 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/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:174` 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 first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `5` in one and `1` 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) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:310— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:310-314 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:464-468 — 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.
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.
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· Edited copy of a member (10 corresponding lines) · ×11
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/StepFunView.swift:57— Sources/CodeIsland/StepFunView.swift:57-69 | Sources/CodeIsland/WorkBuddyView.swift:57-66 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:933— Sources/CodeIsland/NotchPanelView.swift:933-943 | ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:615-624 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/AppState+PushNotifications.swift:67— Sources/CodeIsland/AppState+PushNotifications.swift:67-76 | Sources/CodeIsland/AppState+PushNotifications.swift:79-88 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/Discovery/CopilotDiscovery.swift:7— Sources/CodeIsland/Discovery/CopilotDiscovery.swift:7-16 | Sources/CodeIsland/Discovery/CursorDiscovery.swift:22-31 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/TerminalActivator.swift:1420— Sources/CodeIsland/TerminalActivator.swift:1420-1431 | Sources/CodeIsland/TerminalActivator.swift:1438-1447 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIslandCore/ESP32Protocol.swift:376— Sources/CodeIslandCore/ESP32Protocol.swift:376-387 | Sources/CodeIslandCore/ESP32Protocol.swift:530-539 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:1975— Sources/CodeIsland/NotchPanelView.swift:1975-1984 | Sources/CodeIsland/NotchPanelView.swift:4829-4841 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIslandCore/SessionSnapshot.swift:2014— Sources/CodeIslandCore/SessionSnapshot.swift:2014-2026 | Sources/CodeIslandCore/SessionSnapshot.swift:2036-2045 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/AppState.swift:4595— Sources/CodeIsland/AppState.swift:4595-4604 | Sources/CodeIsland/AppState.swift:4690-4700 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:9— Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:9-18 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:20-29 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/CodeIsland/ESP32BridgeManager.swift:791— Sources/CodeIsland/ESP32BridgeManager.swift:791-800 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift:170-181 — These two members are one piece of code written twice and then edited apart: 10 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 (9 corresponding lines) · ×11
Edited copy of a member (9 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:2241— Sources/CodeIsland/NotchPanelView.swift:2241-2249 | Sources/CodeIsland/NotchPanelView.swift:2603-2614 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIsland/CodexPermissionRules.swift:378— Sources/CodeIsland/CodexPermissionRules.swift:378-391 | Sources/CodeIsland/NotchPanelView.swift:1627-1635 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIslandCore/CoworkAuditLog.swift:186— Sources/CodeIslandCore/CoworkAuditLog.swift:186-194 | Sources/CodeIslandCore/JSONLTailer.swift:710-718 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:1717— Sources/CodeIsland/NotchPanelView.swift:1717-1725 | Sources/CodeIsland/NotchPanelView.swift:1729-1737 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:205— ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:205-213 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:499-507 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIsland/AppState+PushNotifications.swift:22— Sources/CodeIsland/AppState+PushNotifications.swift:22-30 | Sources/CodeIsland/AppState+PushNotifications.swift:34-42 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIslandCore/ESP32Protocol.swift:560— Sources/CodeIslandCore/ESP32Protocol.swift:560-568 | Sources/CodeIslandCore/ESP32Protocol.swift:580-588 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIsland/SoundManager.swift:193— Sources/CodeIsland/SoundManager.swift:193-201 | Sources/CodeIsland/SoundManager.swift:204-213 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIsland/AppleCompanionPublisher.swift:193— Sources/CodeIsland/AppleCompanionPublisher.swift:193-202 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:480-488 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift:194— ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift:194-202 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift:204-213 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/CodeIslandCore/ChatMessageTextFormatter.swift:99— Sources/CodeIslandCore/ChatMessageTextFormatter.swift:99-107 | ios/CodeIslandCompanion/Shared/CompanionDisplayText.swift:130-138 — These two members are one piece of code written twice and then edited apart: 9 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.
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: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) 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.
Duplicated block (8 lines × 2) Sources/CodeIsland/NotchPanelView.swift:1188— Sources/CodeIsland/NotchPanelView.swift:1188-1195 | Sources/CodeIsland/NotchPanelView.swift:1362-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:1188` 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:1190— Sources/CodeIsland/TerminalActivator.swift:1190-1197 | Sources/CodeIsland/TerminalVisibilityDetector.swift:467-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 (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 16 separate duplicated blocks between them, totalling at least 119 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/AppState.swift:4515— Sources/CodeIsland/AppState.swift:4515-4521 | Sources/CodeIsland/AppState.swift:4621-4626 — 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 (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/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) Sources/CodeIsland/CodexPermissionRules.swift:386— Sources/CodeIsland/CodexPermissionRules.swift:386-391 | Sources/CodeIsland/NotchPanelView.swift:1630-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:386` 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 (6 lines × 2) Sources/CodeIsland/KiroView.swift:104— Sources/CodeIsland/KiroView.swift:104-109 | Sources/CodeIsland/MinimaxView.swift:126-131 — 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 (6 lines × 2) Sources/CodeIsland/NotchPanelView.swift:4807— Sources/CodeIsland/NotchPanelView.swift:4807-4812 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1234-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. 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 (6 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:394— ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:394-399 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1291-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:394` 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) 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.
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· Edited copy of a member (8 corresponding lines) · ×8
Edited copy of a member (8 corresponding lines) Sources/CodeIsland/AppState+SessionMetadata.swift:187— Sources/CodeIsland/AppState+SessionMetadata.swift:187-194 | Sources/CodeIslandCore/JSONLTailer.swift:479-490 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:876— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:876-885 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:960-967 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/CodeIslandCore/PushChannel.swift:563— Sources/CodeIslandCore/PushChannel.swift:563-570 | Sources/CodeIslandCore/PushChannel.swift:575-582 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift:2463— Sources/CodeIsland/ConfigInstaller.swift:2463-2470 | Sources/CodeIsland/ConfigInstaller.swift:2615-2622 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/CodeIsland/NotchAnimation.swift:74— Sources/CodeIsland/NotchAnimation.swift:74-87 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1313-1320 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/CodeIsland/Discovery/SQLiteReader.swift:52— Sources/CodeIsland/Discovery/SQLiteReader.swift:52-59 | Sources/CodeIslandCore/HermesSessionStore.swift:201-208 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/CodeIsland/AppState.swift:513— Sources/CodeIsland/AppState.swift:513-520 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:199-206 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/CodeIsland/ESP32BridgeManager.swift:690— Sources/CodeIsland/ESP32BridgeManager.swift:690-697 | Sources/CodeIsland/PanelWindowController.swift:550-566 — These two members are one piece of code written twice and then edited apart: 8 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.
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/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: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/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/ConfigInstaller.swift:206— Sources/CodeIsland/ConfigInstaller.swift:206-212 | Sources/CodeIsland/ConfigInstaller.swift:265-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. 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 (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· Edited copy of a member (11 corresponding lines) · ×6
Edited copy of a member (11 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift:105— Sources/CodeIslandCore/AppleCompanionPayload.swift:105-115 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:174-184 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1058— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1058-1068 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1149-1159 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1469— ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1469-1482 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1505-1515 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift:3238— Sources/CodeIsland/ConfigInstaller.swift:3238-3248 | Sources/CodeIsland/ConfigInstaller.swift:3250-3261 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1376— ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1376-1386 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1447-1459 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Sources/CodeIsland/AppleCompanionBluetoothPeripheral.swift:174— Sources/CodeIsland/AppleCompanionBluetoothPeripheral.swift:174-184 | Sources/CodeIsland/AppleCompanionBluetoothPeripheral.swift:186-197 — These two members are one piece of code written twice and then edited apart: 11 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 (7 corresponding lines) · ×6
Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/PushChannel.swift:420— Sources/CodeIslandCore/PushChannel.swift:420-426 | Sources/CodeIslandCore/PushChannel.swift:432-438 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:4806— Sources/CodeIsland/NotchPanelView.swift:4806-4812 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1233-1239 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/CodeIsland/SessionListOrdering.swift:321— Sources/CodeIsland/SessionListOrdering.swift:321-327 | Sources/CodeIsland/SessionListOrdering.swift:338-344 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/FollowUpReminderScheduler.swift:272— Sources/CodeIslandCore/FollowUpReminderScheduler.swift:272-283 | Sources/CodeIslandCore/FollowUpReminderScheduler.swift:292-298 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/ModelLabel.swift:186— Sources/CodeIslandCore/ModelLabel.swift:186-193 | Sources/CodeIslandCore/ModelLabel.swift:204-210 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift:221— Sources/CodeIslandCore/AppleCompanionPayload.swift:221-227 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:279-285 — These two members are one piece of code written twice and then edited apart: 7 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.
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: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.
Duplicated block (11 lines × 2) Sources/CodeIsland/GeminiView.swift:138— Sources/CodeIsland/GeminiView.swift:138-148 | Sources/CodeIsland/QwenView.swift:149-159 — before extracting anything, compare `Sources/CodeIsland/GeminiView.swift` and `Sources/CodeIsland/QwenView.swift` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 192 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 (11 lines × 2) Sources/CodeIsland/NotchPanelView.swift:1432— Sources/CodeIsland/NotchPanelView.swift:1432-1442 | Sources/CodeIsland/NotchPanelView.swift:1443-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `alignment` to `.leading` in one and `.top` 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 (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/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) 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.
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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×5
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.
Members sharing a duplicated core (5 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:674-685 | 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 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· Edited copy of a member (15 corresponding lines) · ×5
Edited copy of a member (15 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift:175— Sources/CodeIslandCore/AppleCompanionPayload.swift:175-189 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:244-260 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Sources/CodeIsland/AiWorkView.swift:194— Sources/CodeIsland/AiWorkView.swift:194-210 | Sources/CodeIsland/MiMoView.swift:152-166 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift:217— ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift:217-231 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionBluetoothCentral.swift:233-252 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Sources/CodeIslandCore/Models.swift:213— Sources/CodeIslandCore/Models.swift:213-227 | Sources/CodeIslandCore/Models.swift:238-252 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Sources/CodeIsland/PanelWindowController.swift:50— Sources/CodeIsland/PanelWindowController.swift:50-65 | Sources/CodeIsland/PanelWindowController.swift:76-90 — These two members are one piece of code written twice and then edited apart: 15 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) · ×5
Edited copy of a member (13 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:174— ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:174-188 | ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:431-443 — 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.
Edited copy of a member (13 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift:3482— Sources/CodeIsland/ConfigInstaller.swift:3482-3494 | Sources/CodeIsland/ConfigInstaller.swift:3528-3540 — 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.
Edited copy of a member (13 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1447— ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1447-1459 | ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:550-562 — 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.
Edited copy of a member (13 corresponding lines) Sources/CodeIsland/RemoteInstaller.swift:405— Sources/CodeIsland/RemoteInstaller.swift:405-417 | Sources/CodeIsland/RemoteInstaller.swift:419-432 — 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.
Edited copy of a member (13 corresponding lines) Sources/CodeIslandCore/Models.swift:783— Sources/CodeIslandCore/Models.swift:783-795 | Sources/CodeIslandCore/Models.swift:797-809 — 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.
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) 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.
Duplicated block (7 lines × 3) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:301— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:301-307 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:380-386 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:531-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:301` 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 (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 16 separate duplicated blocks between them, totalling at least 119 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.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×4
Edited copy of a member (6 corresponding lines) Sources/CodeIsland/Discovery/CodexDiscovery.swift:861— Sources/CodeIsland/Discovery/CodexDiscovery.swift:861-868 | Sources/CodeIslandCore/PushTransport.swift:98-103 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) windows/CodeIsland.Windows/MainWindow.xaml.cs:144— windows/CodeIsland.Windows/MainWindow.xaml.cs:144-149 | windows/CodeIsland.Windows/MainWindow.xaml.cs:193-198 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/CodeIsland/AppState+CoworkWatch.swift:58— Sources/CodeIsland/AppState+CoworkWatch.swift:58-63 | Sources/CodeIsland/AppState.swift:1366-1371 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) windows/CodeIsland.Protocol/CodexTranscriptParser.cs:147— windows/CodeIsland.Protocol/CodexTranscriptParser.cs:147-152 | windows/CodeIsland.Protocol/RawAgentEventNormalizer.cs:64-69 — These two members are one piece of code written twice and then edited apart: 6 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 (4 corresponding lines) · ×4
Edited copy of a member (4 corresponding lines) Sources/CodeIsland/Discovery/SQLiteReader.swift:83— Sources/CodeIsland/Discovery/SQLiteReader.swift:83-88 | Sources/CodeIslandCore/HermesSessionStore.swift:210-213 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/CodeIsland/AppleCompanionBluetoothPeripheral.swift:279— Sources/CodeIsland/AppleCompanionBluetoothPeripheral.swift:279-282 | Sources/CodeIslandCore/AiWorkWatchClient.swift:680-683 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/CodeIsland/HostHarnessSupport.swift:84— Sources/CodeIsland/HostHarnessSupport.swift:84-87 | Sources/CodeIslandBridge/main.swift:118-121 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/CodeIslandCore/ClaudeDesktopCodeSession.swift:30— Sources/CodeIslandCore/ClaudeDesktopCodeSession.swift:30-33 | Sources/CodeIslandCore/CoworkSession.swift:302-305 — These two members are one piece of code written twice and then edited apart: 4 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.
Duplicated block (13 lines × 2) Sources/CodeIsland/AppState+TranscriptTailer.swift:66— Sources/CodeIsland/AppState+TranscriptTailer.swift:66-78 | Sources/CodeIsland/AppState+TranscriptTailer.swift:239-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.
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/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/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.
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 23 separate duplicated blocks between them, totalling at least 192 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/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.
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.
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· Edited copy of a member (16 corresponding lines) · ×3
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.
Edited copy of a member (16 corresponding lines) Sources/CodeIsland/MinimaxView.swift:126— Sources/CodeIsland/MinimaxView.swift:126-148 | Sources/CodeIsland/OpenClawView.swift:121-136 — 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.
Edited copy of a member (16 corresponding lines) Sources/CodeIsland/TerminalVisibilityDetector.swift:312— Sources/CodeIsland/TerminalVisibilityDetector.swift:312-329 | Sources/CodeIsland/TerminalVisibilityDetector.swift:359-374 — 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
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.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×3
Edited copy of a member (14 corresponding lines) Sources/CodeIsland/HermesView.swift:76— Sources/CodeIsland/HermesView.swift:76-89 | Sources/CodeIsland/TraeView.swift:77-96 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/CodeIslandCore/PushNotification.swift:470— Sources/CodeIslandCore/PushNotification.swift:470-484 | Sources/CodeIslandCore/PushNotification.swift:488-501 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/CodeIslandCore/MarkdownInlineLiterals.swift:117— Sources/CodeIslandCore/MarkdownInlineLiterals.swift:117-130 | Sources/CodeIslandCore/MarkdownInlineLiterals.swift:132-145 — These two members are one piece of code written twice and then edited apart: 14 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 (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) windows/CodeIsland.Windows/DockShoulderGeometry.cs:28— windows/CodeIsland.Windows/DockShoulderGeometry.cs:28-44 | windows/CodeIsland.Windows/DockShoulderGeometry.cs:47-63 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Sources/CodeIsland/RemoteInstaller.swift:1705— Sources/CodeIsland/RemoteInstaller.swift:1705-1721 | Sources/CodeIsland/SSHForwarder.swift:160-176 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Sources/CodeIslandCore/AiWorkWatchClient.swift:195— Sources/CodeIslandCore/AiWorkWatchClient.swift:195-215 | Sources/CodeIslandCore/CodexAppServerClient.swift:236-252 — These two members are one piece of code written twice and then edited apart: 17 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 (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) Sources/CodeIsland/PiView.swift:66— Sources/CodeIsland/PiView.swift:66-70 | Sources/CodeIsland/PiView.swift:72-76 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:3376— Sources/CodeIsland/NotchPanelView.swift:3376-3380 | Sources/CodeIsland/NotchPanelView.swift:3512-3516 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Sources/CodeIslandCore/CursorSessionFolding.swift:14— Sources/CodeIslandCore/CursorSessionFolding.swift:14-21 | Sources/CodeIslandCore/ModelLabel.swift:216-220 — These two members are one piece of code written twice and then edited apart: 5 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 copies of one member (3 members, 9+ corresponding lines) · ×3
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodeIsland/ConfigInstaller.swift:2453— Sources/CodeIsland/ConfigInstaller.swift:2453-2461 | Sources/CodeIsland/ConfigInstaller.swift:2605-2613 | Sources/CodeIsland/ConfigInstaller.swift:2768-2776 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodeIsland/ConfigInstaller.swift:3508— Sources/CodeIsland/ConfigInstaller.swift:3508-3518 | Sources/CodeIsland/ConfigInstaller.swift:3549-3561 | Sources/CodeIsland/ConfigInstaller.swift:3681-3689 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Sources/CodeIsland/CodexPermissionRules.swift:601— Sources/CodeIsland/CodexPermissionRules.swift:601-609 | Sources/CodeIslandCore/AgentTaskParsing.swift:117-125 | Sources/CodeIslandCore/Models.swift:766-774 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×3
Edited copy of a member (3 corresponding lines) Sources/CodeIsland/AiWorkView.swift:149— Sources/CodeIsland/AiWorkView.swift:149-153 | Sources/CodeIsland/MiMoView.swift:136-138 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Sources/CodeIsland/CursorView.swift:44— Sources/CodeIsland/CursorView.swift:44-46 | Sources/CodeIsland/MiMoView.swift:43-45 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:146— ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:146-148 | ios/CodeIslandCompanion/Shared/CodeIslandActivityAttributes.swift:13-15 — These two members are one piece of code written twice and then edited apart: 3 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.
Duplicated block (14 lines × 2) Sources/CodeIslandCore/AppleCompanionPayload.swift:145— Sources/CodeIslandCore/AppleCompanionPayload.swift:145-158 | 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 36 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.
Duplicated block (14 lines × 2) Sources/CodeIsland/Discovery/GeminiDiscovery.swift:112— Sources/CodeIsland/Discovery/GeminiDiscovery.swift:112-125 | Sources/CodeIsland/Discovery/SessionDiscovery.swift:231-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:112` 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 (14 lines × 2) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:221— ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:221-234 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:312-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:221` 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 first that the copies are not typed on the same thing: the declarations holding them bind `size` to `34) VStack(alignment: .leading` in one and `40) VStack(alignment: .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.
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 (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 14 separate duplicated blocks between them, totalling at least 108 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.
Duplicated block (6 lines × 5) 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:675-680 | 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 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 (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 14 separate duplicated blocks between them, totalling at least 108 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.
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· Edited copy of a member (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) Sources/CodeIsland/CopilotView.swift:61— Sources/CodeIsland/CopilotView.swift:61-82 | Sources/CodeIsland/OpenClawView.swift:51-80 — These two members are one piece of code written twice and then edited apart: 22 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.
Edited copy of a member (22 corresponding lines) Sources/CodeIsland/ConfigInstaller.swift:2430— Sources/CodeIsland/ConfigInstaller.swift:2430-2451 | Sources/CodeIsland/ConfigInstaller.swift:2581-2603 — These two members are one piece of code written twice and then edited apart: 22 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 (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:1637— Sources/CodeIsland/NotchPanelView.swift:1637-1665 | Sources/CodeIslandCore/Models.swift:565-624 — These two members are one piece of code written twice and then edited apart: 29 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.
Edited copy of a member (29 corresponding lines) Sources/CodeIsland/NotchAnimation.swift:89— Sources/CodeIsland/NotchAnimation.swift:89-123 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1326-1354 — These two members are one piece of code written twice and then edited apart: 29 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 (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) Sources/CodeIsland/Discovery/GeminiDiscovery.swift:102— Sources/CodeIsland/Discovery/GeminiDiscovery.swift:102-125 | Sources/CodeIsland/Discovery/SessionDiscovery.swift:221-244 — These two members are one piece of code written twice and then edited apart: 24 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.
Edited copy of a member (24 corresponding lines) Sources/CodeIslandCore/AiWorkWatchClient.swift:334— Sources/CodeIslandCore/AiWorkWatchClient.swift:334-357 | Sources/CodeIslandCore/CodexAppServerClient.swift:334-357 — These two members are one piece of code written twice and then edited apart: 24 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 copies of one member (6 members, 6+ corresponding lines) · ×2
Edited copies of one member (6 members, 6+ corresponding lines) Sources/CodeIsland/AntiGravityView.swift:76— Sources/CodeIsland/AntiGravityView.swift:76-81 | Sources/CodeIsland/BuddyView.swift:123-129 | Sources/CodeIsland/CursorView.swift:126-132 | Sources/CodeIsland/DroidView.swift:97-103 | Sources/CodeIsland/StepFunView.swift:71-77 | Sources/CodeIsland/WorkBuddyView.swift:68-73 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 6+ corresponding lines) Sources/CodeIsland/HostHarnessSupport.swift:61— Sources/CodeIsland/HostHarnessSupport.swift:61-66 | Sources/CodeIsland/ProcessTable.swift:47-52 | Sources/CodeIsland/ProcessTable.swift:89-94 | Sources/CodeIsland/ProcessTable.swift:97-102 | Sources/CodeIsland/TerminalActivator.swift:447-452 | Sources/CodeIslandBridge/main.swift:87-92 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) Sources/CodeIsland/AppState+AiWorkWatch.swift:92— Sources/CodeIsland/AppState+AiWorkWatch.swift:92-114 | Sources/CodeIsland/AppState+AiWorkWatch.swift:117-134 — These two members are one piece of code written twice and then edited apart: 18 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.
Edited copy of a member (18 corresponding lines) Sources/CodeIsland/Discovery/SessionDiscoveryCoordinator.swift:119— Sources/CodeIsland/Discovery/SessionDiscoveryCoordinator.swift:119-146 | Sources/CodeIsland/Discovery/SessionDiscoveryCoordinator.swift:185-202 — These two members are one piece of code written twice and then edited apart: 18 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 copies of one member (3 members, 6+ corresponding lines) · ×2
Edited copies of one member (3 members, 6+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:930— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:930-935 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:991-996 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1087-1092 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) Sources/CodeIsland/HostHarnessSupport.swift:68— Sources/CodeIsland/HostHarnessSupport.swift:68-73 | Sources/CodeIsland/ProcessTable.swift:26-31 | Sources/CodeIslandBridge/main.swift:80-85 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×2
Edited copies of one member (3 members, 5+ corresponding lines) Sources/CodeIsland/Resources/codeisland-remote-hook.py:110— Sources/CodeIsland/Resources/codeisland-remote-hook.py:110-114 | Sources/CodeIsland/Resources/codeisland-remote-hook.py:122-127 | Sources/CodeIsland/Resources/codeisland-remote-hook.py:131-136 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Sources/CodeIsland/TerminalActivator.swift:1534— Sources/CodeIsland/TerminalActivator.swift:1534-1538 | Sources/CodeIslandCore/DisplayOnlyWait.swift:107-112 | ios/CodeIslandCompanion/Shared/CompanionDisplayText.swift:92-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 5+ corresponding lines) · ×2
Edited copies of one member (4 members, 5+ corresponding lines) Sources/CodeIslandCore/CoworkSession.swift:221— Sources/CodeIslandCore/CoworkSession.swift:221-225 | Sources/CodeIslandCore/JSONLTailer.swift:720-724 | Sources/CodeIslandCore/Models.swift:760-764 | Sources/CodeIslandCore/PushPolicy.swift:322-326 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 5+ corresponding lines) Sources/CodeIslandCore/HermesHookPayload.swift:34— Sources/CodeIslandCore/HermesHookPayload.swift:34-38 | Sources/CodeIslandCore/HermesSessionStore.swift:138-142 | Sources/CodeIslandCore/HookEdgeFacts.swift:102-106 | Sources/CodeIslandCore/SubsessionRouter.swift:327-333 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (21 lines × 2) Sources/CodeIslandCore/SessionSnapshot.swift:1661— Sources/CodeIslandCore/SessionSnapshot.swift:1661-1681 | Sources/CodeIslandCore/SessionSnapshot.swift:2175-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.
Duplicated block (21 lines × 2) ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:820— ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:820-840 | ios/CodeIslandCompanion/CodeIslandCompanion/ContentView.swift:1048-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:820` 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 first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `12` in one and `4` 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, `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.
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.
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.
Duplicated block (16 lines × 2) Sources/CodeIsland/ClineView.swift:57— Sources/CodeIsland/ClineView.swift:57-72 | Sources/CodeIsland/KimiView.swift:57-72 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/KimiView.swift` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 192 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:57` 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 × 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 17 separate duplicated blocks between them, totalling at least 141 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (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.
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.
Duplicated block (8–9 lines × 2) Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:285— Sources/CodeIsland/Discovery/ClaudeDiscovery.swift:285-293 | Sources/CodeIsland/Discovery/CodexDiscovery.swift:913-920 — 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. 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–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.
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 12 separate duplicated blocks between them, totalling at least 99 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 17 separate duplicated blocks between them, totalling at least 141 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.
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 14 separate duplicated blocks between them, totalling at least 108 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
top-level statements (cyclomatic 38) windows/CodeIsland.Windows.Smoke/Program.cs:8— top-level statements has cyclomatic complexity 38 (threshold 15). Of this number, 36 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
top-level statements (cyclomatic 16) windows/CodeIsland.Bridge/Program.cs:7— top-level statements 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
top-level statements (cognitive 30) windows/CodeIsland.Windows.Smoke/Program.cs:8— top-level statements has cognitive complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
top-level statements (cognitive 23) windows/CodeIsland.Bridge/Program.cs:7— top-level statements has cognitive complexity 23 (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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
D4 · Code Duplication· Near-duplicate member family (12 members, 11 shared lines) · ×1
Near-duplicate member family (12 members, 11 shared lines) Sources/CodeIsland/AiWorkView.swift:219— Sources/CodeIsland/AiWorkView.swift:219-259 | Sources/CodeIsland/BuddyView.swift:193-228 | Sources/CodeIsland/ClineView.swift:173-208 | Sources/CodeIsland/CopilotView.swift:176-222 | Sources/CodeIsland/CursorView.swift:194-230 | Sources/CodeIsland/DroidView.swift:171-206 | Sources/CodeIsland/GeminiView.swift:163-201 | Sources/CodeIsland/KimiView.swift:154-190 | Sources/CodeIsland/OpenCodeView.swift:187-222 | Sources/CodeIsland/QoderView.swift:168-203 | Sources/CodeIsland/QwenView.swift:174-211 | Sources/CodeIsland/TraeView.swift:164-200 — These 12 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 12 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 12 times.
D4 · Code Duplication· Near-duplicate member family (7 members, 13 shared lines) · ×1
Near-duplicate member family (7 members, 13 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 13 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 (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· 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· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
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.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:194— ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:194-238 | ios/CodeIslandCompanion/CodeIslandCompanionWidget/CodeIslandLiveActivityWidget.swift:479-515 — These two members are one piece of code written twice and then edited apart: 37 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 (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:2819— Sources/CodeIsland/NotchPanelView.swift:2819-2854 | Sources/CodeIsland/NotchPanelView.swift:2869-2914 — These two members are one piece of code written twice and then edited apart: 36 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) Sources/CodeIslandCore/HostHarness.swift:313— Sources/CodeIslandCore/HostHarness.swift:313-352 | Sources/CodeIslandCore/HostHarness.swift:361-405 — These two members are one piece of code written twice and then edited apart: 40 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 (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) Sources/CodeIsland/TerminalActivator.swift:1150— Sources/CodeIsland/TerminalActivator.swift:1150-1213 | Sources/CodeIsland/TerminalVisibilityDetector.swift:449-481 — These two members are one piece of code written twice and then edited apart: 33 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 copies of one member (8 members, 17+ corresponding lines) · ×1
Edited copies of one member (8 members, 17+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:323— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:323-348 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:401-422 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:478-500 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:553-572 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:624-641 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:687-703 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:752-769 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:813-830 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 17 lines, 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 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. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:73— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:73-95 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:97-123 — These two members are one piece of code written twice and then edited apart: 23 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 (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:5829— Sources/CodeIsland/NotchPanelView.swift:5829-5867 | ios/CodeIslandCompanion/Shared/CompanionDisplayText.swift:171-201 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) Sources/CodeIsland/CopilotView.swift:85— Sources/CodeIsland/CopilotView.swift:85-97 | Sources/CodeIsland/MinimaxView.swift:52-62 | Sources/CodeIsland/PiView.swift:90-97 | Sources/CodeIsland/QoderView.swift:90-105 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) Sources/CodeIsland/JSONMinimalEditor.swift:158— Sources/CodeIsland/JSONMinimalEditor.swift:158-177 | Sources/CodeIsland/JSONMinimalEditor.swift:271-292 — These two members are one piece of code written twice and then edited apart: 20 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 copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) Sources/CodeIsland/KiroView.swift:122— Sources/CodeIsland/KiroView.swift:122-147 | Sources/CodeIsland/MinimaxView.swift:151-185 | Sources/CodeIsland/OpenClawView.swift:139-166 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) Sources/CodeIsland/ClineView.swift:89— Sources/CodeIsland/ClineView.swift:89-95 | Sources/CodeIsland/GeminiView.swift:85-91 | Sources/CodeIsland/KimiView.swift:80-86 | Sources/CodeIsland/QwenView.swift:98-104 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) Sources/CodeIsland/AppState.swift:2235— Sources/CodeIsland/AppState.swift:2235-2262 | Sources/CodeIsland/AppState.swift:2519-2546 — These two members are one piece of code written twice and then edited apart: 28 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 (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift:132— Sources/CodeIslandCore/AppleCompanionPayload.swift:132-158 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:201-227 — These two members are one piece of code written twice and then edited apart: 27 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 copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:309— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:309-321 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:388-399 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:463-476 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 5+ corresponding lines) · ×1
Edited copies of one member (7 members, 5+ corresponding lines) Sources/CodeIsland/ClineView.swift:102— Sources/CodeIsland/ClineView.swift:102-106 | Sources/CodeIsland/HermesView.swift:95-99 | Sources/CodeIsland/KimiView.swift:93-97 | Sources/CodeIsland/QwenView.swift:111-115 | Sources/CodeIsland/StepFunView.swift:83-87 | Sources/CodeIsland/TraeView.swift:103-107 | Sources/CodeIsland/WorkBuddyView.swift:79-83 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×1
Edited copy of a member (12 corresponding lines) Sources/CodeIsland/NotchPanelView.swift:5258— Sources/CodeIsland/NotchPanelView.swift:5258-5269 | Sources/CodeIsland/NotchPanelView.swift:5274-5286 — These two members are one piece of code written twice and then edited apart: 12 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 (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) Sources/CodeIslandCore/AppleCompanionPayload.swift:81— Sources/CodeIslandCore/AppleCompanionPayload.swift:81-99 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:150-168 — These two members are one piece of code written twice and then edited apart: 19 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 copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) Sources/CodeIsland/ConfigInstaller.swift:205— Sources/CodeIsland/ConfigInstaller.swift:205-212 | Sources/CodeIsland/ConfigInstaller.swift:264-271 | Sources/CodeIsland/ConfigInstaller.swift:284-294 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:99— Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:99-108 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:110-119 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:121-130 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 4+ corresponding lines) · ×1
Edited copies of one member (7 members, 4+ corresponding lines) Sources/CodeIsland/BuddyView.swift:136— Sources/CodeIsland/BuddyView.swift:136-140 | Sources/CodeIsland/CopilotView.swift:108-111 | Sources/CodeIsland/CursorView.swift:139-142 | Sources/CodeIsland/DexView.swift:120-123 | Sources/CodeIsland/DroidView.swift:110-114 | Sources/CodeIsland/OpenCodeView.swift:132-135 | Sources/CodeIsland/QoderView.swift:112-115 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1355— android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1355-1361 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1373-1379 | android-watch/app/src/main/java/com/codeisland/buddywatch/BuddyMascotView.kt:1390-1396 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) Sources/CodeIsland/TerminalActivator.swift:1510— Sources/CodeIsland/TerminalActivator.swift:1510-1513 | Sources/CodeIsland/TerminalVisibilityDetector.swift:541-544 | Sources/CodeIslandCore/PushChannel.swift:480-484 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) Sources/CodeIsland/CompactBarRotation.swift:25— Sources/CodeIsland/CompactBarRotation.swift:25-33 | Sources/CodeIsland/ESP32FocusCoordinator.swift:21-29 | Sources/CodeIsland/ESP32StatePublisher.swift:438-446 | ios/CodeIslandCompanion/CodeIslandCompanion/CompanionModels.swift:40-48 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
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.
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.
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.
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.
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.
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 36 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.
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.
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.
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 14 separate duplicated blocks between them, totalling at least 130 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.
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 23 separate duplicated blocks between them, totalling at least 192 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.
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.
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 14 separate duplicated blocks between them, totalling at least 130 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.
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.
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 (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.
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.
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 14 separate duplicated blocks between them, totalling at least 108 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.
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.
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.
Duplicated block (15 lines × 2) ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:122— ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:122-136 | ios/CodeIslandCompanion/CodeIslandWatchApp/WatchContentView.swift:338-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: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 (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 20 separate duplicated blocks between them, totalling at least 162 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.
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 12 separate duplicated blocks between them, totalling at least 99 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.
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 14 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/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.
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 12 separate duplicated blocks between them, totalling at least 100 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.
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 14 separate duplicated blocks between them, totalling at least 108 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.
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 (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.
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 12 separate duplicated blocks between them, totalling at least 99 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.
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.
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.
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.
Duplicated block (7 lines × 16) Sources/CodeIsland/AiWorkView.swift:178— Sources/CodeIsland/AiWorkView.swift:178-184 | Sources/CodeIsland/BuddyView.swift:155-161 | Sources/CodeIsland/ClineView.swift:131-137 | Sources/CodeIsland/CopilotView.swift:134-140 | Sources/CodeIsland/CursorView.swift:157-163 | Sources/CodeIsland/DexView.swift:140-146 | Sources/CodeIsland/DroidView.swift:129-135 | Sources/CodeIsland/GeminiView.swift:119-125 | Sources/CodeIsland/KimiView.swift:112-118 | Sources/CodeIsland/MiMoView.swift:169-175 | Sources/CodeIsland/OpenCodeView.swift:150-156 | Sources/CodeIsland/PiView.swift:115-121 | Sources/CodeIsland/QoderView.swift:130-136 | Sources/CodeIsland/QwenView.swift:130-136 | Sources/CodeIsland/StepFunView.swift:105-111 | Sources/CodeIsland/TraeView.swift:122-128 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 99 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.
Duplicated block (8 lines × 13) Sources/CodeIsland/AiWorkView.swift:240— Sources/CodeIsland/AiWorkView.swift:240-247 | Sources/CodeIsland/BuddyView.swift:212-219 | Sources/CodeIsland/ClineView.swift:191-198 | Sources/CodeIsland/CopilotView.swift:204-211 | Sources/CodeIsland/CursorView.swift:214-221 | Sources/CodeIsland/DexView.swift:219-226 | Sources/CodeIsland/DroidView.swift:190-197 | Sources/CodeIsland/GeminiView.swift:185-192 | Sources/CodeIsland/KimiView.swift:174-181 | Sources/CodeIsland/OpenCodeView.swift:206-213 | Sources/CodeIsland/QoderView.swift:187-194 | Sources/CodeIsland/QwenView.swift:195-202 | Sources/CodeIsland/TraeView.swift:184-191 — before extracting anything, compare `Sources/CodeIsland/AiWorkView.swift` and `Sources/CodeIsland/BuddyView.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 99 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. ★ 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 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 (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 16 separate duplicated blocks between them, totalling at least 133 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.
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.
Duplicated block (8 lines × 5) Sources/CodeIsland/AntiGravityView.swift:93— Sources/CodeIsland/AntiGravityView.swift:93-100 | Sources/CodeIsland/HermesView.swift:101-108 | Sources/CodeIsland/PiView.swift:99-106 | Sources/CodeIsland/StepFunView.swift:89-96 | Sources/CodeIsland/WorkBuddyView.swift:85-92 — before extracting anything, compare `Sources/CodeIsland/AntiGravityView.swift` and `Sources/CodeIsland/HermesView.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 108 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 (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 14 separate duplicated blocks between them, totalling at least 108 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.
Duplicated block (9 lines × 4) Sources/CodeIsland/BuddyView.swift:171— Sources/CodeIsland/BuddyView.swift:171-179 | Sources/CodeIsland/CursorView.swift:173-181 | Sources/CodeIsland/OpenCodeView.swift:166-174 | Sources/CodeIsland/QoderView.swift:146-154 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/CursorView.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 139 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 × 3) Sources/CodeIsland/Discovery/CodexDiscovery.swift:887— Sources/CodeIsland/Discovery/CodexDiscovery.swift:887-892 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:193-198 | Sources/CodeIsland/Discovery/FlatStoreDiscovery.swift:228-233 — 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/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 × 24) 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 — 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. 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.
Duplicated block (11 lines × 20) 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 — 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.
Duplicated block (11 lines × 13) Sources/CodeIsland/BuddyView.swift:284— Sources/CodeIsland/BuddyView.swift:284-294 | Sources/CodeIsland/ClineView.swift:259-269 | Sources/CodeIsland/CopilotView.swift:285-295 | Sources/CodeIsland/CursorView.swift:285-295 | Sources/CodeIsland/DexView.swift:304-314 | Sources/CodeIsland/DroidView.swift:262-272 | Sources/CodeIsland/GeminiView.swift:254-264 | Sources/CodeIsland/KimiView.swift:242-252 | Sources/CodeIsland/OpenCodeView.swift:273-283 | Sources/CodeIsland/PixelCharacterView.swift:381-391 | Sources/CodeIsland/QoderView.swift:254-264 | Sources/CodeIsland/QwenView.swift:263-273 | Sources/CodeIsland/TraeView.swift:252-262 — before extracting anything, compare `Sources/CodeIsland/BuddyView.swift` and `Sources/CodeIsland/ClineView.swift` as WHOLE FILES: this scan already matched 14 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/BuddyView.swift:284` 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 (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 17 separate duplicated blocks between them, totalling at least 141 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.
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 12 separate duplicated blocks between them, totalling at least 99 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.
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.
Duplicated block (7 lines × 5) Sources/CodeIsland/ClineView.swift:154— Sources/CodeIsland/ClineView.swift:154-160 | Sources/CodeIsland/GeminiView.swift:144-150 | Sources/CodeIsland/KimiView.swift:135-141 | Sources/CodeIsland/QwenView.swift:155-161 | Sources/CodeIsland/TraeView.swift:145-151 — before extracting anything, compare `Sources/CodeIsland/ClineView.swift` and `Sources/CodeIsland/GeminiView.swift` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 162 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.
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 23 separate duplicated blocks between them, totalling at least 192 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.
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 16 separate duplicated blocks between them, totalling at least 133 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.
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.
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.
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.
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 12 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
redundant comment windows/CodeIsland.Windows/AssemblyInfo.cs:4— "where theme specific resource dictionaries are located" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment windows/CodeIsland.Windows/AssemblyInfo.cs:5— "(used if a resource is not found in the page, or application resource dictionaries)" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment windows/CodeIsland.Windows/AssemblyInfo.cs:7— "where the generic resource dictionary is located" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment windows/CodeIsland.Windows/AssemblyInfo.cs:8— "(used if a resource is not found in the page, app, or any theme specific resource dictionaries)" is Visual Studio AssemblyInfo template text, left in place. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D21 · Naming Consistency· `peerID` spells `ID` where 470 names in the project spell it `Id` · ×2
`peerID` spells `ID` where 470 names in the project spell it `Id` Sources/CodeIsland/AppleCompanionPublisher.swift:32— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `peerId`. [rule N6]
`peerID` spells `ID` where 470 names in the project spell it `Id` ios/CodeIslandCompanion/CodeIslandCompanion/CompanionConnection.swift:27— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `peerId`. [rule N6]
D21 · Naming Consistency· `serverID` spells `ID` where 470 names in the project spell it `Id` · ×2
`serverID` spells `ID` where 470 names in the project spell it `Id` Sources/CodeIsland/CodexPermissionRules.swift:351— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `serverId`. [rule N6]
`serverID` spells `ID` where 470 names in the project spell it `Id` Sources/CodeIsland/CodexPermissionRules.swift:534— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `serverId`. [rule N6]
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.
No ADRs found windows/CodeIsland.Bridge/CodeIsland.Bridge.csproj:10— 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/`. ADRs are expected here because `windows/CodeIsland.Bridge/CodeIsland.Bridge.csproj` makes this repository a deployable product (line 10).
D21 · Naming Consistency· `declaredMCPServerID` spells `ID` where 470 names in the project spell it `Id` · ×1
`declaredMCPServerID` spells `ID` where 470 names in the project spell it `Id` Sources/CodeIsland/CodexPermissionRules.swift:490— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `declaredMCPServerId`. [rule N6]
D21 · Naming Consistency· `nextID` spells `ID` where 470 names in the project spell it `Id` · ×1
`nextID` spells `ID` where 470 names in the project spell it `Id` Sources/CodeIsland/GlobalHotKeyManager.swift:30— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `nextId`. [rule N6]
D21 · Naming Consistency· `CodexRequestID` spells `ID` where 470 names in the project spell it `Id` · ×1
`CodexRequestID` spells `ID` where 470 names in the project spell it `Id` Sources/CodeIslandCore/CodexAppServerClient.swift:26— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `CodexRequestId`. [rule N6]
D21 · Naming Consistency· `MascotID` spells `ID` where 470 names in the project spell it `Id` · ×1
`MascotID` spells `ID` where 470 names in the project spell it `Id` Sources/CodeIslandCore/ESP32Protocol.swift:193— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `MascotId`. [rule N6]
D21 · Naming Consistency· `activityID` spells `ID` where 470 names in the project spell it `Id` · ×1
`activityID` spells `ID` where 470 names in the project spell it `Id` ios/CodeIslandCompanion/CodeIslandCompanion/LiveActivityController.swift:9— 470 of 479 names in project CodeIsland spell the token `Id` (470 of 479; unit: names in project CodeIsland containing `Id`). Peers: AppState.startAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:28); AppState.finishAgentTaskBackfill(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:54); AppState.applyAgentTaskTranscriptEvents(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:110); AppState.replayAgentTaskHistory(sessionId) (Sources/CodeIsland/AppState+AgentTasks.swift:125); AppState.startAiWorkWatchClient(agentId) (Sources/CodeIsland/AppState+AiWorkWatch.swift:249). Rename to `activityId`. [rule N6]
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.
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: `.`.
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 3 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.
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`.
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.
Null-forgiving operator (`!`) suppressions override nullable warnings — ~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. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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.
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 scan
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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 25 file(s) — `Sources/CodeIsland/AppState+CodexAppServer.swift`, `Sources/CodeIsland/AppState+ToolUseCache.swift`, `Sources/CodeIsland/AppState.swift`, `Sources/CodeIsland/ClineView.swift`, `Sources/CodeIsland/CodexPermissionRules.swift`, … (+20 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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.
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.
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.
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.
Run 01a1dcb4-79b7-7a79-853d-a13297eb7352 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 14 · Warnings: 773 · Recommendations: 47 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 15-11-2026 @ 00:56 UTC.
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.