Public report of home-assistant/iOS, published 29 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). 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, 29 October 2026, 09:30 UTC · Survey ID cd_edeb329feb0f47ce813f601463ac827c
home-assistant/iOS
Measured 29 October 2026, 09:22 UTC, at code version dffd222
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Up 1 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 239,389 lines of product code in 23 projects, tests not counted · Estimated rebuild effort: about 2.0 person-years · Weakest lens: Event-Driven, 10
Findings by how serious they are
91 critical1170 serious116 minor
15 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 October 2026, 09:22 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
71of 71 dimensions measured by tools.
1330of 1377 findings point to an exact file and line, so you can open each one in the code. The other 47 concern the repository as a whole, such as missing documentation.
71dimensions across 8 lenses, read from 239,389 lines of product code in 23 projects.
home-assistant/iOS falls short of our standard for production because it has message handlers that wait for another service. It scores 38 out of 100 and is rated Weak, and eight of its 91 critical findings are security problems.
Event-Driven, at 10, is the weakest lens and counts most in the score. The best first step is stopping the event handlers from waiting on other services, worth about 23 points. Raising Event-Driven to 70 would lift the score to about 61.
Three passwords or keys are open to anyone who can read the repository. Two settings leave the servers or containers unsafe, and one automatic update takes new releases before a bad one can be spotted. Replacing each exposed password or key, correcting the unsafe settings and setting a waiting period for automatic updates would close these risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command, and limiting each secret to its own step would deal with the secret exposed to more of the pipeline than needed. Giving each kind of identifier a type of its own would take care of the 40 identifiers passed around as plain numbers or text.
The product code is 239,389 lines, about €280,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.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 337 findings
These 337 critical or serious findings were in the previous survey, on 15 October 2026, and are gone from this one. The first 100 are listed here.
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Payload.recurrenceId Sources/App/Settings/Calendars/HACalendarEventAppEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: AppSettingsSnapshot.menuItemTemplateServerId Sources/App/Settings/ConfigurationTransfer/AppSettingsSnapshot.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ExcludedItem.id Sources/App/Settings/ConfigurationTransfer/ImportExportConfigurationView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Step.id Sources/App/Settings/Connection/ConnectionURLsHowItWorksView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Requirement.id Sources/App/Settings/Connection/ConnectionURLsHowItWorksViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: PickerItem.id Sources/App/Settings/EntityPicker/EntityFilterPickerView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: EntityPickerGroup.id Sources/App/Settings/EntityPicker/EntityPickerGroup.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: GroupKey.id Sources/App/Settings/EntityPicker/EntityPickerViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Step.id Sources/App/Settings/Focus/FocusHowItWorksView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: FocusNameAppEntity.id Sources/App/Settings/Focus/FocusNameAppEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Section.id Sources/App/Settings/Gestures/ListPicker.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Item.id Sources/App/Settings/Gestures/ListPicker.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: KeychainSection.id Sources/App/Settings/KeychainExplorer/KeychainExplorerView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: KeychainGenericPasswordItem.id Sources/App/Settings/KeychainExplorer/KeychainExplorerView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: LiveActivitySample.id Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ActivitySnapshot.id Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: LocationZoneItem.id Sources/App/Settings/Location/LocationSettingsViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: LocationZoneItem.beaconUUID Sources/App/Settings/Location/LocationSettingsViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ManageStorageSection.id Sources/App/Settings/ManageStorage/ManageStorageSection.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Toggle.id Sources/App/Settings/Notifications/NotificationDebugNotificationsView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ResetAlertInfo.id Sources/App/Settings/Notifications/NotificationDebugView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: PayloadRow.id Sources/App/Settings/Notifications/NotificationHistoryView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: AlertInfo.id Sources/App/Settings/Notifications/NotificationSoundsView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Step.id Sources/App/Settings/Settings/ServerSwitchingHowItWorksView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Item.id Sources/App/Settings/Siri/SiriServerConfigurationViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Item.entityId Sources/App/Settings/Siri/SiriServerConfigurationViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Row.id Sources/App/Settings/Siri/SiriSettingsViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: CalendarEventSchemaEntity.id Sources/App/Utilities/AppIntentSchemas/CalendarEventSchemaEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: CalendarEventSchemaEntity.recurrenceId Sources/App/Utilities/AppIntentSchemas/CalendarEventSchemaEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: CalendarSchemaEntity.id Sources/App/Utilities/AppIntentSchemas/CalendarSchemaEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ReminderListSchemaEntity.id Sources/App/Utilities/AppIntentSchemas/ReminderListSchemaEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ReminderListSchemaEntity.entityId Sources/App/Utilities/AppIntentSchemas/ReminderListSchemaEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ReminderListSchemaEntity.serverId Sources/App/Utilities/AppIntentSchemas/ReminderListSchemaEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ReminderSchemaEntity.id Sources/App/Utilities/AppIntentSchemas/ReminderSchemaEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: LinkState.reminderId Sources/App/Utilities/RemindersSync/RemindersSyncPlanner.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: MacSidebarItem.id Sources/App/Frontend/WebView/MacSidebar/MacSidebarItem.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: NativeTabBarItem.searchID Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarItem.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: NativeTabBarItem.assistID Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarItem.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: NativeTabBarItem.id Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarItem.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: NativeTabBarSettingsToolbarItem.appSettingsTransitionID Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarSettingsToolbarItem.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: BannerRequest.id Sources/App/Frontend/WebView/WebViewController/WebViewController+Alerts.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: RegisteredDevice.id Sources/App/Onboarding/API/Steps/OnboardingAuthStepDeviceNaming.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ReloadAlert.id Sources/App/Settings/AppleWatch/Complications/ComplicationsRootViewModel.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: SelectionOption.id Sources/App/Onboarding/Steps/Permissions/Steps/LocalAccessAndNetworkInput/LocalAccess/SelectionOptionView.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: CarPlayEntityListItem.serverId Sources/CarPlay/Templates/Entities/CarPlayEntityListItem.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: CarPlayAssistSession.pipelineId Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: IntentActionEntity.id Sources/Extensions/AppIntents/IntentActionEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: IntentActionEntity.serverId Sources/Extensions/AppIntents/IntentActionEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: IntentActionEntity.actionId Sources/Extensions/AppIntents/IntentActionEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: IntentCameraEntity.id Sources/Extensions/AppIntents/IntentCameraEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: IntentCameraEntity.serverId Sources/Extensions/AppIntents/IntentCameraEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: IntentServerAppEntity.id Sources/Extensions/AppIntents/IntentServerAppEntitiy.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: HAAppEntityAppIntentEntity.id Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: HAAppEntityAppIntentEntity.serverId Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: AssistPipelineEntity.id Sources/Extensions/AppIntents/Assist/AssistPipelineEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: AssistPipelineEntity.serverId Sources/Extensions/AppIntents/Assist/AssistPipelineEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: AssistPipelineEntity.pipelineId Sources/Extensions/AppIntents/Assist/AssistPipelineEntity.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ControllableEntityAppEntity.id Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift
Rebuild cost: about €280,000 · Estimate
Cost to rebuild
€94,000 to €470,000, for 1,571 to 4,985 hours of work, about 2.0 person-years for 1 to 4 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 38. 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
Large: 239,389 lines of product code
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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 2 points · Low effort · ADR Quality
3
Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2), REDACTED.
Raises the score by about 2 points · Low effort · Secret Scanning
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 €280,000 to build again, about 2.0 person-years of work. Its weakest lens is Event-Driven, at 10 (Critical). Event-Driven is about whether the parts of the system can rely on the messages they send each other. Because the weakest lens counts most in the score, work on Event-Driven also moves the score most.
Based on: the rebuild estimate · the Event-Driven grade · how much each lens counts
What to do: Start with the Event-Driven actions in Top priorities.
One cause behind 43 Domain Modelling findings · Common cause
43 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Identifiers, such as order numbers and customer numbers, are passed around as plain numbers or text, so nothing stops the code from using one kind where another belongs. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Rich vs anemic domain model (3 findings) · Strongly-typed ids (40 findings)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first · First action
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource. Of all the actions in this report, it raises the score most for the work it takes: about 23 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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.
31 modules, with 150 dependencies between them. One loop runs through 19 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.
HAWatchCommunicationMessages uses Shared, so a change to Shared can break HAWatchCommunicationMessages, while a change to HAWatchCommunicationMessages can't break Shared.
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.
10→20 HAWatchCommunicationMessages uses HANetworkingpart of a loop✕
Connections
2 pairs of types, where a type in HAWatchCommunicationMessages uses a type in HANetworking.
HAWatchCommunicationMessages uses HANetworking, so a change to HANetworking can break HAWatchCommunicationMessages, while a change to HAWatchCommunicationMessages can't break HANetworking.
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.
10→23 HAWatchCommunicationMessages uses HADesignSystempart of a loop✕
Connections
2 pairs of types, where a type in HAWatchCommunicationMessages uses a type in HADesignSystem.
HAWatchCommunicationMessages uses HADesignSystem, so a change to HADesignSystem can break HAWatchCommunicationMessages, while a change to HAWatchCommunicationMessages can't break HADesignSystem.
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.
10→24 HAWatchCommunicationMessages uses Extensionspart of a loop✕
Connections
16 pairs of types, where a type in HAWatchCommunicationMessages uses a type in Extensions.
HAWatchCommunicationMessages uses Extensions, so a change to Extensions can break HAWatchCommunicationMessages, while a change to HAWatchCommunicationMessages can't break Extensions.
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.
10→31 HAWatchCommunicationMessages uses Apppart of a loop✕
Connections
1 pair of types, where a type in HAWatchCommunicationMessages uses a type in App.
HAWatchCommunicationMessages uses App, so a change to App can break HAWatchCommunicationMessages, while a change to HAWatchCommunicationMessages can't break App.
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.
WatchWidgets uses HAWatchComplications, so a change to HAWatchComplications can break WatchWidgets, while a change to WatchWidgets can't break HAWatchComplications.
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.
27 pairs of types, where a type in WatchWidgets uses a type in Extensions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
HAWatchComplications uses repository, so a change to repository can break HAWatchComplications, while a change to HAWatchComplications can't break repository.
Position
Below the diagonal: HAWatchComplications uses a module listed above it, which is the healthy direction.
HAWatchComplications uses WatchWidgets, so a change to WatchWidgets can break HAWatchComplications, while a change to HAWatchComplications can't break WatchWidgets.
Position
Below the diagonal: HAWatchComplications uses a module listed above it, which is the healthy direction.
15→19 HAWatchComplications uses Sharedpart of a loop✕
Connections
16 pairs of types, where a type in HAWatchComplications uses a type in Shared.
HAWatchComplications uses HADesignSystem, so a change to HADesignSystem can break HAWatchComplications, while a change to HAWatchComplications can't break HADesignSystem.
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.
15→24 HAWatchComplications uses Extensionspart of a loop✕
Connections
6 pairs of types, where a type in HAWatchComplications uses a type in Extensions.
HAWatchComplications uses Extensions, so a change to Extensions can break HAWatchComplications, while a change to HAWatchComplications can't break Extensions.
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.
15→31 HAWatchComplications uses Apppart of a loop✕
Connections
4 pairs of types, where a type in HAWatchComplications uses a type in App.
HAModels uses HAWatchComplications, so a change to HAWatchComplications can break HAModels, while a change to HAModels can't break HAWatchComplications.
Position
Below the diagonal: HAModels uses a module listed above it, which is the healthy direction.
65 pairs of types, where a type in HAModels uses a type in Extensions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
WatchApp uses HAWatchCommunicationMessages, so a change to HAWatchCommunicationMessages can break WatchApp, while a change to WatchApp can't break HAWatchCommunicationMessages.
Position
Below the diagonal: WatchApp uses a module listed above it, which is the healthy direction.
WatchApp uses HAWatchComplications, so a change to HAWatchComplications can break WatchApp, while a change to WatchApp can't break HAWatchComplications.
Position
Below the diagonal: WatchApp uses a module listed above it, which is the healthy direction.
37 pairs of types, where a type in WatchApp uses a type in HANetworking. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
90 pairs of types, where a type in WatchApp uses a type in Extensions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Shared uses HAWatchCommunicationMessages, so a change to HAWatchCommunicationMessages can break Shared, while a change to Shared can't break HAWatchCommunicationMessages.
Position
Below the diagonal: Shared uses a module listed above it, which is the healthy direction.
157 pairs of types, where a type in Shared uses a type in HANetworking. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
103 pairs of types, where a type in Shared uses a type in HADesignSystem. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
1438 pairs of types, where a type in Shared uses a type in Extensions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
60 pairs of types, where a type in HANetworking uses a type in Shared. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
42 pairs of types, where a type in HANetworking uses a type in Extensions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
91 pairs of types, where a type in HADesignSystem uses a type in repository. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
353 pairs of types, where a type in HADesignSystem uses a type in Shared. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
63 pairs of types, where a type in HADesignSystem uses a type in HAIconic. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
HADesignSystem uses HAIconic, so a change to HAIconic can break HADesignSystem, while a change to HADesignSystem can't break HAIconic.
Position
Below the diagonal: HADesignSystem uses a module listed above it, which is the healthy direction.
23→24 HADesignSystem uses Extensionspart of a loop✕
Connections
260 pairs of types, where a type in HADesignSystem uses a type in Extensions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
153 pairs of types, where a type in HADesignSystem uses a type in App. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
The types involved
HADesignSystem.ActionLinkButton → App.Color
HADesignSystem.Appearance → App.Color
HADesignSystem.AppleLikeBottomSheet → App.Binding
HADesignSystem.Arc → App.Color
HADesignSystem.Backup → App.Binding
HADesignSystem.Blob → App.Color
HADesignSystem.ButtonStyle → App.Color
HADesignSystem.CardView → App.Color
HADesignSystem.CloseButton → App.Color
HADesignSystem.Color+Semantic.swift → App.Color
HADesignSystem.ColorContrast → App.Color
HADesignSystem.Coordinator → App.ObjectType
HADesignSystem.DesignSystemComponent → App.Color
HADesignSystem.DesignSystemComponent → App.Row
HADesignSystem.ExternalLinkButton → App.Color
HADesignSystem.FrontendColors → App.Color
HADesignSystem.FrontendColors → App.Set
HADesignSystem.HAAlarmPanelCard → App.Binding
HADesignSystem.HAAlarmPanelCard → App.Color
HADesignSystem.HAAlertType → App.Color
HADesignSystem.HAAlertView → App.Action
HADesignSystem.HAAnalogClock → App.Color
HADesignSystem.HAAreaCardAlert → App.Color
HADesignSystem.HAAssistChip → App.Color
HADesignSystem.HABadge → App.Color
Direction
HADesignSystem uses App, so a change to App can break HADesignSystem, while a change to HADesignSystem can't break App.
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.
Extensions uses HAWatchComplications, so a change to HAWatchComplications can break Extensions, while a change to Extensions can't break HAWatchComplications.
Position
Below the diagonal: Extensions uses a module listed above it, which is the healthy direction.
67 pairs of types, where a type in Extensions uses a type in HAModels. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
421 pairs of types, where a type in Extensions uses a type in Shared. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
40 pairs of types, where a type in Extensions uses a type in HANetworking. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
57 pairs of types, where a type in Extensions uses a type in HADesignSystem. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
27 pairs of types, where a type in CarPlay uses a type in Extensions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Watch uses HAWatchCommunicationMessages, so a change to HAWatchCommunicationMessages can break Watch, while a change to Watch can't break HAWatchCommunicationMessages.
Position
Below the diagonal: Watch uses a module listed above it, which is the healthy direction.
62 pairs of types, where a type in App uses a type in HADesignSystem. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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
A03:2025 — Software Supply Chain Failures
6
Medium
A02:2025 — Security Misconfiguration
5
High / Critical
A05:2025 — Injection
4
High / Critical
A07:2025 — Authentication Failures
3
High / Critical
Roadmap
First, eliminate synchronous blocking in handlers by adopting async patterns to prevent resource contention. Next, address three leaked secrets in local distribution and testing files, while also identifying and redistributing sole ownership of critical code to reduce bus factor risks. Finally, establish a structured repository for Architecture Decision Records to document significant design choices, their contexts, and consequences.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
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.
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 — 91
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 — 1170
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 — 116
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 15
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 71 of 71 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 71 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, 1330 of 1377 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its gem 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.
D19 Documentation Quality — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D28 Secrets (history) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `gitleaks` TIMED OUT after 78.3s against a 77.5s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Sources/App/Assist/AssistTypingIndicator.swift`, `Sources/App/Assist/AssistView.swift`, `Sources/App/Assist/Local/TTSVoicePickerView.swift`, `Sources/App/Assist/Views/AssistWavesAnimation.swift`, `Sources/App/BarcodeScanner/Camera/BarcodeScannerView.swift`, … (+486 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.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is swift-dependencies, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — [0m - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 4) REDACTED:21 -------------------- 19 | COPY ./Package.* ./ 20 | COPY ./SharedPush/Package.* ./ 21 | >>> RUN swift package resolve 22 | 23 | # Copy entire repo into container -------------------- ERROR: failed to solve: process "/bin/sh -c swift package resolve" did not complete successfully: exit code: 1; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
DM2 Strongly-typed ids — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 306 further occurrence(s) are not listed individually; the score already reflects all 346.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
42 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was WebViewExternalMessageHandler.handleExternalMessage at 59. A further 40 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 MaterialDesignIcons.sfSymbols3Match at 579 — they are counted neither in the figure above nor in this dimension's score. 14 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/Shared/Extensions/MaterialDesignIcons+SFSymbol.swift (MaterialDesignIcons.sfSymbols3Match at 579), Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift (DesignSystemComponent.frontendComponentName at 144), Sources/Shared/Domain/Domain+SFSymbol.swift (Domain.symbol at 38), Sources/Shared/API/Webhook/Sensors/Health/HealthKitMetricUnit+HKUnit.swift (HealthKitMetricUnit.hkUnit at 29), Sources/App/Settings/Settings/SettingsItem.swift (SettingsItem.destinationView at 28), and 9 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.
+ 37 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with WebViewExternalMessageHandler.handleExternalMessage (cyclomatic 59), LegacyNotificationParserImpl.result (cyclomatic 55), LegacyNotificationParserImpl.result (cyclomatic 49). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cyclomatic Complexity from 6.6 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 69 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 16 bodies over 30 down to 30 or less in Cognitive Complexity — start with LegacyNotificationParserImpl.result (cognitive 65), WebViewExternalMessageHandler.handleExternalMessage (cognitive 64), BitapSearcher.search (cognitive 55). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 16 together lifts Cognitive Complexity from 6.5 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.0 / 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 33 MethodTooLong finding(s) in God Classes — start with DesignSystemComponent.swift (4), MaterialDesignIcons+SFSymbol.swift (2), LiveActivitySettingsView.swift (2). — One of this dimension's main actionable groups (33 warning-level).
Resolve the 25 FileTooLong finding(s) in God Classes — start with MaterialDesignIcons.swift, Strings.swift, DesignSystemComponent.swift. — One of this dimension's main actionable groups (25 warning-level).
Resolve the 22 ClassTooLong finding(s) in God Classes — start with MaterialDesignIcons.swift, Strings.swift, DesignSystemComponent.swift. — One of this dimension's main actionable groups (22 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
313 duplicated block group(s) detected. A further 15 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 112 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with AssistView.swift (3), WatchFolderContentView.swift (2), AssistConfiguration.swift. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 20 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with WidgetCircularComplicationAppEntity.swift (2), WatchComplicationLivePreview.swift, WatchComplicationBuilderEditView.swift. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 19 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with ConnectivityCheckView.swift, IncomingURLHandler.swift, WebViewController+WebKitDelegates.swift. — One of this dimension's main actionable groups (19 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.3 / 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.
23 production modules (SwiftPM+Xcode), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; a workspace's implicit (product-name) dependency is not visible there; 7 module(s) off the main sequence, with abstractness counted on 14 of the 23 (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: HAModels · ×5
Off the main sequence: SharedPush (Sources/PushServer/SharedPush) · ×2
What to do
Resolve the 5 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (5 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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 36 Low cohesion finding(s) in Cohesion (LCOM4) — start with WebRTCClient.swift (2), iOSTagManager.swift (2), WebViewController.swift. — One of this dimension's main actionable groups (36 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 86.3% — 2 file(s) below 50%. Measured from the Swift suite (Sources/HADesignSystem: no coverage export; Sources/PushServer: `swift test --enable-code-coverage` over 12 production file(s)).
Resolve the 2 Low coverage finding(s) in Code Coverage — start with Request+TestableAPNS.swift, configure.swift. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
5347 test methods: 5347 unit, 0 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality8.6 / 10Strong✓ 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.
2 skipped, 524 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 5347 tests (2 harness-style project(s) excluded from the assertion penalty).
No assertions: testInvitationURL · ×513Tests/App/AppConstants.test.swift:6
No direct assertions: testOnboardingConnectsAndFrontendOpensNativeSettings · ×11Tests/UI/OnboardingE2ETests.swift:22
Test project verifies nothing: WatchAppTestsTests/WatchAppTests/CircularComplicationWatchSnapshot.test.swift:9
What to do
Resolve the 513 No assertions finding(s) in Test Quality — start with WidgetsSnapshot.test.swift (39), TableSchemaTests.test.swift (28), OnboardingScanningInstanceRow.test.swift (15). — One of this dimension's main actionable groups (513 warning-level).
Resolve the 11 No direct assertions finding(s) in Test Quality — start with RestoredDeviceFlowsRecordingTests.swift (6), OnboardingE2ETests.swift, CircularComplicationWatchSnapshot.test.swift. — One of this dimension's main actionable groups (11 recommendation-level).
Resolve the 2 Skipped test finding(s) in Test Quality — start with WebViewExternalMessageHandlerTests.swift (2). — One of this dimension's main actionable groups (2 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
26 outdated direct SwiftPM dependencies, 1 pinning defect(s). 43 of 54 direct dependencies had their releases listed (0 naming no readable repository, 11 pinned to a branch or a revision rather than a version). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
Floating branch dependency: sdk-ios
Outdated: abseil-cpp-binary · ×25
What to do
Resolve the 1 Floating branch dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 116 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 116 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed Gemfile.lock. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. 1 of them publish no licence on rubygems.org; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift (18×59=1062); Sources/Shared/Domain/Domain.swift (15×65=975); Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift (4×144=576) Repeated repair below the complexity floor: Sources/WatchWidgets/Complications/CornerComplicationView.swift (4 of 7 changes were fixes); Sources/Shared/Environment/FocusFilterWrapper.swift (4 of 6 changes were fixes); Sources/Shared/API/Webhook/Sensors/FocusSensor.swift (3 of 5 changes were fixes)
Resolve the 19 Hotspot finding(s) in Churn × Complexity Hotspots — start with WatchCommunicatorService.swift (2), WebViewExternalMessageHandler.swift, Domain.swift. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 9 Repeated repair finding(s) in Churn × Complexity Hotspots — start with CornerComplicationView.swift, FocusFilterWrapper.swift, FocusSensor.swift. — One of this dimension's main actionable groups (9 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor5.0 / 10Weak✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
546 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift. Counted over 1090 of the 2022 production source files in this repository: 930 are under the ~2,400-byte size floor this dimension measures over, and the remaining 2 have no attributable history left to measure.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_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.
17 deducted task-comment markers across 239389 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 16 TodoComment finding(s) in Explicit Debt — start with SceneManager.swift (2), HAButtonStyles.test.swift, WatchMagicViewRow.swift. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with DynamicNotificationView.swift. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
2 of 14 build units (Bundler, SwiftPM) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
4 finding(s): 0 critical, 3 high, 1 medium, 0 low. semgrep hit a parse error in 5 file(s) — `REDACTED` (line 37, line 38), `Tests/App/WebView/MacSidebarCachingTests.swift` (line 65, line 66, line 67, …), `Tests/App/WebView/NativeTabBarViewModelTests.swift` (line 85, line 93, line 94, …), `Tests/App/WebView/WebKitEnhancedSecurityTests.swift` (line 23, line 40, line 47, …), `Tools/EnsureSimulatorRuntime.sh` (line 19) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
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).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
47 of 1092 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Sources/App/Utilities/AKConverter.swift. Counted over 1092 of the 2022 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with AKConverter.swift. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 46 Orphaned file finding(s) in Knowledge Freshness — start with CameraStreamServer.swift, Alamofire+EncryptedResponses.swift, LocationHistoryDetailViewController.swift. — One of this dimension's main actionable groups (46 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_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 11 Change coupling finding(s) in Change Coupling — start with CarPlayDomainsListTemplate.swift (2), Widgets.swift, WatchHelpers.swift. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with WebViewController.swift, HAAPI.swift, WatchConfigurationViewModel.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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
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 1 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
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.
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 · Domain Modelling — Whether domain identifiers are strongly typed (a typed-id struct) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
`AreasCommandServer.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:152
`AreasCommandFloor.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:158
`AreasCommandFloorKey.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:164
`AreasCommandArea.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:169
`AreasCommandArea.floorId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:171
`AreasCommandDevice.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:177
`AreasCommandDomain.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:184
`AreasCommandEntity.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:190
`AreasCommandEntity.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/MainWindowGroupCommands.swift:191
`AssistSessionContext.pipelineId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Assist/AssistSession.swift:10
`KioskWebTarget.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Container/OnboardingStateObservable.swift:57
`CabinPressureMonitor.subscriberID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/FlightGreetings/CabinPressureMonitor.swift:17
`FlightGreetingManager.toastID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/FlightGreetings/FlightGreetingManager.swift:13
`Reason.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/PermissionScreen/PermissionRequestView.swift:8
`CarPlaySceneDelegate.latestStatesServerId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Scenes/CarPlaySceneDelegate.swift:39
`JinjaEntityReference.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Templating/JinjaEntityReference.swift:5
`Item.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Templating/JinjaEntitySuggestionsView.swift:14
`JinjaTemplateSuggestion.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Templating/JinjaTemplateSuggestion.swift:31
`VoiceGroup.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. (×2) — Sources/App/VoiceToolsServer/VoiceToolsServerVoicesView.swift:17, Sources/App/Assist/Local/TTSVoicePickerView.swift:17
`IdentifiableURL.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/WhatsNew/IdentifiableURL.swift:6
`WhatsNewItem.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/WhatsNew/WhatsNewModels.swift:206
`OnDeviceVoice.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Assist/Local/OnDeviceVoice.swift:16
`Camera.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Cameras/CameraPlayer/CameraOverlayPresenter.swift:9
`Key.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Cameras/CameraPlayer/CameraPickerSnapshotCache.swift:10
`Key.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Cameras/CameraPlayer/CameraPickerSnapshotCache.swift:11
`ConnectivityCheck.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckState.swift:42
`ShareWrapper.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Frontend/DownloadManager/ShareWrapper.swift:6
`WebViewExternalMessageHandler.nextOutgoingMessageID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:37
`PendingExternalBusCommand.messageID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:836
`OnscreenPage.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Frontend/OnscreenPage/OnscreenPage.swift:11
`IconImage.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/AppIcon/AppIconSelectorView.swift:8
`ShortcutIdentifier.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/AppIconShortcuts/AppIconShortcutItemsUpdater.swift:11
`ShortcutIdentifier.itemId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/AppIconShortcuts/AppIconShortcutItemsUpdater.swift:12
`HACalendarAppEntity.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/Calendars/HACalendarAppEntity.swift:19
`HACalendarAppEntity.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/Calendars/HACalendarAppEntity.swift:21
`HACalendarAppEntity.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/Calendars/HACalendarAppEntity.swift:22
`HACalendarEventAppEntity.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/Calendars/HACalendarEventAppEntity.swift:21
`Payload.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/Calendars/HACalendarEventAppEntity.swift:69
`Payload.calendarEntityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/App/Settings/Calendars/HACalendarEventAppEntity.swift:70
What to do
Adopt the repo's typed-id idiom consistently — wrap every entity identity in its own typed id.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model7.7 / 10Strong✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour — a data-only reference entity whose logic lives in a foreign service is anemic. Rich models enforce their own invariants.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
`String` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Sources/Extensions/EntityProvider+Details.swift:263
`WidgetFamily` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Sources/Extensions/Widgets/Common/WidgetFamily+AppPreview.swift:5
`ConfigResponse` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Sources/Shared/API/Responses/ConfigResponse.swift:4
What to do
Move delegated behaviour onto the domain entity (or make it a value object); keep invariants inside the type.
Other · Domain Modelling — Whether a reference entity protects its own invariants — a class whose identity is a computed content hash but whose hashed fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain entity fused to a persistence ORM on its own declaration (active-record), or reaching a web-framework transport type in its own method, couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
`CarPlayConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/App/Settings/CarPlay/CarPlayConfig.swift:4
`AllowedTag` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/AllowedTag.swift:6
`AppArea` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/AppArea.swift:6
`AppDeviceRegistry` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/AppDeviceRegistry.swift:7
`AppLabsFeatureState` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/AppLabsFeatureState.swift:5
`AppPanel` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/AppPanel.swift:6
`AssistConfiguration` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/AssistConfiguration.swift:6
`AssistPipelines` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/AssistPipelines.swift:62
`FocusName` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/FocusName.swift:11
`FrontendThemeVariable` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/FrontendThemeVariable.swift:16
`HAAppEntity` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/HAAppEntity.swift:24
`HACalendar` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/HACalendar.swift:10
`HACalendarEventRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/HACalendarEventRecord.swift:9
`KioskSettings` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/KioskSettings.swift:6
`NotificationSnoozeAction` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/NotificationSnoozeAction.swift:8
`RemindersSyncConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/RemindersSyncConfig.swift:7
`RemindersSyncHistoryEntry` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/RemindersSyncHistoryEntry.swift:7
`RemindersSyncItemLink` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/RemindersSyncItemLink.swift:8
`SiriEntityExposure` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/SiriEntityExposure.swift:12
`SiriServerExposure` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/SiriServerExposure.swift:11
`VoiceToolsServerConfiguration` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/VoiceToolsServerConfiguration.swift:9
`WatchComplicationConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HAModels/Sources/WatchComplicationConfig.swift:12
`ServerInfoMirrorRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/HANetworking/Sources/ServerManagerMirrorStore.swift:5
`AppIconShortcutConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/AppIconShortcuts/AppIconShortcutConfig.swift:4
`Entity` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/Models/EntityRegistryListForDisplay.swift:25
`WatchConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/Watch/WatchConfig.swift:4
`CustomWidget` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/Widget/CustomWidget.swift:4
`ItemState` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/Widget/CustomWidget.swift:22
`AppZone` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/API/Models/AppZone.swift:20
`LocationHistoryEntry` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/API/Models/LocationHistory.swift:6
`LocationError` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/API/Models/LocationHistory.swift:103
`NotificationCategory` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/API/Models/NotificationCategory.swift:7
`UpdatableModel` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/API/Models/UpdatableModel.swift:7
`WatchComplication` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/API/Models/WatchComplication.swift:12
`MacToolbarConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Sources/Shared/Database/Tables/MacToolbarConfigTable.swift:7
What to do
Keep the ORM/table mapping and web-framework types on a boundary adapter; leave the domain entity framework-free (map row↔domain through a repository).
Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
`CarPlayAssistSession.handleAudioSessionInterruption` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler. — Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:520
`CarPlayAssistSession.handleMediaServicesWereReset` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler. — Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:549
`CarPlayAssistSession.handleOnDeviceFinalTranscript` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler. — Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:883
`CameraStreamServer.handle` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler. — Sources/Shared/Environment/CameraStreamServer.swift:385
What to do
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 13 of 13 project(s) that lack one — worth up to 2 pts.
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.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
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.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
491/547 types (90%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
What to do
Keep implementation types off the public surface (Swift: leave it `internal` (the default) instead of `public`) so internals can change without breaking consumers.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Consider OpenTelemetry tracing/metrics (swift-otel with swift-distributed-tracing) and a health-check endpoint (a /health route on your Vapor/Hummingbird router) for operability.
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 87121 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. — .github/workflows/ci.yml:8
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.
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.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 10 use(s) across 259,088 production line(s) (~0.0/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×6) — Sources/Shared/Notifications/UNNotificationContent+Additions.swift:35, Sources/Shared/Environment/Environment.swift:595, Sources/HANetworking/Sources/SecurityExceptions.swift:60, …
`catch (error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — Sources/App/Resources/WebSocketBridge.js:44
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — Sources/App/Resources/WebSocketBridge.js:216
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 12 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
What to do
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
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 — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 13 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 52 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — no class or module declares an abstract method
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 — docker build failed (exit 1) — [0m - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 4) REDACTED:21 -------------------- 19 | COPY ./Package.* ./ 20 | COPY ./SharedPush/Package.* ./ 21 | >>> RUN swift package resolve 22 | 23 | # Copy entire repo into container -------------------- ERROR: failed to solve: process "/bin/sh -c swift package resolve" did not complete successfully: exit code: 1; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — D19 withholds "Documentation: empty section": 1 candidate(s) were measured and not published.
D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Python, Ruby, Swift not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rb, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D28 Secrets (history) — gitleaks killed before it finished — this repository's working tree not scanned
D32 Data Compliance (PII/GDPR) — 491 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
DM1 Aggregate boundaries — not scored for Swift: the sidecar flattens array/collection types (a child COLLECTION = legitimate membership vs a single embedded aggregate is indistinguishable), and aggregate-vs-value-object classification cannot be told apart in source (every struct-holding-struct reads alike) — reported as guidance rather than measured
DM3 Integration-event coupling — not scored for Swift: a cross-SwiftPM-target domain leak cannot be told apart in source from a legitimate shared-kernel/contracts module, and most repositories ship a single module — reported as guidance rather than measured
DM7 Repository granularity — not scored for Swift: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, 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
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 12 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 91 finding(s)
DM2 · Strongly-typed ids· Raw-primitive id despite a typed-id idiom · ×40
Raw-primitive id despite a typed-id idiom: AreasCommandServer.id Sources/App/MainWindowGroupCommands.swift:152— `AreasCommandServer.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandFloor.id Sources/App/MainWindowGroupCommands.swift:158— `AreasCommandFloor.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandFloorKey.id Sources/App/MainWindowGroupCommands.swift:164— `AreasCommandFloorKey.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandArea.id Sources/App/MainWindowGroupCommands.swift:169— `AreasCommandArea.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandArea.floorId Sources/App/MainWindowGroupCommands.swift:171— `AreasCommandArea.floorId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandDevice.id Sources/App/MainWindowGroupCommands.swift:177— `AreasCommandDevice.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandDomain.id Sources/App/MainWindowGroupCommands.swift:184— `AreasCommandDomain.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandEntity.id Sources/App/MainWindowGroupCommands.swift:190— `AreasCommandEntity.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AreasCommandEntity.entityId Sources/App/MainWindowGroupCommands.swift:191— `AreasCommandEntity.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AssistSessionContext.pipelineId Sources/App/Assist/AssistSession.swift:10— `AssistSessionContext.pipelineId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: KioskWebTarget.serverId Sources/App/Container/OnboardingStateObservable.swift:57— `KioskWebTarget.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: CabinPressureMonitor.subscriberID Sources/App/FlightGreetings/CabinPressureMonitor.swift:17— `CabinPressureMonitor.subscriberID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: FlightGreetingManager.toastID Sources/App/FlightGreetings/FlightGreetingManager.swift:13— `FlightGreetingManager.toastID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Reason.id Sources/App/PermissionScreen/PermissionRequestView.swift:8— `Reason.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: CarPlaySceneDelegate.latestStatesServerId Sources/App/Scenes/CarPlaySceneDelegate.swift:39— `CarPlaySceneDelegate.latestStatesServerId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: JinjaEntityReference.entityId Sources/App/Templating/JinjaEntityReference.swift:5— `JinjaEntityReference.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Item.id Sources/App/Templating/JinjaEntitySuggestionsView.swift:14— `Item.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: JinjaTemplateSuggestion.id Sources/App/Templating/JinjaTemplateSuggestion.swift:31— `JinjaTemplateSuggestion.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: VoiceGroup.id Sources/App/VoiceToolsServer/VoiceToolsServerVoicesView.swift:17— `VoiceGroup.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: IdentifiableURL.id Sources/App/WhatsNew/IdentifiableURL.swift:6— `IdentifiableURL.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: WhatsNewItem.id Sources/App/WhatsNew/WhatsNewModels.swift:206— `WhatsNewItem.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: OnDeviceVoice.id Sources/App/Assist/Local/OnDeviceVoice.swift:16— `OnDeviceVoice.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: VoiceGroup.id Sources/App/Assist/Local/TTSVoicePickerView.swift:17— `VoiceGroup.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Camera.entityId Sources/App/Cameras/CameraPlayer/CameraOverlayPresenter.swift:9— `Camera.entityId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Key.serverId Sources/App/Cameras/CameraPlayer/CameraPickerSnapshotCache.swift:10— `Key.serverId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Domain fused to persistence infrastructure: CarPlayConfig Sources/App/Settings/CarPlay/CarPlayConfig.swift:4— `CarPlayConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AllowedTag Sources/HAModels/Sources/AllowedTag.swift:6— `AllowedTag` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AppArea Sources/HAModels/Sources/AppArea.swift:6— `AppArea` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AppDeviceRegistry Sources/HAModels/Sources/AppDeviceRegistry.swift:7— `AppDeviceRegistry` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AppLabsFeatureState Sources/HAModels/Sources/AppLabsFeatureState.swift:5— `AppLabsFeatureState` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AppPanel Sources/HAModels/Sources/AppPanel.swift:6— `AppPanel` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AssistConfiguration Sources/HAModels/Sources/AssistConfiguration.swift:6— `AssistConfiguration` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AssistPipelines Sources/HAModels/Sources/AssistPipelines.swift:62— `AssistPipelines` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: FocusName Sources/HAModels/Sources/FocusName.swift:11— `FocusName` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: FrontendThemeVariable Sources/HAModels/Sources/FrontendThemeVariable.swift:16— `FrontendThemeVariable` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: HAAppEntity Sources/HAModels/Sources/HAAppEntity.swift:24— `HAAppEntity` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: HACalendar Sources/HAModels/Sources/HACalendar.swift:10— `HACalendar` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: HACalendarEventRecord Sources/HAModels/Sources/HACalendarEventRecord.swift:9— `HACalendarEventRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: KioskSettings Sources/HAModels/Sources/KioskSettings.swift:6— `KioskSettings` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: NotificationSnoozeAction Sources/HAModels/Sources/NotificationSnoozeAction.swift:8— `NotificationSnoozeAction` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: RemindersSyncConfig Sources/HAModels/Sources/RemindersSyncConfig.swift:7— `RemindersSyncConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: RemindersSyncHistoryEntry Sources/HAModels/Sources/RemindersSyncHistoryEntry.swift:7— `RemindersSyncHistoryEntry` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: RemindersSyncItemLink Sources/HAModels/Sources/RemindersSyncItemLink.swift:8— `RemindersSyncItemLink` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: SiriEntityExposure Sources/HAModels/Sources/SiriEntityExposure.swift:12— `SiriEntityExposure` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: SiriServerExposure Sources/HAModels/Sources/SiriServerExposure.swift:11— `SiriServerExposure` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: VoiceToolsServerConfiguration Sources/HAModels/Sources/VoiceToolsServerConfiguration.swift:9— `VoiceToolsServerConfiguration` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: WatchComplicationConfig Sources/HAModels/Sources/WatchComplicationConfig.swift:12— `WatchComplicationConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: ServerInfoMirrorRecord Sources/HANetworking/Sources/ServerManagerMirrorStore.swift:5— `ServerInfoMirrorRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: AppIconShortcutConfig Sources/Shared/AppIconShortcuts/AppIconShortcutConfig.swift:4— `AppIconShortcutConfig` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: Entity Sources/Shared/Models/EntityRegistryListForDisplay.swift:25— `Entity` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Blocking wait inside a handler: CarPlayAssistSession.handleAudioSessionInterruption Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:520— `CarPlayAssistSession.handleAudioSessionInterruption` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler.
Blocking wait inside a handler: CarPlayAssistSession.handleMediaServicesWereReset Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:549— `CarPlayAssistSession.handleMediaServicesWereReset` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler.
Blocking wait inside a handler: CarPlayAssistSession.handleOnDeviceFinalTranscript Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:883— `CarPlayAssistSession.handleOnDeviceFinalTranscript` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler.
Blocking wait inside a handler: CameraStreamServer.handle Sources/Shared/Environment/CameraStreamServer.swift:385— `CameraStreamServer.handle` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler.
DM4 · Rich vs anemic domain model· Anemic domain model · ×3
Anemic domain model: String Sources/Extensions/EntityProvider+Details.swift:263— `String` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Anemic domain model: WidgetFamily Sources/Extensions/Widgets/Common/WidgetFamily+AppPreview.swift:5— `WidgetFamily` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Anemic domain model: ConfigResponse Sources/Shared/API/Responses/ConfigResponse.swift:4— `ConfigResponse` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Orphaned knowledge Sources/App/Utilities/AKConverter.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
No assertions: testInvitationURL Tests/App/AppConstants.test.swift:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testWebURLs Tests/App/AppConstants.test.swift:13— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testQueryItemsRawValues Tests/App/AppConstants.test.swift:52— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOpenEntityDeeplinkURL Tests/App/AppConstants.test.swift:57— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOpenEntityMoreInfoDeeplinkURL Tests/App/AppConstants.test.swift:108— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOpenEntityMoreInfoDeeplinkURLWithServer Tests/App/AppConstants.test.swift:144— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testTodoListAddItemURL Tests/App/AppConstants.test.swift:160— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testTodoListOpenURL Tests/App/AppConstants.test.swift:179— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testFirebaseURL Tests/App/AppConstants.test.swift:198— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testNormalizedNavigationDestination Tests/App/AppConstants.test.swift:206— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testAllCasesRawValues Tests/App/BackgroundTask.test.swift:5— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLanguages Tests/App/LocalizedStrings.test.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testInitAddsSelfAsObserver Tests/App/OnboardingServersListViewModelTests.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testStartDiscovery Tests/App/OnboardingServersListViewModelTests.swift:17— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testStopDiscovery Tests/App/OnboardingServersListViewModelTests.swift:29— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testSelectInstance Tests/App/OnboardingServersListViewModelTests.swift:40— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testResetFlow Tests/App/OnboardingServersListViewModelTests.swift:56— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testBothPerfectForward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:688— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testBothPerfectBackward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:695— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOnePerfectForward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:702— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOnePerfectBackward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:709— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCloseTimingForward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:716— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCloseTimingBackward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:723— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testMoreRecentWinsForward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:730— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testMoreRecentWinsBackward Tests/Shared/CLLocationManager+OneShotLocationTests.swift:737— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Low cohesion: WebViewController (LCOM4 16) Sources/App/Frontend/WebView/WebViewController/WebViewController.swift:14— WebViewController's methods fall into 16 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 16 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: WebRTCClient (LCOM4 11) Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCClient.swift:270— WebRTCClient's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: NotificationManager (LCOM4 9) Sources/App/Notifications/NotificationManager.swift:15— NotificationManager's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WebRTCFakeStreamClient (LCOM4 8) Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCFakeStreamClient.swift:5— WebRTCFakeStreamClient's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WatchConnectivityManager (LCOM4 8) Sources/Shared/Watch/Connectivity/WatchConnectivityManager.swift:10— WatchConnectivityManager's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: LocationSettingsViewModel (LCOM4 7) Sources/App/Settings/Location/LocationSettingsViewModel.swift:10— LocationSettingsViewModel's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CarPlayAddItemViewModel (LCOM4 7) Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:7— CarPlayAddItemViewModel's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Promise (LCOM4 7) Sources/Extensions/AppIntents/ShortcutAppIntentSupport.swift:5— Promise's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ExtensionDelegate (LCOM4 7) Sources/WatchApp/ExtensionDelegate.swift:10— ExtensionDelegate's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AppDelegate (LCOM4 6) Sources/App/AppDelegate.swift:45— AppDelegate'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: LocationHistoryDetailViewController (LCOM4 6) Sources/App/ClientEvents/LocationHistoryDetailViewController.swift:43— LocationHistoryDetailViewController'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: AppContainerCoordinator (LCOM4 6) Sources/App/Container/AppContainerCoordinator.swift:10— AppContainerCoordinator'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: URL (LCOM4 6) Sources/HANetworking/Sources/URL+Extensions.swift:4— URL'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: MacBridgeImpl (LCOM4 6) Sources/MacBridge/MacBridgeImpl.swift:6— MacBridgeImpl'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: KioskModeManager (LCOM4 6) Sources/Shared/Environment/KioskModeManager.swift:15— KioskModeManager'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: CarPlayAssistSession (LCOM4 5) Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:7— CarPlayAssistSession's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ControlEntityProvider (LCOM4 5) Sources/Shared/ControlEntityProvider.swift:6— ControlEntityProvider's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SettingsStore (LCOM4 5) Sources/Shared/Settings/SettingsStore.swift:7— SettingsStore's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WCSession (LCOM4 5) Sources/Shared/Watch/Connectivity/WCSessionProtocol.swift:43— WCSession's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SceneManager (LCOM4 4) Sources/App/Scenes/SceneManager.swift:138— SceneManager'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: BarcodeScannerCamera (LCOM4 4) Sources/App/BarcodeScanner/Camera/BarcodeScannerCamera.swift:10— BarcodeScannerCamera'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: KioskSensorsViewModel (LCOM4 4) Sources/App/Settings/Kiosk/KioskSensorsViewModel.swift:10— KioskSensorsViewModel'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: TagActivityManager (LCOM4 4) Sources/App/Settings/NFC/iOSTagManager.swift:8— TagActivityManager'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: iOSTagManager (LCOM4 4) Sources/App/Settings/NFC/iOSTagManager.swift:92— iOSTagManager'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: PlaybackOnlyRTCAudioDevice (LCOM4 4) Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCClient.swift:18— PlaybackOnlyRTCAudioDevice'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.
MethodTooLong: DesignSystemComponent.variants Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:662— MethodTooLong — variants runs 1331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1231 over it, 13.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesignSystemComponent.moreInfoVariants Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:8— MethodTooLong — moreInfoVariants runs 614 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 514 over it, 6.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: MaterialDesignIcons.sfSymbols3Match Sources/Shared/Extensions/MaterialDesignIcons+SFSymbol.swift:268— MethodTooLong — sfSymbols3Match runs 581 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 481 over it, 5.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LiveActivitySettingsView.animatedSamples Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:341— MethodTooLong — animatedSamples runs 281 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WatchClimateControlView.body Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:21— MethodTooLong — body runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× 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: ComplicationTemplate.CLKComplicationTemplate Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:989— MethodTooLong — CLKComplicationTemplate runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WebViewExternalMessageHandler.handleExternalMessage Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:54— MethodTooLong — handleExternalMessage runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× 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: MaterialDesignIcons.sfSymbols4Match Sources/Shared/Extensions/MaterialDesignIcons+SFSymbol.swift:56— MethodTooLong — sfSymbols4Match runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× 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: LegacyNotificationParserImpl.result Sources/SharedPush/Sources/NotificationParserLegacy.swift:48— MethodTooLong — result runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ManageStorageView.body Sources/App/Settings/ManageStorage/ManageStorageView.swift:15— MethodTooLong — body runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesignSystemComponent.frontendComponentName Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:166— MethodTooLong — frontendComponentName runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesignSystemComponent.frontendComponentVersion Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:317— MethodTooLong — frontendComponentVersion runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesignSystemComponent.title Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:467— MethodTooLong — title runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DebugView.developerSection Sources/App/Settings/DebugView.swift:370— MethodTooLong — developerSection runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WatchWidgetComplicationSnapshot.make Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:149— MethodTooLong — make runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LegacyNotificationParserImpl.result Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:48— MethodTooLong — result runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IncomingURLHandler.handle Sources/App/Frontend/IncomingURLHandler.swift:40— MethodTooLong — handle 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: AKConverter.convertAsset Sources/App/Utilities/AKConverter.swift:149— MethodTooLong — convertAsset 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: Domain.icon Sources/Shared/Domain/Domain.swift:256— MethodTooLong — icon runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× 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: HomeAssistantAppShortcuts.appShortcuts Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:23— MethodTooLong — appShortcuts runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AKConverter.convertToPCM Sources/App/Utilities/AKConverter.swift:376— MethodTooLong — convertToPCM runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: WatchHomeView.body Sources/WatchApp/Home/WatchHomeView.swift:52— MethodTooLong — body runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ServerDetailsRowView.body Sources/App/Settings/Connection/ServerDetailsRowView.swift:118— MethodTooLong — body runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LiveActivitySettingsView.staticSamples Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:204— MethodTooLong — staticSamples runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: ComplicationTemplate.imageSize Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:1210— MethodTooLong — imageSize runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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.
FileTooLong: Sources/MaterialDesignIcons.swift Sources/HAIconic/Sources/MaterialDesignIcons.swift— FileTooLong — 14918 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: MaterialDesignIcons (9-14946). The bar is 500 significant lines; this is 14418 over it, 29.84× 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: Swiftgen/Strings.swift Sources/Shared/Resources/Swiftgen/Strings.swift— FileTooLong — 5414 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: L10n (12-10951). The bar is 500 significant lines; this is 4914 over it, 10.83× 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: Gallery/DesignSystemComponent.swift Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift— FileTooLong — 2113 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DesignSystemComponent (14-2872). The bar is 500 significant lines; this is 1613 over it, 4.23× 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: Extensions/CLKComplication+Strings.swift Sources/Shared/Common/Extensions/CLKComplication+Strings.swift— FileTooLong — 1317 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: ComplicationTemplate (508-1440). The bar is 500 significant lines; this is 817 over it, 2.63× 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: API/HAAPI.swift Sources/Shared/API/HAAPI.swift— FileTooLong — 1182 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: HomeAssistantAPI (10-1504). The bar is 500 significant lines; this is 682 over it, 2.36× 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: Watch/WatchCommunicatorService.swift Sources/Watch/WatchCommunicatorService.swift— FileTooLong — 978 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 478 over it, 1.96× 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: QuickAccess/CarPlayAssistSession.swift Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift— FileTooLong — 813 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: CarPlayAssistSession (8-1056). The bar is 500 significant lines; this is 313 over it, 1.63× 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: Extensions/MaterialDesignIcons+SFSymbol.swift Sources/Shared/Extensions/MaterialDesignIcons+SFSymbol.swift— FileTooLong — 787 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 287 over it, 1.57× 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: LiveActivity/LiveActivitySettingsView.swift Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift— FileTooLong — 756 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: LiveActivitySettingsView (7-742). The bar is 500 significant lines; this is 256 over it, 1.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: QuickAccess/CarPlayQuickAccessTemplate.swift Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessTemplate.swift— FileTooLong — 752 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CarPlayQuickAccessTemplate (7-1123). The bar is 500 significant lines; this is 252 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: MagicItem/MagicItem.swift Sources/Shared/MagicItem/MagicItem.swift— FileTooLong — 748 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 248 over it, 1.50× 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: Gallery/DesignSystemComponent+MoreInfo.swift Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift— FileTooLong — 737 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 237 over it, 1.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: ExternalMessageBus/WebViewExternalMessageHandler.swift Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift— FileTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: WebViewExternalMessageHandler (28-824). The bar is 500 significant lines; this is 219 over it, 1.44× 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: Settings/DebugView.swift Sources/App/Settings/DebugView.swift— FileTooLong — 711 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: DebugView (9-775). The bar is 500 significant lines; this is 211 over it, 1.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Frontend/IncomingURLHandler.swift Sources/App/Frontend/IncomingURLHandler.swift— FileTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: IncomingURLHandler (11-731). The bar is 500 significant lines; this is 168 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: Domain/Domain.swift Sources/Shared/Domain/Domain.swift— FileTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: Domain (5-623). The bar is 500 significant lines; this is 125 over it, 1.25× 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: WatchApp/ExtensionDelegate.swift Sources/WatchApp/ExtensionDelegate.swift— FileTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 101 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: Settings/SettingsStore.swift Sources/Shared/Settings/SettingsStore.swift— FileTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: SettingsStore (7-974). The bar is 500 significant lines; this is 94 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: Networking/WebhookManager.swift Sources/Shared/API/Webhook/Networking/WebhookManager.swift— FileTooLong — 592 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: WebhookManager (37-677). The bar is 500 significant lines; this is 92 over it, 1.18× 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: Views/HomeAssistantStandByView.swift Sources/App/Frontend/WebView/Views/HomeAssistantStandByView.swift— FileTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: HomeAssistantStandByView (6-590). The bar is 500 significant lines; this is 88 over it, 1.18× 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: Home/WatchHomeViewModel.swift Sources/WatchApp/Home/WatchHomeViewModel.swift— FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: WatchHomeViewModel (13-914). The bar is 500 significant lines; this is 41 over it, 1.08× 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: Environment/Environment.swift Sources/Shared/Environment/Environment.swift— FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: AppEnvironment (105-845). The bar is 500 significant lines; this is 26 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: Complications/WatchComplicationConfigurationSheet.swift Sources/App/Settings/AppleWatch/Complications/WatchComplicationConfigurationSheet.swift— FileTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 22 over it, 1.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: Environment/AppDatabaseUpdater.swift Sources/Shared/Environment/AppDatabaseUpdater.swift— FileTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: AppDatabaseUpdater (43-882). 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: Assist/AssistView.swift Sources/App/Assist/AssistView.swift— FileTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: AssistView (6-684). The bar is 500 significant lines; this is 10 over it, 1.02× 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.
ClassTooLong: MaterialDesignIcons Sources/HAIconic/Sources/MaterialDesignIcons.swift:9— ClassTooLong — 14917 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 14517 over it, 37.29× 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: L10n Sources/Shared/Resources/Swiftgen/Strings.swift:12— ClassTooLong — 5409 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 5009 over it, 13.52× 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: DesignSystemComponent Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:14— ClassTooLong — 2109 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 1709 over it, 5.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HomeAssistantAPI Sources/Shared/API/HAAPI.swift:10— ClassTooLong — 953 significant lines (blank, comment-only and punctuation-only lines excluded), 88 methods. The bar is 400 significant lines; this is 553 over it, 2.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: ComplicationTemplate Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:508— ClassTooLong — 809 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 409 over it, 2.02× 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: CarPlayQuickAccessTemplate Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessTemplate.swift:7— ClassTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 347 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.
ClassTooLong: CarPlayAssistSession Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:7— ClassTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 324 over it, 1.81× 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: SettingsStore Sources/Shared/Settings/SettingsStore.swift:7— ClassTooLong — 589 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 189 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.
ClassTooLong: WatchCommunicatorService Sources/Watch/WatchCommunicatorService.swift:8— ClassTooLong — 581 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 181 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WebViewExternalMessageHandler Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:28— ClassTooLong — 578 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 178 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LiveActivitySettingsView Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:6— ClassTooLong — 567 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 167 over it, 1.42× 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: WatchHomeViewModel Sources/WatchApp/Home/WatchHomeViewModel.swift:13— ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 400 significant lines; this is 132 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DebugView Sources/App/Settings/DebugView.swift:9— ClassTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 128 over it, 1.32× 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: Domain Sources/Shared/Domain/Domain.swift:5— ClassTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 108 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AppDatabaseUpdater Sources/Shared/Environment/AppDatabaseUpdater.swift:43— ClassTooLong — 480 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 80 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IncomingURLHandler Sources/App/Frontend/IncomingURLHandler.swift:11— ClassTooLong — 472 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 72 over it, 1.18× 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: AppEnvironment Sources/Shared/Environment/Environment.swift:105— ClassTooLong — 465 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 65 over it, 1.16× 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: AssistView Sources/App/Assist/AssistView.swift:6— ClassTooLong — 458 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 58 over it, 1.15× 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: RemindersSyncManager Sources/App/Utilities/RemindersSync/RemindersSyncManager.swift:13— ClassTooLong — 444 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 44 over it, 1.11× 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: WebRTCViewPlayerViewModel Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCViewPlayerViewModel.swift:19— ClassTooLong — 422 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 22 over it, 1.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: WebhookManager Sources/Shared/API/Webhook/Networking/WebhookManager.swift:37— ClassTooLong — 408 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 8 over it, 1.02× 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: HomeAssistantStandByView Sources/App/Frontend/WebView/Views/HomeAssistantStandByView.swift:6— ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 1 over it, 1.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (10 lines × 2) Sources/App/Assist/AssistConfiguration.swift:25— Sources/App/Assist/AssistConfiguration.swift:25-34 | Sources/App/VoiceToolsServer/VoiceToolsServerConfiguration+Database.swift:28-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Sources/App/Assist/AssistView.swift:674— Sources/App/Assist/AssistView.swift:674-683 | Sources/WatchApp/Assist/Views/ChatBubbleView.swift:83-92 — before extracting anything, compare `Sources/App/Assist/AssistView.swift` and `Sources/WatchApp/Assist/Views/ChatBubbleView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:51— Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:51-60 | Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:75-84 — 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/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift:74— Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift:74-83 | Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift:52-61 — 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/App/Settings/CarPlay/CarPlayConfigurationView.swift:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/App/Settings/Components/YamlPreviewSection.swift:35— Sources/App/Settings/Components/YamlPreviewSection.swift:35-44 | Sources/App/Settings/NFC/NFCTagView.swift:107-116 — 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/App/Settings/Components/YamlPreviewSection.swift:35` 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) Sources/CarPlay/Templates/Entities/CarPlayLockConfirmation.swift:46— Sources/CarPlay/Templates/Entities/CarPlayLockConfirmation.swift:46-55 | Sources/CarPlay/Templates/Entities/CarPlayLockConfirmation.swift:106-115 — 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/CarPlay/Templates/Entities/CarPlayLockConfirmation.swift:46` 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 (10 lines × 2) Sources/Extensions/EntityProvider+Details.swift:416— Sources/Extensions/EntityProvider+Details.swift:416-425 | Sources/Shared/Environment/EntityFuzzySearch/EntityFuzzySearchIndex.swift:62-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Sources/Extensions/Widgets/Controls/Fan/FanIntent.swift:22— Sources/Extensions/Widgets/Controls/Fan/FanIntent.swift:22-31 | Sources/Extensions/Widgets/Controls/Light/LightIntent.swift:22-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Extensions/Widgets/Controls/Fan/FanIntent.swift:22` 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/Extensions/Widgets/LiveActivity/HALiveActivityCompactView.swift:45— Sources/Extensions/Widgets/LiveActivity/HALiveActivityCompactView.swift:45-54 | Sources/Extensions/Widgets/LiveActivity/HALockScreenView.swift:94-103 — 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/Extensions/Widgets/LiveActivity/HALiveActivityCompactView.swift:45` 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 (10 lines × 2) Sources/Shared/LiveActivity/LocalPush/LiveActivityPendingEnd.swift:118— Sources/Shared/LiveActivity/LocalPush/LiveActivityPendingEnd.swift:118-127 | Sources/Shared/LiveActivity/LocalPush/LiveActivityPendingStart.swift:163-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Sources/SharedTesting/SnapshotTestingHelper.swift:14— Sources/SharedTesting/SnapshotTestingHelper.swift:14-23 | Sources/SharedTesting/SnapshotTestingHelper.swift:49-58 — 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 before the matched lines, `Sources/SharedTesting/SnapshotTestingHelper.swift:13` calls `init` and `Sources/SharedTesting/SnapshotTestingHelper.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 (10 lines × 2) Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift:81— Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift:81-90 | Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:66-75 — before extracting anything, compare `Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift` and `Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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 (10 lines × 2) Sources/HADesignSystem/Sources/Components/HATabItem.swift:11— Sources/HADesignSystem/Sources/Components/HATabItem.swift:11-20 | Sources/HADesignSystem/Sources/Components/HAToggleButton.swift:14-23 — 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/HADesignSystem/Sources/Components/HATabItem.swift:11` 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/App/Assist/AssistView.swift:663— Sources/App/Assist/AssistView.swift:663-672 | Sources/WatchApp/Assist/Views/ChatBubbleView.swift:72-81 — before extracting anything, compare `Sources/App/Assist/AssistView.swift` and `Sources/WatchApp/Assist/Views/ChatBubbleView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) Sources/CarPlay/Templates/Areas/CarPlayAreasZonesTemplate.swift:55— Sources/CarPlay/Templates/Areas/CarPlayAreasZonesTemplate.swift:55-64 | Sources/CarPlay/Templates/Domains/CarPlayDomainsListTemplate.swift:58-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Sources/WatchApp/Home/WatchFolderContentView.swift:186— Sources/WatchApp/Home/WatchFolderContentView.swift:186-195 | Sources/WatchApp/Home/WatchHomeView.swift:417-426 — before extracting anything, compare `Sources/WatchApp/Home/WatchFolderContentView.swift` and `Sources/WatchApp/Home/WatchHomeView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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 (10 lines × 2) Sources/WatchApp/Home/WatchFolderContentView.swift:207— Sources/WatchApp/Home/WatchFolderContentView.swift:207-216 | Sources/WatchApp/Home/WatchHomeHeaderView.swift:49-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Sources/App/Assist/AssistView.swift:643— Sources/App/Assist/AssistView.swift:643-652 | Sources/WatchApp/Assist/Views/ChatBubbleView.swift:52-61 — before extracting anything, compare `Sources/App/Assist/AssistView.swift` and `Sources/WatchApp/Assist/Views/ChatBubbleView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:176— Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:176-185 | Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift:214-223 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift` and `Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) Sources/Shared/API/Models/AppZone.swift:238— Sources/Shared/API/Models/AppZone.swift:238-247 | Sources/Shared/API/Models/NotificationCategory.swift:120-129 — 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/App/Settings/AppleWatch/Complications/Preview/WatchComplicationLivePreview.swift:163— Sources/App/Settings/AppleWatch/Complications/Preview/WatchComplicationLivePreview.swift:163-167 | Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:257-261 — 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. 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/App/Settings/AppleWatch/Complications/WatchComplicationBuilderEditView.swift:366— Sources/App/Settings/AppleWatch/Complications/WatchComplicationBuilderEditView.swift:366-370 | Sources/App/Settings/AppleWatch/Complications/WatchComplicationConfigurationSheet.swift:506-510 — 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. 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 × 2) Sources/App/Templating/JinjaTemplateButton.swift:45— Sources/App/Templating/JinjaTemplateButton.swift:45-49 | Sources/App/Templating/JinjaTemplateEditorSheet.swift:108-114 — 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/App/Utilities/Spotlight/HAAppEntityAppIntentEntity+IndexedEntity.swift:47— Sources/App/Utilities/Spotlight/HAAppEntityAppIntentEntity+IndexedEntity.swift:47-51 | Sources/App/Utilities/Spotlight/HACalendarAppEntity+IndexedEntity.swift:38-42 — 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. 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 × 2) Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:111— Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:111-115 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:168-172 — 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/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:264— Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:264-268 | Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:274-278 — 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 before the matched lines, `Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:260` calls `preferredColorScheme` and `Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:270` 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/HADesignSystem/Sources/Components/HAPlantStatusCard.swift:114— Sources/HADesignSystem/Sources/Components/HAPlantStatusCard.swift:114-118 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:2500-2504 — 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/HADesignSystem/Sources/Components/HAPlantStatusCard.swift:114` 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 (5 lines × 2) Sources/Watch/WatchCommunicatorService.swift:590— Sources/Watch/WatchCommunicatorService.swift:590-594 | Sources/WatchApp/Home/WatchHomeViewModel+Editing.swift:253-257 — 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/Watch/WatchCommunicatorService.swift:590` 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/App/BackgroundRefreshManager.swift:12— Sources/App/BackgroundRefreshManager.swift:12-16 | Sources/App/Utilities/RemindersSync/RemindersSyncBackgroundRefresher.swift:11-15 — 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/App/Settings/Sensors/List/SensorListViewModel.swift:218— Sources/App/Settings/Sensors/List/SensorListViewModel.swift:218-222 | Sources/App/Settings/Settings/ServersObserver.swift:43-47 — 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/App/Settings/Calendars/HACalendarAppEntityQuery.swift:9— Sources/App/Settings/Calendars/HACalendarAppEntityQuery.swift:9-13 | Sources/Extensions/Widgets/Calendar/WidgetCalendarAppEntityQuery.swift:12-16 — 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/Extensions/Widgets/Calendar/WidgetCalendarAppEntityQuery.swift:10` calls `available` and `Sources/App/Settings/Calendars/HACalendarAppEntityQuery.swift:3` 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/App/Settings/CarPlay/CarPlayConfig.swift:43— Sources/App/Settings/CarPlay/CarPlayConfig.swift:43-47 | Sources/Shared/Watch/WatchConfig.swift:59-63 — 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/Extensions/AppIntents/Widget/Complication/WidgetCircularComplicationAppEntity.swift:36— Sources/Extensions/AppIntents/Widget/Complication/WidgetCircularComplicationAppEntity.swift:36-40 | Sources/Extensions/AppIntents/Widget/Complication/WidgetRectangularComplicationAppEntity.swift:36-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Sources/Extensions/AppIntents/Widget/Complication/WidgetCircularComplicationAppEntity.swift:42— Sources/Extensions/AppIntents/Widget/Complication/WidgetCircularComplicationAppEntity.swift:42-46 | Sources/Extensions/AppIntents/Widget/Complication/WidgetRectangularComplicationAppEntity.swift:42-46 — 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/Shared/AppIconShortcuts/AppIconShortcutConfig.swift:17— Sources/Shared/AppIconShortcuts/AppIconShortcutConfig.swift:17-21 | Sources/Shared/Database/Tables/MacToolbarConfigTable.swift:17-21 — 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/App/Settings/ConfigurationTransfer/AppConfigurationTransfer.swift:110— Sources/App/Settings/ConfigurationTransfer/AppConfigurationTransfer.swift:110-114 | Sources/App/Settings/DebugDatabaseTransfer.swift:150-154 — 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/HADesignSystem/Sources/Components/HAEntitiesCard.swift:57— Sources/HADesignSystem/Sources/Components/HAEntitiesCard.swift:57-61 | Sources/HADesignSystem/Sources/Components/HAEntityRow.swift:110-114 — 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/HADesignSystem/Sources/MoreInfo/HAMoreInfoLawnMower.swift:58— Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoLawnMower.swift:58-62 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoVacuum.swift:100-104 — 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/HADesignSystem/Sources/MoreInfo/HAMoreInfoLawnMower.swift:58` 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/WatchApp/Home/MagicItemRow/WatchMagicViewRow.swift:287— Sources/WatchApp/Home/MagicItemRow/WatchMagicViewRow.swift:287-291 | Sources/WatchApp/Home/MagicItemRow/WatchMagicViewRow.swift:298-302 — 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/WatchApp/Home/MagicItemRow/WatchMagicViewRow.swift:287` 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 lines × 2) Sources/WatchApp/Home/WatchHomeViewModel+Editing.swift:71— Sources/WatchApp/Home/WatchHomeViewModel+Editing.swift:71-75 | Sources/WatchApp/Home/WatchHomeViewModel+Editing.swift:159-163 — 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/WatchApp/Home/WatchHomeViewModel+Editing.swift:71` 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.
Hotspot: Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:54— Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in WebViewExternalMessageHandler.handleExternalMessage at line 54. 1 of those changes was a fix/bug commit, and the other 17 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.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/Shared/Domain/Domain.swift Sources/Shared/Domain/Domain.swift:256— Sources/Shared/Domain/Domain.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in Domain.icon at line 256. 1 of those changes was a fix/bug commit, and the other 14 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/Domain/Domain.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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:166— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 144 in DesignSystemComponent.frontendComponentName at line 166. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.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/App/Settings/Settings/SettingsItem.swift Sources/App/Settings/Settings/SettingsItem.swift:129— Sources/App/Settings/Settings/SettingsItem.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in SettingsItem.destinationView at line 129. 2 of those changes were fix/bug commits, and the other 13 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/App/Settings/Settings/SettingsItem.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/WatchApp/Home/WatchHomeView.swift Sources/WatchApp/Home/WatchHomeView.swift:52— Sources/WatchApp/Home/WatchHomeView.swift changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in WatchHomeView.body at line 52. 3 of those changes were fix/bug commits, and the other 11 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchApp/Home/WatchHomeView.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/App/Frontend/IncomingURLHandler.swift Sources/App/Frontend/IncomingURLHandler.swift:40— Sources/App/Frontend/IncomingURLHandler.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in IncomingURLHandler.handle at line 40. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/App/Frontend/IncomingURLHandler.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/Watch/WatchCommunicatorService.swift Sources/Watch/WatchCommunicatorService.swift:185— Sources/Watch/WatchCommunicatorService.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in WatchCommunicatorService.setupMessages at line 185. 1 of those changes was a fix/bug commit, and the other 14 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Watch/WatchCommunicatorService.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/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:149— Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in WatchWidgetComplicationSnapshot.make at line 149. 5 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.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/App/Settings/Sensors/List/SensorListView.swift Sources/App/Settings/Sensors/List/SensorListView.swift:39— Sources/App/Settings/Sensors/List/SensorListView.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in SensorListView.body at line 39. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/App/Settings/Sensors/List/SensorListView.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/App/Frontend/Extensions/WebViewGestureHandler.swift Sources/App/Frontend/Extensions/WebViewGestureHandler.swift:9— Sources/App/Frontend/Extensions/WebViewGestureHandler.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in WebViewGestureHandler.handleGestureAction at line 9. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/App/Frontend/Extensions/WebViewGestureHandler.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/Extensions/AppIntents/Widget/Energy/WidgetEnergyAppIntentTimelineProvider.swift Sources/Extensions/AppIntents/Widget/Energy/WidgetEnergyAppIntentTimelineProvider.swift:59— Sources/Extensions/AppIntents/Widget/Energy/WidgetEnergyAppIntentTimelineProvider.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in WidgetEnergyAppIntentTimelineProvider.entry at line 59. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Extensions/AppIntents/Widget/Energy/WidgetEnergyAppIntentTimelineProvider.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/Shared/Watch/WatchDatabaseMirror.swift Sources/Shared/Watch/WatchDatabaseMirror.swift:465— Sources/Shared/Watch/WatchDatabaseMirror.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in WatchDatabaseMirror.tableDigests at line 465. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/Watch/WatchDatabaseMirror.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/SharedPush/Sources/NotificationParserLegacy.swift Sources/SharedPush/Sources/NotificationParserLegacy.swift:48— Sources/SharedPush/Sources/NotificationParserLegacy.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in LegacyNotificationParserImpl.result at line 48. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/SharedPush/Sources/NotificationParserLegacy.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/Shared/MagicItem/MagicItemProvider.swift Sources/Shared/MagicItem/MagicItemProvider.swift:239— Sources/Shared/MagicItem/MagicItemProvider.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in MagicItemProvider.getInfo at line 239. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/MagicItem/MagicItemProvider.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/Shared/AppGesture.swift Sources/Shared/AppGesture.swift:78— Sources/Shared/AppGesture.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in HAGestureAction.localizedString at line 78. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/AppGesture.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/WatchApp/Home/Edit/WatchConfigItemEditView.swift Sources/WatchApp/Home/Edit/WatchConfigItemEditView.swift:84— Sources/WatchApp/Home/Edit/WatchConfigItemEditView.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in WatchConfigItemEditView.body at line 84. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchApp/Home/Edit/WatchConfigItemEditView.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/WatchApp/WatchCommunicatorService.swift Sources/WatchApp/WatchCommunicatorService.swift:41— Sources/WatchApp/WatchCommunicatorService.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ImmediateCommunicatorService.evaluateMessage at line 41. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchApp/WatchCommunicatorService.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/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:21— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in WatchClimateControlView.body at line 21. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.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/HAWatchComplications/Sources/RectangularComplicationContentView.swift Sources/HAWatchComplications/Sources/RectangularComplicationContentView.swift:32— Sources/HAWatchComplications/Sources/RectangularComplicationContentView.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in RectangularComplicationContentView.body at line 32. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/HAWatchComplications/Sources/RectangularComplicationContentView.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 (11 lines × 2) Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:119— Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:119-129 | Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:134-144 — 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/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:119` 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/App/Frontend/IncomingURLHandler.swift:793— Sources/App/Frontend/IncomingURLHandler.swift:793-803 | Sources/App/Frontend/IncomingURLHandler.swift:860-870 — 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/App/Frontend/IncomingURLHandler.swift:793` 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 (11 lines × 2) Sources/App/Frontend/WebView/WebViewController/WebViewController+WebKitDelegates.swift:33— Sources/App/Frontend/WebView/WebViewController/WebViewController+WebKitDelegates.swift:33-43 | Sources/App/Onboarding/API/OnboardingAuthLoginViewModel.swift:144-154 — 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/App/Frontend/WebView/WebViewController/WebViewController+WebKitDelegates.swift:33` 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/App/Settings/AppIconShortcuts/AppIconShortcutsConfigurationView.swift:59— Sources/App/Settings/AppIconShortcuts/AppIconShortcutsConfigurationView.swift:59-69 | Sources/App/Settings/Widgets/Builder/WidgetCreationView.swift:132-142 — 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/App/Settings/AppIconShortcuts/AppIconShortcutsConfigurationView.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.
Duplicated block (11 lines × 2) Sources/App/Settings/Gestures/ListPicker.swift:175— Sources/App/Settings/Gestures/ListPicker.swift:175-185 | Sources/App/Settings/Settings/SettingsView.swift:440-450 — 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/App/Settings/Gestures/ListPicker.swift:175` 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/App/Utilities/MenuManager.swift:312— Sources/App/Utilities/MenuManager.swift:312-322 | Sources/App/Utilities/MenuManager.swift:484-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlTemplate.swift:332— Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlTemplate.swift:332-342 | Sources/CarPlay/Templates/Entities/Vacuum/CarPlayVacuumControlTemplate.swift:178-188 — 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/CarPlay/Templates/Entities/Climate/CarPlayClimateControlTemplate.swift:332` 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/Extensions/AppIntents/Script/IntentScriptAppEntityQuery.swift:48— Sources/Extensions/AppIntents/Script/IntentScriptAppEntityQuery.swift:48-58 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:169-179 — 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/Extensions/AppIntents/Script/IntentScriptAppEntityQuery.swift:48` 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 (11 lines × 2) Sources/Extensions/Widgets/Controls/OpenEntity/ControlOpenCamera/ControlOpenCamera.swift:13— Sources/Extensions/Widgets/Controls/OpenEntity/ControlOpenCamera/ControlOpenCamera.swift:13-23 | Sources/Extensions/Widgets/Controls/OpenEntity/ControlOpenEntity/ControlOpenEntity.swift:13-23 — 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/Extensions/Widgets/Controls/OpenEntity/ControlOpenCamera/ControlOpenCamera.swift:13` 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/HADesignSystem/Sources/Components/HAThermostatCard.swift:29— Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:29-39 | Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:55-65 — 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/HADesignSystem/Sources/Components/HAThermostatCard.swift:29` 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 (11 lines × 2) Sources/HADesignSystem/Sources/Components/HATileCard.swift:149— Sources/HADesignSystem/Sources/Components/HATileCard.swift:149-159 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1406-1416 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:182— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:182-192 | Sources/HADesignSystem/Sources/MoreInfo/HAStateControlCircularSlider.swift:326-336 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) Sources/Shared/API/HomeAssistantAPI+Calendar.swift:81— Sources/Shared/API/HomeAssistantAPI+Calendar.swift:81-91 | Sources/Shared/API/HomeAssistantAPI+Calendar.swift:121-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Shared/API/HomeAssistantAPI+Calendar.swift:81` 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/Shared/API/REST/HomeAssistantRESTClient.swift:121— Sources/Shared/API/REST/HomeAssistantRESTClient.swift:121-131 | Sources/Shared/Watch/WatchServiceCallSender.swift:55-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) Sources/Shared/API/Webhook/Sensors/PedometerSensor.swift:84— Sources/Shared/API/Webhook/Sensors/PedometerSensor.swift:84-94 | Sources/Shared/API/Webhook/Sensors/PedometerSensor.swift:130-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift:69— Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift:69-79 | Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:54-64 — before extracting anything, compare `Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift` and `Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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 (11 lines × 2) Sources/App/Settings/AppIconShortcuts/AppIconShortcutsConfigurationViewModel.swift:70— Sources/App/Settings/AppIconShortcuts/AppIconShortcutsConfigurationViewModel.swift:70-80 | Sources/App/Settings/CarPlay/CarPlayConfigurationViewModel.swift:27-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:95— Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:95-105 | Sources/App/Settings/MagicItem/AssistPipelinePicker.swift:118-128 — before extracting anything, compare `Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift` and `Sources/App/Settings/MagicItem/AssistPipelinePicker.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/App/Settings/MagicItem/AssistPipelinePicker.swift:131` calls `info` and `Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:108` 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 (11 lines × 2) Sources/HANetworking/Sources/URL+Extensions.swift:31— Sources/HANetworking/Sources/URL+Extensions.swift:31-41 | Sources/Shared/API/HAAPI.swift:1520-1533 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/App/Settings/ConfigurationTransfer/AppConfigurationTransfer.swift:49— Sources/App/Settings/ConfigurationTransfer/AppConfigurationTransfer.swift:49-55 | Sources/App/Settings/DebugDatabaseTransfer.swift:87-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.
Duplicated block (7 lines × 2) Sources/App/Settings/ManageStorage/ManageStorageItemID.swift:37— Sources/App/Settings/ManageStorage/ManageStorageItemID.swift:37-43 | Sources/App/Settings/ManageStorage/ManageStorageItemID.swift:82-88 — 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/App/Settings/ManageStorage/ManageStorageItemID.swift:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/Extensions/AppIntents/Control/LockEntityAppIntent.swift:47— Sources/Extensions/AppIntents/Control/LockEntityAppIntent.swift:47-53 | Sources/Extensions/AppIntents/Control/SetTemperatureAppIntent.swift:60-66 — 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/Extensions/AppIntents/Control/LockEntityAppIntent.swift:47` 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/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:247— Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:247-253 | Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:258-264 — 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/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/HADesignSystem/Sources/Components/HAControlSelectMenu.swift:120— Sources/HADesignSystem/Sources/Components/HAControlSelectMenu.swift:120-126 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:16-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:28— Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:28-34 | Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:153-160 — 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/HADesignSystem/Sources/Components/HAThermostatCard.swift:153` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:691— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:691-697 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:376-382 — 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:691` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:689` calls `HAMoreInfoCommand` and `Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:374` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:979— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:979-985 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:993-999 — 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:979` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1183— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1183-1189 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1204-1210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:30— Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:30-36 | Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift:32-38 — before extracting anything, compare `Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift` and `Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:30` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/App/Assist/Local/TTSVoicePickerView.swift:114— Sources/App/Assist/Local/TTSVoicePickerView.swift:114-120 | Sources/App/VoiceToolsServer/VoiceToolsServerVoicesView.swift:95-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/App/Frontend/ExternalMessageBus/WidgetSelectionView.swift:140— Sources/App/Frontend/ExternalMessageBus/WidgetSelectionView.swift:140-146 | Sources/App/Settings/Widgets/Builder/WidgetBuilderViewModel.swift:19-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/CarPlay/Templates/Entities/Vacuum/CarPlayVacuumControlViewModel.swift:127— Sources/CarPlay/Templates/Entities/Vacuum/CarPlayVacuumControlViewModel.swift:127-133 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsViewModel.swift:141-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/WatchApp/Complication/WatchComplicationSnapshotPoller.swift:113— Sources/WatchApp/Complication/WatchComplicationSnapshotPoller.swift:113-119 | Sources/WatchApp/Utilities/WatchEntityStatePoller.swift:100-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlTemplate.swift:29— Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlTemplate.swift:29-35 | Sources/CarPlay/Templates/Entities/Vacuum/CarPlayVacuumControlTemplate.swift:24-30 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `viewModel` to `CarPlayClimateControlViewModel` in one and `CarPlayVacuumControlViewModel` 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 (7 lines × 2) Sources/Extensions/AppIntents/IntentCameraEntity.swift:16— Sources/Extensions/AppIntents/IntentCameraEntity.swift:16-22 | Sources/Extensions/Widgets/Calendar/WidgetCalendarAppEntity.swift:27-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/WatchApp/Location/WatchServerLocationSettingsView.swift:12— Sources/WatchApp/Location/WatchServerLocationSettingsView.swift:12-18 | Sources/WatchApp/WatchServerSensorsSettingsView.swift:13-19 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Tools/BuildBrandIcons.py:48— Tools/BuildBrandIcons.py:48-54 | Tools/BuildFrontendColors.py:72-78 — 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/App/Settings/ConfigurationTransfer/ImportExportConfigurationView.swift:136— Sources/App/Settings/ConfigurationTransfer/ImportExportConfigurationView.swift:136-141 | Sources/App/Settings/ManageStorage/ManageStorageView.swift:199-207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/Settings/ConfigurationTransfer/ImportExportConfigurationView.swift:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/HADesignSystem/Sources/Colors/Color+Hex.swift:46— Sources/HADesignSystem/Sources/Colors/Color+Hex.swift:46-51 | Sources/HADesignSystem/Sources/Colors/Color+Hex.swift:62-67 — 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/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:232— Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:232-237 | Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:242-247 — 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/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:249` calls `preferredColorScheme` and `Sources/HADesignSystem/Sources/Components/AssistVoiceOrbView.swift:239` 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 (6 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:642— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:642-647 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoLight.swift:202-207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:35— Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:35-40 | Sources/SharedPush/Sources/NotificationParserLegacy.swift:35-40 — before extracting anything, compare `Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift` and `Sources/SharedPush/Sources/NotificationParserLegacy.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 240 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/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:35` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/Shared/Environment/AppConstants.swift:262— Sources/Shared/Environment/AppConstants.swift:262-267 | Sources/Shared/Environment/AppConstants.swift:273-278 — 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/Shared/Environment/AppConstants.swift:262` 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/Shared/Environment/AppConstants.swift:268` calls `URLQueryItem` and `Sources/Shared/Environment/AppConstants.swift:279` 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 (6 lines × 2) Sources/Shared/Intents/AppIntent/Transport/AppIntentServerAPI+WebSocket.swift:148— Sources/Shared/Intents/AppIntent/Transport/AppIntentServerAPI+WebSocket.swift:148-153 | Sources/Shared/Intents/AppIntent/Transport/AppIntentServerAPI+WebSocket.swift:176-181 — 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/Shared/Intents/AppIntent/Transport/AppIntentServerAPI+WebSocket.swift:148` 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/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:66— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:66-71 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:56-61 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift` and `Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 87 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.
Duplicated block (6 lines × 2) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:77— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:77-82 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:93-98 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift` and `Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 87 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.
Duplicated block (6 lines × 2) Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift:143— Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift:143-148 | Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileSensorView.swift:83-88 — before extracting anything, compare `Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift` and `Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileSensorView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (6 lines × 2) Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift:92— Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift:92-97 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift:109-114 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift` and `Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift` as WHOLE FILES: this scan already matched 4 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 (6 lines × 2) Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsViewModel.swift:38— Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsViewModel.swift:38-43 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsViewModel.swift:45-50 — 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 × 2) Sources/App/Settings/Calendars/HACalendarAppEntityQuery.swift:17— Sources/App/Settings/Calendars/HACalendarAppEntityQuery.swift:17-22 | Sources/Extensions/Widgets/Calendar/WidgetCalendarAppEntityQuery.swift:20-25 — 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 × 2) Sources/App/Settings/Gestures/ListPicker.swift:212— Sources/App/Settings/Gestures/ListPicker.swift:212-217 | Sources/App/Settings/Gestures/ListPicker.swift:218-223 — 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/App/Settings/Gestures/ListPicker.swift:212` 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/Extensions/AppIntents/Widget/Complication/WidgetComplicationResolver.swift:106— Sources/Extensions/AppIntents/Widget/Complication/WidgetComplicationResolver.swift:106-111 | Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:133-138 — 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/Extensions/AppIntents/Widget/Complication/WidgetComplicationResolver.swift:106` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:618— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:618-623 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:2615-2620 — 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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:618` 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/HADesignSystem/Sources/MoreInfo/HAMoreInfoCover.swift:112— Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoCover.swift:112-117 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoCover.swift:123-128 — 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/HADesignSystem/Sources/MoreInfo/HAMoreInfoCover.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoCover.swift:110` calls `constant` and `Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoCover.swift:122` 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.
TodoComment Tests/Shared/DesignSystem/Components/HAButtonStyles.test.swift:35— // TODO: Figure it out a way that views with liquid glass applied show up in the snapshots — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/WatchApp/Home/MagicItemRow/WatchMagicViewRow.swift:88— // TODO: On watchOS 10 this can be replaced by '.sensoryFeedback' modifier — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/WatchApp/Assist/WatchAssistView.swift:94— // TODO: On watchOS 10 this can be replaced by '.sensoryFeedback' modifier — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/Shared/Extensions/UIScreen+Orientation.swift:7— // TODO: Modernization - Callers reach this through `UIScreen.main`, which is deprecated. Call it on the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/Shared/Environment/Environment.swift:362— // TODO: Modernization - `UIScreen.main` is deprecated. Brightness belongs to the screen of the window — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/Shared/Environment/MotionDetectionManager.swift:289— // TODO: Modernization - `UIScreen.main` is deprecated. Rotate frames with — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/App/BarcodeScanner/Camera/BarcodeScannerCamera.swift:309— // TODO: Modernization - `UIScreen.main` is deprecated. Rotate frames with — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/Shared/API/Webhook/Sensors/Health/HealthKitMetric+All.swift:4— // TODO: Grow the catalog in follow-up PRs. Deliberately left out of the first release, roughly in — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/MacBridge/MacBridgeImpl.swift:125— // TODO: SMJobIsEnabled is the Apple-suggested method of getting this info, and it's also private API. lol. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/HADesignSystem/Sources/Tokens/DesignSystem.swift:10— // TODO: Use HA design system font sizes when ready — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/HADesignSystem/Sources/Components/AppleLikeBottomSheet.swift:152— // TODO: Modernization - `UIScreen.main` is deprecated and only describes the built-in display. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/App/Utilities/AppIntentSchemas/ReminderSchemaEntityQuery.swift:5— /// Todo items are not cached locally, so this reads them from the server a list at a time, the same — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/App/Scenes/SceneManager.swift:6— // TODO: can i combine this with the enum? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/App/Scenes/SceneManager.swift:374— // TODO: does this actually happen in normal circumstances? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:22— // TODO: Move these methods below to their proper handlers — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/App/BarcodeScanner/Camera/BarcodeScannerView.swift:147— // TODO: Modernization - Consider adopting `prefersInterfaceOrientationLocked` (iOS 26+) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (8 lines × 2) Sources/App/BackgroundRefreshManager.swift:22— Sources/App/BackgroundRefreshManager.swift:22-29 | Sources/App/Utilities/RemindersSync/RemindersSyncBackgroundRefresher.swift:29-36 — 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/App/BackgroundRefreshManager.swift:22` 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/App/Onboarding/Views/BaseOnboardingView.swift:48— Sources/App/Onboarding/Views/BaseOnboardingView.swift:48-55 | Sources/App/Onboarding/Views/BaseOnboardingView.swift:77-84 — 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 before the matched lines, `Sources/App/Onboarding/Views/BaseOnboardingView.swift:47` calls `escaping` and `Sources/App/Onboarding/Views/BaseOnboardingView.swift:76` 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 × 2) Sources/App/TestFlightCommunication/TestFlightCommunicationView.swift:105— Sources/App/TestFlightCommunication/TestFlightCommunicationView.swift:105-112 | Sources/App/WhatsNew/WhatsNewView.swift:116-123 — 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/App/TestFlightCommunication/TestFlightCommunicationView.swift:105` 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 `height` to `48) .accessibilityHidden(true) VStack(alignment: .leading` in one and `46) .accessibilityHidden(true) 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 (8 lines × 2) Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:129— Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:129-136 | Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:151-158 — 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/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:184— Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:184-191 | Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:221-228 — 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/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:184` 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 (8 lines × 2) Sources/Extensions/AppIntents/Sensor/IntentSensorsAppEntity.swift:80— Sources/Extensions/AppIntents/Sensor/IntentSensorsAppEntity.swift:80-87 | Sources/Extensions/Widgets/Entities/WidgetEntitiesAppEntityQuery.swift:39-46 — 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 (8 lines × 2) Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:744— Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:744-751 | Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:768-775 — 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/Shared/Common/Extensions/CLKComplication+Strings.swift:744` 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.
Duplicated block (8 lines × 2) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:141— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:141-148 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift:136-143 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift` and `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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. 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 (8 lines × 2) Sources/App/Assist/AssistView.swift:654— Sources/App/Assist/AssistView.swift:654-661 | Sources/WatchApp/Assist/Views/ChatBubbleView.swift:63-70 — before extracting anything, compare `Sources/App/Assist/AssistView.swift` and `Sources/WatchApp/Assist/Views/ChatBubbleView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) Sources/App/Settings/Notifications/NotificationCategoryEditorView.swift:312— Sources/App/Settings/Notifications/NotificationCategoryEditorView.swift:312-319 | Sources/App/Settings/Notifications/NotificationCategoryListView.swift:141-148 — 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/HAModels/Sources/AppDeviceRegistry.swift:102— Sources/HAModels/Sources/AppDeviceRegistry.swift:102-109 | Sources/Shared/Environment/DeviceRegistryEntry.swift:65-72 — before extracting anything, compare `Sources/HAModels/Sources/AppDeviceRegistry.swift` and `Sources/Shared/Environment/DeviceRegistryEntry.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:280— Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:280-287 | Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift:255-262 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift` and `Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) Sources/Extensions/Widgets/Lockscreen/Details/WidgetDetails.swift:33— Sources/Extensions/Widgets/Lockscreen/Details/WidgetDetails.swift:33-40 | Sources/Extensions/Widgets/Lockscreen/Gauge/WidgetGauge.swift:32-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Extensions/Widgets/Lockscreen/Details/WidgetDetails.swift:30` calls `disfavoredInCarPlayIfAvailable` and `Sources/Extensions/Widgets/Lockscreen/Gauge/WidgetGauge.swift:29` 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 lines × 2) Sources/WatchApp/Home/Edit/WatchConfigAddAreaSourceView.swift:61— Sources/WatchApp/Home/Edit/WatchConfigAddAreaSourceView.swift:61-68 | Sources/WatchApp/Home/Edit/WatchConfigAddEntitySourceView.swift:65-75 — 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) Tools/BuildFrontendColors.py:157— Tools/BuildFrontendColors.py:157-164 | Tools/BuildFrontendColors.py:167-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyMethods: WebViewController Sources/App/Frontend/WebView/WebViewController/WebViewController.swift:14— TooManyMethods — 173 methods, declared across 22 files: WebViewController/WebViewController+WebKitDelegates.swift (19), WebViewController/WebViewController+ProtocolConformance.swift (18), WebViewController/WebViewController+URLLoading.swift (18), WebViewController/WebViewController.swift (17), +18 more file(s). The bar is 30 methods; this is 143 over it, 5.77× 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: HomeAssistantAPI Sources/Shared/API/HAAPI.swift:10— TooManyMethods — 88 methods, declared across 6 files: API/HAAPI.swift (62), API/WatchHelpers.swift (10), API/HomeAssistantAPI+Calendar.swift (7), API/HomeAssistantAPI+TodoList.swift (5), +2 more file(s). The bar is 30 methods; this is 58 over it, 2.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: CarPlayQuickAccessTemplate Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessTemplate.swift:7— TooManyMethods — 64 methods, declared across 2 files: QuickAccess/CarPlayQuickAccessTemplate.swift (62), QuickAccess/CarPlayActionsTemplate+Build.swift (2). The bar is 30 methods; this is 34 over it, 2.13× 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: WatchHomeViewModel Sources/WatchApp/Home/WatchHomeViewModel.swift:13— TooManyMethods — 60 methods, declared across 2 files: Home/WatchHomeViewModel.swift (38), Home/WatchHomeViewModel+Editing.swift (22). The bar is 30 methods; this is 30 over it, 2.00× 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: CarPlayAssistSession Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.swift:7— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WatchCommunicatorService Sources/Watch/WatchCommunicatorService.swift:8— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AssistViewModel Sources/App/Assist/AssistViewModel.swift:7— 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: WebRTCViewPlayerViewModel Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCViewPlayerViewModel.swift:19— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× 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: WatchConnectivityManager Sources/Shared/Watch/Connectivity/WatchConnectivityManager.swift:10— TooManyMethods — 42 methods, declared across 4 files: Connectivity/WatchConnectivityManager+Delegate.swift (17), Connectivity/WatchConnectivityManager.swift (12), Connectivity/WatchConnectivityManager+Send.swift (10), Connectivity/WatchConnectivityManager+SendQueue.swift (3). The bar is 30 methods; this is 12 over it, 1.40× 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: WebViewExternalMessageHandler Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:28— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WatchAssistViewModel Sources/WatchApp/Assist/WatchAssistViewModel.swift:10— TooManyMethods — 36 methods, declared across 2 files: Assist/WatchAssistViewModel.swift (35), Assist/WatchAssistView.swift (1). The bar is 30 methods; this is 6 over it, 1.20× 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: HATypedRequest Sources/Shared/HATypedRequest+App.swift:4— TooManyMethods — 35 methods, declared across 8 files: Shared/HATypedRequest+App.swift (25), MacSidebar/FrontendSidebarUserData.swift (3), Energy/EnergyStatistics.swift (2), Matter/HATypedRequest+Matter.swift (1), +4 more file(s). 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: WebRTCClient Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCClient.swift:270— 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.
TooManyMethods: ConnectionSettingsViewModel Sources/App/Settings/Connection/ConnectionSettingsViewModel.swift:9— 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.
Duplicated block (9 lines × 2) Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlViewModel.swift:176— Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlViewModel.swift:176-184 | Sources/CarPlay/Templates/Entities/Vacuum/CarPlayVacuumControlViewModel.swift:153-161 — 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. 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 × 2) Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlViewModel.swift:186— Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlViewModel.swift:186-194 | Sources/CarPlay/Templates/Entities/Vacuum/CarPlayVacuumControlViewModel.swift:163-171 — 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/CarPlay/Templates/Entities/Climate/CarPlayClimateControlViewModel.swift:186` 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 × 2) Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift:48— Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift:48-56 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntityQuery.swift:85-93 — 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/Extensions/AppIntents/Control/LockAppEntityQuery.swift:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift:43— Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift:43-51 | Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift:53-61 — before extracting anything, compare `Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift` and `Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift:43` 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 (9 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1189— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1189-1197 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1221-1229 — 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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1189` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1198` calls `init` and `Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1230` 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 × 2) Sources/WatchApp/Home/MagicItemRow/WatchComplicationRow.swift:80— Sources/WatchApp/Home/MagicItemRow/WatchComplicationRow.swift:80-88 | Sources/WatchApp/Home/MagicItemRow/WatchComplicationRow.swift:100-108 — 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/WatchApp/Home/MagicItemRow/WatchComplicationRow.swift:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/WatchApp/Home/WatchFolderContentView.swift:98— Sources/WatchApp/Home/WatchFolderContentView.swift:98-106 | Sources/WatchApp/Home/WatchHomeView.swift:360-368 — before extracting anything, compare `Sources/WatchApp/Home/WatchFolderContentView.swift` and `Sources/WatchApp/Home/WatchHomeView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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/WatchApp/Home/WatchFolderContentView.swift:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/WatchApp/Location/WatchLocationSettingsView.swift:17— Sources/WatchApp/Location/WatchLocationSettingsView.swift:17-25 | Sources/WatchApp/WatchSensorsSettingsView.swift:14-22 — 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/WatchApp/Location/WatchLocationSettingsView.swift:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/Shared/API/Models/AppZone.swift:325— Sources/Shared/API/Models/AppZone.swift:325-333 | Sources/Shared/API/Models/NotificationCategory.swift:144-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 both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/WatchApp/Home/Edit/WatchConfigAddAreaListView.swift:56— Sources/WatchApp/Home/Edit/WatchConfigAddAreaListView.swift:56-64 | Sources/WatchApp/Home/Edit/WatchConfigAddEntityListView.swift:83-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/App/Settings/Notifications/NotificationActionEditorView.swift:192— Sources/App/Settings/Notifications/NotificationActionEditorView.swift:192-200 | Sources/App/Settings/Notifications/NotificationCategoryEditorView.swift:236-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.
Duplicated block (9 lines × 2) Sources/Shared/API/Models/LocationHistory.swift:91— Sources/Shared/API/Models/LocationHistory.swift:91-99 | Sources/Shared/Database/RemindersSyncHistoryEntry+Database.swift:43-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) Sources/HADesignSystem/Sources/Components/HAEnergyDistributionCard.swift:74— Sources/HADesignSystem/Sources/Components/HAEnergyDistributionCard.swift:74-82 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1756-1764 — 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.
Change coupling: Widgets.swift ↔ WidgetsKind.swift Sources/Extensions/Widgets/Widgets.swift:1— `Sources/Extensions/Widgets/Widgets.swift` and `Sources/Shared/Widget/WidgetsKind.swift` change together 94% of the time (15 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 15 shared commits counted here, the most recent 3 are `98dc0643` Add Open Home Assistant control (#6130); `ab3d3c34` Add Common Controls widget (#4365); `7ab7aa09` Add camera list screen with server filtering, area display, and iOS 1… — run `git show` on any of them.
Change coupling: WatchHelpers.swift ↔ ExtensionDelegate.swift Sources/Shared/API/WatchHelpers.swift:1— `Sources/Shared/API/WatchHelpers.swift` and `Sources/WatchApp/ExtensionDelegate.swift` change together 55% of the time (18 of the 33 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 18 shared commits counted here, the most recent 3 are `28877533` Fix legacy watch complication rendering (#5416); `d6ddabad` Sync full database tables to Apple Watch (#5406); `49769eee` Fix Apple Watch database sync races (#5288) — run `git show` on any of them.
Change coupling: WatchMagicViewRowViewModel.swift ↔ WatchSettingsView.swift Sources/WatchApp/Home/MagicItemRow/WatchMagicViewRowViewModel.swift:1— `Sources/WatchApp/Home/MagicItemRow/WatchMagicViewRowViewModel.swift` and `Sources/WatchApp/WatchSettingsView.swift` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 6 shared commits counted here, the most recent 3 are `e8fcc217` Improve Apple watch items execution and logs export (#5186); `ba70db50` Improve watch magic item execution diagnostics and log export (#5144); `4810fc39` Always route watch magic items automatically, add developer menu with… — run `git show` on any of them.
Change coupling: WidgetBasicContainerView.swift ↔ WidgetBasicView.swift Sources/Extensions/Widgets/Common/WidgetBasicContainerView.swift:1— `Sources/Extensions/Widgets/Common/WidgetBasicContainerView.swift` and `Sources/Extensions/Widgets/Common/WidgetBasicView.swift` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 12 shared commits counted here, the most recent 3 are `fc064632` Fix widget systemSmall preview (#4274); `23edc7ce` Fix scripts execution (#3731); `fcfa5661` Add last update date and beta option to show entity state in widget (… — run `git show` on any of them.
Change coupling: HALockScreenView.swift ↔ HandlerLiveActivity.swift Sources/Extensions/Widgets/LiveActivity/HALockScreenView.swift:1— `Sources/Extensions/Widgets/LiveActivity/HALockScreenView.swift` and `Sources/Shared/Notifications/NotificationCommands/HandlerLiveActivity.swift` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 6 shared commits counted here, the most recent 3 are `7f32c18c` Allow choosing Live Activity progress bar fill direction (#5180); `6a5b9a9f` Fix Live Activity chronometer not rendering for count-up timers (#4908); `452df51b` Live Activity: tint the progress bar with progress_bar_color (#4829) — run `git show` on any of them.
Change coupling: CarPlaySceneDelegate.swift ↔ CarPlayAreasViewModel.swift Sources/App/Scenes/CarPlaySceneDelegate.swift:1— `Sources/App/Scenes/CarPlaySceneDelegate.swift` and `Sources/CarPlay/Templates/Areas/CarPlayAreasViewModel.swift` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 6 shared commits counted here, the most recent 3 are `c01af4ce` Refactor CarPlay to allow configuring itself directly in the car scre…; `6d0b901f` Subscribe to quick access entity changes on top of the standard CarPl…; `882d8045` Improv CarPlay states subscription (#3236) — run `git show` on any of them.
Change coupling: WidgetBasicView.swift ↔ WidgetOpenPage.swift Sources/Extensions/Widgets/Common/WidgetBasicView.swift:1— `Sources/Extensions/Widgets/Common/WidgetBasicView.swift` and `Sources/Extensions/Widgets/OpenPage/WidgetOpenPage.swift` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 6 shared commits counted here, the most recent 3 are `86e7c7b2` Simplify widgets and small UI tweaks (#2863); `e3645070` Add action widgets, open page widgets, and gauges on the Lock Screen …; `78826d24` Actions widget with background execution (#2617) — run `git show` on any of them.
Change coupling: CarPlayDomainsListTemplate.swift ↔ CarPlayServerListTemplate.swift Sources/CarPlay/Templates/Domains/CarPlayDomainsListTemplate.swift:1— `Sources/CarPlay/Templates/Domains/CarPlayDomainsListTemplate.swift` and `Sources/CarPlay/Templates/Servers/CarPlayServerListTemplate.swift` change together 50% of the time (5 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 5 shared commits counted here, the most recent 3 are `6d0b901f` Subscribe to quick access entity changes on top of the standard CarPl…; `1a733042` Rename CarPlay folder (#2707); `ca0313d6` Add confirmation icon for actions execution and icon colors based on … (at that commit the files were still `Sources/Vehicle/Templates/Domains/CarPlayDomainsListTemplate.swift` and `Sources/Vehicle/Templates/Servers/CarPlayServerListTemplate.swift`) — run `git show` on any of them.
Change coupling: WidgetScriptsAppIntentTimelineProvider.swift ↔ WidgetSensorsAppIntentTimelineProvider.swift Sources/Extensions/AppIntents/Widget/Script/WidgetScriptsAppIntentTimelineProvider.swift:1— `Sources/Extensions/AppIntents/Widget/Script/WidgetScriptsAppIntentTimelineProvider.swift` and `Sources/Extensions/AppIntents/Widget/Sensor/WidgetSensorsAppIntentTimelineProvider.swift` change together 50% of the time (5 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 5 shared commits counted here, the most recent 3 are `4d05402a` Show mocked data in widget gallery previews (#5380); `cc59047b` Fix widget corner radius when size style compressed and preview them …; `19c3d6e6` Bump number of widgets allowed and refactor UI creation logic (#3207) — run `git show` on any of them.
Change coupling: CarPlayDomainsListTemplate.swift ↔ CarPlayQuickAccessViewModel.swift Sources/CarPlay/Templates/Domains/CarPlayDomainsListTemplate.swift:1— `Sources/CarPlay/Templates/Domains/CarPlayDomainsListTemplate.swift` and `Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessViewModel.swift` change together 50% of the time (5 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 5 shared commits counted here, the most recent 3 are `3227bd50` Add condensed grid support to CarPlay templates (#4460); `1a733042` Rename CarPlay folder (#2707) (at that commit the file was still `Sources/CarPlay/Templates/Actions/CarPlayActionsViewModel.swift`); `ca0313d6` Add confirmation icon for actions execution and icon colors based on … (at that commit the files were still `Sources/Vehicle/Templates/Domains/CarPlayDomainsListTemplate.swift` and `Sources/Vehicle/Templates/Actions/CarPlayActionsViewModel.swift`) — run `git show` on any of them.
Change coupling: MagicItemAddViewModel.swift ↔ Strings.swift Sources/App/Settings/MagicItem/Add/MagicItemAddViewModel.swift:1— `Sources/App/Settings/MagicItem/Add/MagicItemAddViewModel.swift` and `Sources/Shared/Resources/Swiftgen/Strings.swift` change together 50% of the time (5 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 5 shared commits counted here, the most recent 3 are `296cebbf` Expand watch app entity support to all actionable domains (#5255); `6f1aed6a` Merge Watch script/scene picker into one entity list, add automations…; `0b54ebad` Add Assist as option to CarPlay configuration (#4516) — run `git show` on any of them.
Repeated repair: Sources/WatchWidgets/Complications/CornerComplicationView.swift Sources/WatchWidgets/Complications/CornerComplicationView.swift:37— Sources/WatchWidgets/Complications/CornerComplicationView.swift changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is CornerComplicationView.cornerContent at line 37), 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 complication icon color on the watch face (#5758)”; “Fix complication text color not being applied (#5556)”; “Fix corner complication rendering empty when it has an icon (#5512)”; “Fix legacy watch complication rendering (#5416)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchWidgets/Complications/CornerComplicationView.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/Shared/Environment/FocusFilterWrapper.swift Sources/Shared/Environment/FocusFilterWrapper.swift:67— Sources/Shared/Environment/FocusFilterWrapper.swift changed 6 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 7 (its worst body is FocusFilterWrapper.readFromIOS at line 67), 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 Focus sensors reporting a stale state (#6129)”; “Fix Focus sensors sticking and retry failed sensor updates (#6006)”; “Fix Focus name reporting when the app is not running (#5501)”; “Fix Focus name sensor reporting "Not focused" while a Focus is running (#5471)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/Environment/FocusFilterWrapper.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/Shared/API/Webhook/Sensors/FocusSensor.swift Sources/Shared/API/Webhook/Sensors/FocusSensor.swift:22— Sources/Shared/API/Webhook/Sensors/FocusSensor.swift changed 5 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 3 (its worst body is FocusSensorUpdateSignaler.observe at line 22), 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 Focus sensors reporting a stale state (#6129)”; “Fix Focus sensors sticking and retry failed sensor updates (#6006)”; “Fix Focus name sensor reporting "Not focused" while a Focus is running (#5471)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/API/Webhook/Sensors/FocusSensor.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/Shared/API/Models/LegacyComplicationRender.swift Sources/Shared/API/Models/LegacyComplicationRender.swift:77— Sources/Shared/API/Models/LegacyComplicationRender.swift changed 5 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 11 (its worst body is LegacyComplicationRender.init at line 77), 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 legacy rectangular complication layout and text colors (#5721)”; “Fix legacy text-only complications showing an icon (#5634)”; “Fix legacy watch complication rendering (#5416)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/API/Models/LegacyComplicationRender.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/App/Frontend/WebView/WebViewController/WebViewController+Settings.swift Sources/App/Frontend/WebView/WebViewController/WebViewController+Settings.swift:78— Sources/App/Frontend/WebView/WebViewController/WebViewController+Settings.swift changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is WebViewController.updateThemedStatusBar at line 78), 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 top space reserved in full screen on iPad (#6008)”; “Fix iPadOS window controls covering the sidebar button (#5768)”; “Fix kiosk mode "Hide status bar" having no effect (#5321)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/App/Frontend/WebView/WebViewController/WebViewController+Settings.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/WatchApp/Complication/ComplicationStateFetcher.swift Sources/WatchApp/Complication/ComplicationStateFetcher.swift:122— Sources/WatchApp/Complication/ComplicationStateFetcher.swift changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is ComplicationStateFetcher.renderTemplate at line 122), 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 relayed watch requests running late and being reported as failed (#5890)”; “Fix legacy watch complication rendering (#5416)”; “Fix Apple Watch complications freezing at old values (#5370)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchApp/Complication/ComplicationStateFetcher.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/WatchApp/Complication/WatchWidgetComplicationSnapshot+RenderModel.swift Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot+RenderModel.swift:59— Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot+RenderModel.swift changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is WatchWidgetComplicationSnapshot.color at line 59), 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 complication icon color on the watch face (#5758)”; “Fix legacy rectangular complication layout and text colors (#5721)”; “Fix legacy watch complications rendering blank on the watch face (#5343)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot+RenderModel.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/Shared/Intents/FocusStatusIntentHandler.swift Sources/Shared/Intents/FocusStatusIntentHandler.swift:14— Sources/Shared/Intents/FocusStatusIntentHandler.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 2 (its worst body is FocusStatusIntentHandler.handle at line 14), 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 Focus sensors reporting a stale state (#6129)”; “Fix Focus sensors sticking and retry failed sensor updates (#6006)”; “Fix Focus name reporting when the app is not running (#5501)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/Shared/Intents/FocusStatusIntentHandler.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/HAWatchComplications/Sources/RectangularProgressView.swift Sources/HAWatchComplications/Sources/RectangularProgressView.swift:120— Sources/HAWatchComplications/Sources/RectangularProgressView.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 4 (its worst body is RectangularProgressView.body at line 120), 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 legacy rectangular complication layout and text colors (#5721)”; “Fix complication text color not being applied (#5556)”; “Fix rectangular complication background and night mode value (#5436)”. 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 17:47:35 +00:00' --until='2026-10-28 17:47:35 +00:00' --full-history --no-merges -- Sources/HAWatchComplications/Sources/RectangularProgressView.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 (14 lines × 2) Sources/App/Frontend/IncomingURLHandler.swift:788— Sources/App/Frontend/IncomingURLHandler.swift:788-801 | Sources/App/Frontend/IncomingURLHandler.swift:830-843 — 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/App/Frontend/IncomingURLHandler.swift:788` 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 (14 lines × 2) Sources/App/Onboarding/Steps/Permissions/Steps/LocalAccessAndNetworkInput/LocalAccess/LocalAccessPermissionView.swift:82— Sources/App/Onboarding/Steps/Permissions/Steps/LocalAccessAndNetworkInput/LocalAccess/LocalAccessPermissionView.swift:82-95 | Sources/App/Onboarding/Steps/Permissions/Steps/Privacy/OnboardingPrivacyView.swift:61-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/Onboarding/Steps/Permissions/Steps/LocalAccessAndNetworkInput/LocalAccess/LocalAccessPermissionView.swift:82` 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 (14 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:491— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:491-504 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:505-518 — 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:491` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:504` calls `constant` and `Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:490` 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 (14 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:676— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:676-689 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:362-375 — 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:676` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:691` calls `HAMoreInfoCommand` and `Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:377` 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 (14 lines × 2) Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift:40— Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift:40-53 | Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileSensorView.swift:32-45 — before extracting anything, compare `Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift` and `Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileSensorView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (14 lines × 2) Sources/Shared/API/Webhook/Sensors/BatterySensor.swift:83— Sources/Shared/API/Webhook/Sensors/BatterySensor.swift:83-96 | Sources/Shared/API/Webhook/Sensors/BatterySensor.swift:99-112 — 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 (14 lines × 2) Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:19— Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:19-32 | Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:34-47 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) Sources/Shared/Environment/AppDatabaseUpdater.swift:762— Sources/Shared/Environment/AppDatabaseUpdater.swift:762-775 | Sources/Shared/Environment/AppDatabaseUpdater.swift:831-844 — 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/Shared/Environment/AppDatabaseUpdater.swift:762` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:69— Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:69-82 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift:33-46 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift` and `Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:69` 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 (13 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:114— Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:114-126 | Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift:291-303 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift` and `Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 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/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:114` 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 (13 lines × 2) Sources/App/Settings/Notifications/NotificationCategoryListView.swift:60— Sources/App/Settings/Notifications/NotificationCategoryListView.swift:60-72 | Sources/App/Settings/Notifications/NotificationCategoryListView.swift:97-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/App/Settings/Notifications/NotificationCategoryListView.swift:60` 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 (13 lines × 2) Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:103— Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:103-115 | Sources/Extensions/Widgets/Entities/WidgetEntities.swift:90-102 — before extracting anything, compare `Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift` and `Sources/Extensions/Widgets/Entities/WidgetEntities.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:103` 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 (13 lines × 2) Sources/HADesignSystem/Sources/Components/HAStatisticsChart.swift:96— Sources/HADesignSystem/Sources/Components/HAStatisticsChart.swift:96-108 | Sources/HADesignSystem/Sources/Components/HAStatisticsGraphCard.swift:32-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) Sources/HADesignSystem/Sources/Gallery/Widgets/WidgetGalleryItem.swift:24— Sources/HADesignSystem/Sources/Gallery/Widgets/WidgetGalleryItem.swift:24-36 | Sources/HADesignSystem/Sources/Gallery/Widgets/WidgetGalleryItem.swift:39-51 — 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/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift:206— Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift:206-218 | Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileSensorView.swift:113-125 — before extracting anything, compare `Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift` and `Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileSensorView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/HADesignSystem/Sources/Widgets/Common/WidgetTileButtonView.swift:206` 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 (13 lines × 2) Sources/Shared/API/HomeAssistantAPI+Calendar.swift:44— Sources/Shared/API/HomeAssistantAPI+Calendar.swift:44-56 | Sources/Shared/API/HomeAssistantAPI+Calendar.swift:102-114 — 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/Shared/API/HomeAssistantAPI+Calendar.swift:44` 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/Watch/WatchCommunicatorService.swift:603— Sources/Watch/WatchCommunicatorService.swift:603-615 | Sources/WatchApp/Home/WatchHomeViewModel+Editing.swift:264-276 — 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/Watch/WatchCommunicatorService.swift:603` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Sources/HADesignSystem/Sources/Components/HASelectBoxOption.swift:15— Sources/HADesignSystem/Sources/Components/HASelectBoxOption.swift:15-27 | Sources/HADesignSystem/Sources/Components/HATodoItem.swift:17-29 — 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 (12 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:17— Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:17-28 | Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift:19-30 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift` and `Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:17` 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 (12 lines × 2) Sources/App/Settings/Connection/ConnectionSettingsView.swift:82— Sources/App/Settings/Connection/ConnectionSettingsView.swift:82-93 | Sources/App/Settings/Connection/ConnectionSettingsView.swift:250-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) Sources/App/TestFlightCommunication/TestFlightCommunicationView.swift:129— Sources/App/TestFlightCommunication/TestFlightCommunicationView.swift:129-140 | Sources/App/WhatsNew/WhatsNewIconView.swift:11-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:111— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:111-122 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:101-112 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift` and `Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntitiesTimelineProvider.swift:154— Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntitiesTimelineProvider.swift:154-165 | Sources/Extensions/Widgets/Entities/WidgetEntitiesTimelineProvider.swift:102-113 — 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/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntitiesTimelineProvider.swift:154` 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 (12 lines × 2) Sources/Shared/AreasService.swift:46— Sources/Shared/AreasService.swift:46-57 | Sources/Shared/AreasService.swift:86-97 — 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/Shared/AreasService.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 (12 lines × 2) Sources/WatchApp/Home/Edit/WatchConfigAddEntityAreaFilterView.swift:46— Sources/WatchApp/Home/Edit/WatchConfigAddEntityAreaFilterView.swift:46-57 | Sources/WatchApp/Home/Edit/WatchConfigAddEntityListView.swift:98-109 — 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 (12 lines × 2) Sources/WatchApp/Home/WatchFolderContentView.swift:112— Sources/WatchApp/Home/WatchFolderContentView.swift:112-123 | Sources/WatchApp/Home/WatchHomeView.swift:440-451 — before extracting anything, compare `Sources/WatchApp/Home/WatchFolderContentView.swift` and `Sources/WatchApp/Home/WatchHomeView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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/WatchApp/Home/WatchFolderContentView.swift:112` 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 (12 lines × 2) Sources/Extensions/AppIntents/ShortcutAppIntentSupport.swift:6— Sources/Extensions/AppIntents/ShortcutAppIntentSupport.swift:6-17 | Sources/HANetworking/Sources/Guarantee+Additions.swift:11-22 — 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 × 3) Sources/HADesignSystem/Sources/Components/HAControlSelect.swift:99— Sources/HADesignSystem/Sources/Components/HAControlSelect.swift:99-104 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1184-1189 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1205-1210 — 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/HADesignSystem/Sources/Components/HAControlSelect.swift:99` 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/HADesignSystem/Sources/Components/HAThermostatCard.swift:29— Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:29-34 | Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:55-60 | Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:155-161 — 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. 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 (6 lines × 3) Sources/Shared/Watch/Complications/ComplicationRenderContext.swift:211— Sources/Shared/Watch/Complications/ComplicationRenderContext.swift:211-216 | Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:108-113 | Sources/WatchWidgets/WatchWidgetLiveFetch.swift:359-364 — 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 `Sources/Shared/Watch/Complications/ComplicationRenderContext.swift:211` 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/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:57— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:57-62 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:47-52 | Sources/Extensions/AppIntents/EntityState/ReadableEntityAppEntity.swift:45-50 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift` and `Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 87 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 (6 lines × 3) Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift:34— Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift:34-39 | Sources/Extensions/AppIntents/Control/LockAppEntity.swift:34-39 | Sources/Extensions/AppIntents/Control/ThermostatAppEntity.swift:34-39 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift` and `Sources/Extensions/AppIntents/Control/LockAppEntity.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 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 (6 lines × 3) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:58— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:58-63 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift:73-78 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsViewModel.swift:56-61 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift` and `Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) Sources/Shared/API/Webhook/Sensors/ActiveSensor.swift:6— Sources/Shared/API/Webhook/Sensors/ActiveSensor.swift:6-11 | Sources/Shared/API/Webhook/Sensors/FocusNameSensor.swift:10-15 | Sources/Shared/API/Webhook/Sensors/FocusSensor.swift:10-15 — 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.
Swallowed exception (caught, then discarded) Sources/Shared/Notifications/UNNotificationContent+Additions.swift:35— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Shared/Environment/Environment.swift:595— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/HANetworking/Sources/SecurityExceptions.swift:60— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/HADesignSystem/Sources/Components/FullScreenLoaderView.swift:91— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/App/Settings/AcknowledgementPackage.swift:61— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/App/Resources/WebSocketBridge.js:44— `catch (error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCClient.swift:123— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (19 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:31— Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:31-49 | Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift:32-50 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift` and `Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:31` 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 (19 lines × 2) Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:14— Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:14-32 | Sources/App/Settings/MagicItem/AssistPipelinePicker.swift:36-54 — before extracting anything, compare `Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift` and `Sources/App/Settings/MagicItem/AssistPipelinePicker.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:14` 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 (19 lines × 2) Sources/App/TestFlightCommunication/TestFlightCommunicationView.swift:13— Sources/App/TestFlightCommunication/TestFlightCommunicationView.swift:13-31 | Sources/App/WhatsNew/WhatsNewView.swift:13-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/TestFlightCommunication/TestFlightCommunicationView.swift:13` 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 (19 lines × 2) Sources/Shared/Common/Extensions/CMMotion+StringExtensions.swift:8— Sources/Shared/Common/Extensions/CMMotion+StringExtensions.swift:8-26 | Sources/Shared/Common/Extensions/CMMotion+StringExtensions.swift:28-46 — 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 (19 lines × 2) Sources/WatchApp/Home/WatchFolderContentView.swift:47— Sources/WatchApp/Home/WatchFolderContentView.swift:47-65 | Sources/WatchApp/Home/WatchHomeView.swift:308-326 — before extracting anything, compare `Sources/WatchApp/Home/WatchFolderContentView.swift` and `Sources/WatchApp/Home/WatchHomeView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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/WatchApp/Home/WatchFolderContentView.swift:47` 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 (19 lines × 2) Sources/WatchApp/Home/WatchFolderContentView.swift:130— Sources/WatchApp/Home/WatchFolderContentView.swift:130-148 | Sources/WatchApp/Home/WatchHomeView.swift:460-478 — before extracting anything, compare `Sources/WatchApp/Home/WatchFolderContentView.swift` and `Sources/WatchApp/Home/WatchHomeView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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/WatchApp/Home/WatchFolderContentView.swift:130` 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/WatchApp/Home/WatchHomeView.swift:459` calls `WatchFolderRow`, `info` and `Sources/WatchApp/Home/WatchFolderContentView.swift:129` 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 × 3) Sources/CarPlay/Templates/Areas/CarPlayAreasViewModel.swift:65— Sources/CarPlay/Templates/Areas/CarPlayAreasViewModel.swift:65-71 | Sources/CarPlay/Templates/Domains/CarPlayDomainsListViewModel.swift:61-67 | Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessTemplate.swift:689-695 — 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 `Sources/CarPlay/Templates/Areas/CarPlayAreasViewModel.swift:65` 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) Sources/Extensions/AppIntents/Script/ScriptAppIntent.swift:35— Sources/Extensions/AppIntents/Script/ScriptAppIntent.swift:35-43 | Sources/Extensions/Widgets/Controls/Automation/AutomationAppIntent.swift:41-47 | Sources/Extensions/Widgets/Scene/SceneAppIntent.swift:35-41 — 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 `Sources/Extensions/AppIntents/Script/ScriptAppIntent.swift:35` 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) Sources/App/Onboarding/API/OnboardingAuthPresenter.swift:127— Sources/App/Onboarding/API/OnboardingAuthPresenter.swift:127-133 | Sources/App/Utilities/MenuManager.swift:407-413 | Sources/WatchApp/Utilities/WatchExtendedRuntimeSessionManager.swift:23-29 — 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.
Duplicated block (7 lines × 3) Sources/WatchApp/Home/Areas/WatchAreaItemRow.swift:81— Sources/WatchApp/Home/Areas/WatchAreaItemRow.swift:81-87 | Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift:92-98 | Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:77-83 — before extracting anything, compare `Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift` and `Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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 (7 lines × 3) Sources/WatchApp/Home/Areas/WatchAreaItemRow.swift:89— Sources/WatchApp/Home/Areas/WatchAreaItemRow.swift:89-95 | Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift:100-106 | Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:85-91 — before extracting anything, compare `Sources/WatchApp/Home/MagicItemRow/WatchAssistItemRow.swift` and `Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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 (7 lines × 3) Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:20— Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:20-26 | Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift:20-26 | Sources/Extensions/AppIntents/Control/ThermostatAppEntityQuery.swift:20-26 — 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.
Duplicated block (17 lines × 2) Sources/App/Cameras/CameraPlayer/CameraMJPEGPlayerView.swift:48— Sources/App/Cameras/CameraPlayer/CameraMJPEGPlayerView.swift:48-64 | Sources/App/Cameras/CameraPlayer/CameraStreamHLSView.swift:52-68 — 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/App/Cameras/CameraPlayer/CameraMJPEGPlayerView.swift:48` 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 (17 lines × 2) Sources/Extensions/AppIntents/Control/ControlResultSnippetView.swift:54— Sources/Extensions/AppIntents/Control/ControlResultSnippetView.swift:54-70 | Sources/Extensions/AppIntents/EntityState/EntityStateSnippetView.swift:18-34 — 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 (17 lines × 2) Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:60— Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:60-76 | Sources/Extensions/Widgets/Entities/WidgetEntities.swift:50-66 — before extracting anything, compare `Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift` and `Sources/Extensions/Widgets/Entities/WidgetEntities.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:60` 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/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:78— Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:78-94 | Sources/Extensions/Widgets/Entities/WidgetEntities.swift:68-84 — before extracting anything, compare `Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift` and `Sources/Extensions/Widgets/Entities/WidgetEntities.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:78` 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, `Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:97` calls `getAreaName` and `Sources/Extensions/Widgets/Entities/WidgetEntities.swift:85` 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 (17 lines × 2) Sources/Shared/Common/Extensions/Reachability+NetworkType.swift:22— Sources/Shared/Common/Extensions/Reachability+NetworkType.swift:22-38 | Sources/Shared/Common/Extensions/Reachability+NetworkType.swift:47-63 — 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 (16 lines × 2) Sources/App/Settings/Focus/FocusHowItWorksView.swift:74— Sources/App/Settings/Focus/FocusHowItWorksView.swift:74-89 | Sources/App/Settings/Settings/ServerSwitchingHowItWorksView.swift:64-79 — 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 (16 lines × 2) Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:383— Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:383-398 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:428-443 — 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/App/Settings/LiveActivity/LiveActivitySettingsView.swift:383` 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 (16 lines × 2) Sources/App/Settings/ManageStorage/ManageStorageCategory.swift:19— Sources/App/Settings/ManageStorage/ManageStorageCategory.swift:19-34 | Sources/App/Settings/ManageStorage/ManageStorageCategory.swift:36-51 — 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 (16 lines × 2) Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:30— Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:30-45 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:51-66 — 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/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:30` 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 lines × 2) Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift:157— Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift:157-172 | Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift:183-198 — before extracting anything, compare `Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift` and `Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift:157` 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) Sources/App/Settings/Calendars/HACalendarAppEntityQuery.swift:31— Sources/App/Settings/Calendars/HACalendarAppEntityQuery.swift:31-45 | Sources/Extensions/Widgets/Calendar/WidgetCalendarAppEntityQuery.swift:34-48 — 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/App/Settings/Calendars/HACalendarAppEntityQuery.swift:31` 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 (15 lines × 2) Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:166— Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:166-180 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:187-201 — 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/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:166` 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 (15 lines × 2) Sources/CarPlay/Templates/Areas/CarPlayAreasViewModel.swift:77— Sources/CarPlay/Templates/Areas/CarPlayAreasViewModel.swift:77-91 | Sources/CarPlay/Templates/Domains/CarPlayDomainsListViewModel.swift:73-87 — 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/CarPlay/Templates/Areas/CarPlayAreasViewModel.swift:77` 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 `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 (15 lines × 2) Sources/Shared/Environment/DeviceBattery.swift:107— Sources/Shared/Environment/DeviceBattery.swift:107-121 | Sources/Shared/Environment/DeviceBattery.swift:126-140 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `device` to `UIDevice` in one and `WKInterfaceDevice` 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 (15 lines × 2) Sources/WatchApp/Home/Areas/WatchAreaRow.swift:47— Sources/WatchApp/Home/Areas/WatchAreaRow.swift:47-61 | Sources/WatchApp/Home/Areas/WatchAreasGroupRow.swift:48-62 — 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/WatchApp/Home/Areas/WatchAreaRow.swift:47` 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 × 3) Sources/Extensions/Widgets/Controls/Fan/FanIntent.swift:21— Sources/Extensions/Widgets/Controls/Fan/FanIntent.swift:21-28 | Sources/Extensions/Widgets/Controls/Light/LightIntent.swift:21-28 | Sources/Extensions/Widgets/Controls/Switch/SwitchIntent.swift:21-28 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Extensions/Widgets/Controls/Switch/SwitchIntent.swift:31` calls `Domain` and `Sources/Extensions/Widgets/Controls/Fan/FanIntent.swift:30` 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 lines × 3) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:34— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:34-41 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift:35-42 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift:40-47 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift` and `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) Sources/Extensions/Widgets/Controls/Automation/ControlAutomationsValueProvider.swift:17— Sources/Extensions/Widgets/Controls/Automation/ControlAutomationsValueProvider.swift:17-24 | Sources/Extensions/Widgets/Scene/Control/ControlScenesValueProvider.swift:16-23 | Sources/Extensions/Widgets/Script/Control/ControlScriptsValueProvider.swift:16-23 — 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.
Duplicated block (8 lines × 3) Sources/Extensions/Widgets/Controls/Automation/ControlAutomationsValueProvider.swift:26— Sources/Extensions/Widgets/Controls/Automation/ControlAutomationsValueProvider.swift:26-33 | Sources/Extensions/Widgets/Scene/Control/ControlScenesValueProvider.swift:25-32 | Sources/Extensions/Widgets/Script/Control/ControlScriptsValueProvider.swift:25-32 — 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.
Duplicated block (8 lines × 3) Sources/Extensions/Widgets/Controls/Automation/ControlAutomationsValueProvider.swift:35— Sources/Extensions/Widgets/Controls/Automation/ControlAutomationsValueProvider.swift:35-42 | Sources/Extensions/Widgets/Scene/Control/ControlScenesValueProvider.swift:34-41 | Sources/Extensions/Widgets/Script/Control/ControlScriptsValueProvider.swift:34-41 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `configuration` to `ControlAutomationConfiguration` in one and `ControlSceneConfiguration` 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.
Off the main sequence: HAModels — HAModels: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: HAUtilities — HAUtilities: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: HAWatchCommunicationMessages — HAWatchCommunicationMessages: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: HAWatchComplications — HAWatchComplications: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: HAIconic — HAIconic: abstractness 0.14, instability 0.00, distance 0.86 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:38— Sources/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:38-85 | Sources/App/Settings/Connection/ConnectionURLsHowItWorksView.swift:48-147 | Sources/App/Settings/Focus/FocusHowItWorksView.swift:74-89 | Sources/App/Settings/Settings/ServerSwitchingHowItWorksView.swift:64-79 — 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/Extensions/NotificationContent/CameraStreamWebRTCViewController.swift:105— Sources/Extensions/NotificationContent/CameraStreamWebRTCViewController.swift:105-127 | Sources/Extensions/NotificationContent/CameraViewController.swift:119-142 | Sources/Extensions/NotificationContent/NotificationViewController.swift:15-34 | Sources/Extensions/NotificationContent/VideoAudioAttachmentViewController.swift:54-70 — 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/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:45— Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:45-71 | Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift:47-73 | Sources/Extensions/Widgets/Controls/Light/ControlLightsValueProvider.swift:57-83 | Sources/Extensions/Widgets/Controls/Switch/ControlSwitchValueProvider.swift:48-74 — 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/Shared/Environment/AppConstants.swift:328— Sources/Shared/Environment/AppConstants.swift:328-340 | Sources/Shared/Environment/AppConstants.swift:342-354 | Sources/Shared/Environment/AppConstants.swift:356-368 | Sources/Shared/Environment/AppConstants.swift:390-402 — 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.
Duplicated block (15 lines × 3) Sources/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:67— Sources/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:67-81 | Sources/App/Settings/Connection/ConnectionURLsHowItWorksView.swift:59-73 | Sources/App/Settings/Connection/ConnectionURLsHowItWorksView.swift:78-92 — 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/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:67` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `systemSymbol` to `topic.symbol) .font(.title3) .foregroundStyle(.haPrimary) .frame(width: 32) VStack(alignment: .leading` in one and `step.symbol) .font(.title3) .foregroundStyle(.haPrimary) .frame(width: 32) 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 (15 lines × 3) Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:382— Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:382-396 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:427-441 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:652-666 — 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/App/Settings/LiveActivity/LiveActivitySettingsView.swift:382` 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 (15 lines × 3) Sources/HAModels/Sources/AppDeviceRegistry.swift:63— Sources/HAModels/Sources/AppDeviceRegistry.swift:63-77 | Sources/HAModels/Sources/HACalendarEventRecord.swift:40-54 | Sources/Shared/Environment/DeviceRegistryEntry.swift:110-124 — before extracting anything, compare `Sources/HAModels/Sources/AppDeviceRegistry.swift` and `Sources/HAModels/Sources/HACalendarEventRecord.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/HAModels/Sources/AppDeviceRegistry.swift:63` 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 (15 lines × 3) Sources/Shared/Environment/AppDatabaseUpdater.swift:705— Sources/Shared/Environment/AppDatabaseUpdater.swift:705-719 | Sources/Shared/Environment/AppDatabaseUpdater.swift:780-794 | Sources/Shared/Environment/AppDatabaseUpdater.swift:849-863 — 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/Shared/Environment/AppDatabaseUpdater.swift:705` 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) Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:107— Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:107-115 | Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:121-129 | Sources/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:136-144 — 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/App/Frontend/ConnectivityCheck/ConnectivityCheckView.swift:107` 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) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:82— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:82-90 | Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:114-122 | Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:144-152 — 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/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:82` 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) Sources/Shared/Database/FocusName+Database.swift:40— Sources/Shared/Database/FocusName+Database.swift:40-48 | Sources/Shared/Database/RemindersSyncConfig+Database.swift:20-28 | Sources/Shared/Database/RemindersSyncItemLink+Database.swift:20-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 3 call sites, so a change lands once.
Duplicated block (9 lines × 3) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:78— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:78-86 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift:76-84 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift:93-101 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift` and `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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.
Change-coupling hub: WebViewController.swift → WebViewJavascriptCommands.swift, OnboardingAuthLoginViewModel.swift, WebSocketBridge.js Sources/App/Frontend/WebView/WebViewController/WebViewController.swift— `Sources/App/Frontend/WebView/WebViewController/WebViewController.swift` changes together with 3 other files — `Sources/App/Frontend/WebView/WebViewJavascriptCommands.swift`, `Sources/App/Onboarding/API/OnboardingAuthLoginViewModel.swift`, `Sources/App/Resources/WebSocketBridge.js` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: HAAPI.swift → AuthenticationAPI.swift, Promise+WebhookJson.swift, ConnectivitySensor.swift Sources/Shared/API/HAAPI.swift— `Sources/Shared/API/HAAPI.swift` changes together with 3 other files — `Sources/HANetworking/Sources/AuthenticationAPI.swift`, `Sources/Shared/API/Webhook/Networking/Promise+WebhookJson.swift`, `Sources/Shared/API/Webhook/Sensors/ConnectivitySensor.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: WatchConfigurationViewModel.swift → CarPlayConfigurationViewModel.swift, MagicItemProvider.swift, WatchCommunicatorService.swift Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationViewModel.swift— `Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationViewModel.swift` changes together with 3 other files — `Sources/App/Settings/CarPlay/CarPlayConfigurationViewModel.swift`, `Sources/Shared/MagicItem/MagicItemProvider.swift`, `Sources/Watch/WatchCommunicatorService.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Duplicated block (22 lines × 2) Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlViewModel.swift:152— Sources/CarPlay/Templates/Entities/Climate/CarPlayClimateControlViewModel.swift:152-173 | Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlViewModel.swift:199-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (22 lines × 2) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:40— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:40-61 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift:37-58 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift` and `Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:40` 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 (22 lines × 2) fastlane/lanes/localization.rb:470— fastlane/lanes/localization.rb:470-491 | fastlane/lanes/localization.rb:496-517 — 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 `fastlane/lanes/localization.rb:470` 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 (13 lines × 4) Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:382— Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:382-395 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:427-440 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:588-600 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:652-665 — 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/App/Settings/LiveActivity/LiveActivitySettingsView.swift:382` 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.
Duplicated block (13 lines × 4) Sources/Extensions/Widgets/Common/WidgetBasicViewModel.swift:28— Sources/Extensions/Widgets/Common/WidgetBasicViewModel.swift:28-40 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:106-118 | Sources/HADesignSystem/Sources/Widgets/Common/WidgetTileModel.swift:23-35 | Sources/HAModels/Sources/KioskSettings.swift:128-140 — before extracting anything, compare `Sources/Extensions/Widgets/Common/WidgetBasicViewModel.swift` and `Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 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/Extensions/Widgets/Common/WidgetBasicViewModel.swift:28` 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 × 4) Sources/Shared/Environment/AppConstants.swift:328— Sources/Shared/Environment/AppConstants.swift:328-340 | Sources/Shared/Environment/AppConstants.swift:342-354 | Sources/Shared/Environment/AppConstants.swift:356-368 | Sources/Shared/Environment/AppConstants.swift:390-402 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 3) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:92— Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:92-104 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoHumidifier.swift:35-47 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoWaterHeater.swift:37-49 — before extracting anything, compare `Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift` and `Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoWaterHeater.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 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/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:92` 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 × 3) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:150— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:150-162 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift:145-157 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift:190-202 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift` and `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.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 (13 lines × 3) Sources/WatchApp/Home/WatchHomeViewModel+Editing.swift:187— Sources/WatchApp/Home/WatchHomeViewModel+Editing.swift:187-199 | Sources/WatchApp/WatchConfigAssistViewModel.swift:169-181 | Sources/WatchApp/WatchSettingsViewModel.swift:66-78 — 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 (10–11 lines × 2) Sources/App/Settings/MagicItem/Add/AssistPromptMagicItemView.swift:62— Sources/App/Settings/MagicItem/Add/AssistPromptMagicItemView.swift:62-71 | Sources/WatchApp/Home/Edit/WatchConfigAddAssistPromptView.swift:52-62 — 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/App/Settings/MagicItem/Add/AssistPromptMagicItemView.swift:62` 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 (10–11 lines × 2) Sources/HADesignSystem/Sources/Colors/FrontendColors+Color.swift:129— Sources/HADesignSystem/Sources/Colors/FrontendColors+Color.swift:129-139 | Sources/Shared/Environment/FrontendThemeProvider.swift:140-149 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 2) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:221— Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:221-231 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoControlSelectContainer.swift:60-69 — 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/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:221` 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.
Duplicated block (10 lines × 5) Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:86— Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:86-95 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:86-95 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:86-95 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:86-95 | Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:86-95 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift` and `Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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. 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 (10 lines × 5) Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:86— Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:86-95 | Sources/WatchApp/Home/Areas/WatchAreasListView.swift:25-34 | Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift:96-105 | Sources/WatchApp/Home/WatchFolderContentView.swift:33-42 | Sources/WatchApp/Home/WatchHomeView.swift:294-303 — before extracting anything, compare `Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift` and `Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/WatchApp/Home/WatchFolderContentView.swift:32` calls `id` and `Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:85` 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 (10 lines × 5) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:73— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:73-82 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:76-85 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:85-94 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:108-117 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:86-95 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift` and `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 2) Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:30— Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:30-35 | Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:197-203 — 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 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 (6–7 lines × 2) Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:48— Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:48-54 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:112-117 — 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/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:48` 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.
Duplicated block (6–7 lines × 2) Sources/Shared/Common/Extensions/UIView+StackView.swift:58— Sources/Shared/Common/Extensions/UIView+StackView.swift:58-64 | Sources/Shared/Common/Extensions/UIView+StackView.swift:76-81 — 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/Shared/Common/Extensions/UIView+StackView.swift:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) Sources/HADesignSystem/Sources/Components/HAButtonToggleGroup.swift:75— Sources/HADesignSystem/Sources/Components/HAButtonToggleGroup.swift:75-80 | Sources/HADesignSystem/Sources/Components/HAControlSelect.swift:101-106 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:998-1003 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1186-1191 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/HADesignSystem/Sources/Components/HAButtonToggleGroup.swift:75` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1005` calls `init` and `Sources/HADesignSystem/Sources/Components/HAButtonToggleGroup.swift:81` 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 × 4) Sources/HADesignSystem/Sources/Components/HAControlSelect.swift:110— Sources/HADesignSystem/Sources/Components/HAControlSelect.swift:110-115 | Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:190-195 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1197-1202 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1561-1566 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/HADesignSystem/Sources/Components/HAControlSelect.swift:110` 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 × 4) Sources/App/Assist/AssistViewModel.swift:420— Sources/App/Assist/AssistViewModel.swift:420-425 | Sources/App/Settings/AppIconShortcuts/AppIconShortcutsConfigurationViewModel.swift:120-125 | Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationViewModel.swift:217-222 | Sources/App/Settings/CarPlay/CarPlayConfigurationViewModel.swift:125-130 — 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.
Near-duplicate member pair (47 shared lines) Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:17— Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:17-82 | Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift:19-83 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (47 shared lines) Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:55— Sources/Extensions/Widgets/CommonlyUsedEntities/WidgetCommonlyUsedEntities.swift:55-115 | Sources/Extensions/Widgets/Entities/WidgetEntities.swift:46-102 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:21— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:21-323 | Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:46-71 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:49-74 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:56-83 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:81-106 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:54-84 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift:16-113 — These 7 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 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.
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:326— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:326-358 | Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:156-181 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:125-150 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:193-220 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:153-176 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:213-239 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift:116-138 — These 7 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 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:83— Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:83-95 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:83-95 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:83-95 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:83-95 | Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:83-95 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:19— Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:19-99 | Sources/WatchApp/Home/Areas/WatchAreasListView.swift:18-38 | Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift:21-109 | Sources/WatchApp/Home/WatchFolderContentView.swift:20-65 | Sources/WatchApp/Home/WatchHomeView.swift:268-326 — 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.
Duplicated block (34 lines × 2) Sources/App/Settings/ManageStorage/ManageStorageItemID.swift:45— Sources/App/Settings/ManageStorage/ManageStorageItemID.swift:45-78 | Sources/App/Settings/ManageStorage/ManageStorageItemID.swift:90-123 — 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/App/Settings/ManageStorage/ManageStorageItemID.swift:45` 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 (34 lines × 2) Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:249— Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:249-282 | Sources/SharedPush/Sources/NotificationParserLegacy.swift:288-321 — before extracting anything, compare `Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift` and `Sources/SharedPush/Sources/NotificationParserLegacy.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 240 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/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:249` 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 (27 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:80— Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:80-106 | Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift:79-105 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift` and `Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 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/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:80` 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 (27 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:195— Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:195-221 | Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift:115-141 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift` and `Sources/App/Settings/CarPlay/CarPlayConfigurationView.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 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 (25 lines × 4) Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:348— Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:348-372 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:402-426 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:563-587 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:609-633 — 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/App/Settings/LiveActivity/LiveActivitySettingsView.swift:348` 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 (25 lines × 4) Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:47— Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:47-71 | Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift:49-73 | Sources/Extensions/Widgets/Controls/Light/ControlLightsValueProvider.swift:59-83 | Sources/Extensions/Widgets/Controls/Switch/ControlSwitchValueProvider.swift:50-74 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift` and `Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:47` 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 (18 lines × 2) Sources/App/Settings/Gestures/GesturesSetupView.swift:24— Sources/App/Settings/Gestures/GesturesSetupView.swift:24-41 | Sources/App/Settings/Gestures/GesturesSetupView.swift:47-64 — 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/App/Settings/Gestures/GesturesSetupView.swift:24` 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 (18 lines × 2) Sources/Shared/HATypedRequest+App.swift:268— Sources/Shared/HATypedRequest+App.swift:268-285 | Sources/Shared/HATypedRequest+App.swift:301-318 — 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/Shared/HATypedRequest+App.swift:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–15 lines × 2) Sources/Extensions/AppIntents/Widget/Energy/WidgetEnergyEntry.swift:74— Sources/Extensions/AppIntents/Widget/Energy/WidgetEnergyEntry.swift:74-88 | Sources/HADesignSystem/Sources/Widgets/Energy/WidgetEnergyChartPoint.swift:24-37 — 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/HADesignSystem/Sources/Widgets/Energy/WidgetEnergyChartPoint.swift:24` 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 (14–15 lines × 2) Sources/WatchApp/Home/WatchFolderContentView.swift:32— Sources/WatchApp/Home/WatchFolderContentView.swift:32-45 | Sources/WatchApp/Home/WatchHomeView.swift:292-306 — before extracting anything, compare `Sources/WatchApp/Home/WatchFolderContentView.swift` and `Sources/WatchApp/Home/WatchHomeView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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/WatchApp/Home/WatchFolderContentView.swift:32` 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 × 3) Sources/App/Settings/General/GeneralSettingsTemplateEditor.swift:65— Sources/App/Settings/General/GeneralSettingsTemplateEditor.swift:65-78 | Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift:159-172 | Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift:185-198 — before extracting anything, compare `Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift` and `Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/Settings/General/GeneralSettingsTemplateEditor.swift:65` 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 (14 lines × 3) Sources/HAModels/Sources/AssistPipelines.swift:28— Sources/HAModels/Sources/AssistPipelines.swift:28-41 | Sources/HAModels/Sources/HACalendarEvent.swift:36-49 | Sources/Shared/LiveActivity/HALiveActivityAttributes.swift:185-198 — before extracting anything, compare `Sources/HAModels/Sources/AssistPipelines.swift` and `Sources/HAModels/Sources/HACalendarEvent.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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/HAModels/Sources/AssistPipelines.swift:28` 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–14 lines × 2) Sources/Shared/Watch/Complications/ComplicationRenderContext.swift:210— Sources/Shared/Watch/Complications/ComplicationRenderContext.swift:210-223 | Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:108-120 — 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. 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–14 lines × 2) Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:97— Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:97-110 | Sources/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:122-134 — 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/WatchApp/Home/MagicItemRow/WatchFolderRow.swift:97` 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 × 6) Sources/HAModels/Sources/AppArea.swift:33— Sources/HAModels/Sources/AppArea.swift:33-44 | Sources/HAModels/Sources/AssistPipelines.swift:31-42 | Sources/HAModels/Sources/HACalendarEvent.swift:39-50 | Sources/Shared/API/Models/NotificationAction.swift:33-44 | Sources/Shared/LiveActivity/HALiveActivityAttributes.swift:188-199 | Sources/Shared/Models/EntityRegistryListForDisplay.swift:114-125 — before extracting anything, compare `Sources/HAModels/Sources/AppArea.swift` and `Sources/HAModels/Sources/AssistPipelines.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. 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/HAModels/Sources/AppArea.swift:33` 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 (12 lines × 6) Sources/HAModels/Sources/AppArea.swift:34— Sources/HAModels/Sources/AppArea.swift:34-45 | Sources/HAModels/Sources/AssistPipelines.swift:32-43 | Sources/Shared/API/Models/NotificationAction.swift:34-45 | Sources/Shared/API/WebSocket/Energy/EnergyPreferences.swift:67-78 | Sources/Shared/LiveActivity/HALiveActivityAttributes.swift:189-200 | Sources/Shared/Models/EntityRegistryListForDisplay.swift:115-126 — before extracting anything, compare `Sources/HAModels/Sources/AppArea.swift` and `Sources/HAModels/Sources/AssistPipelines.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. 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/HAModels/Sources/AppArea.swift:34` 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 (12 lines × 4) Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:38— Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:38-49 | Sources/HADesignSystem/Sources/Components/HAMediaControlCard.swift:54-65 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoUpdate.swift:82-93 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoVacuum.swift:35-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:38` 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 (12 lines × 4) Sources/HAModels/Sources/AssistPipelines.swift:29— Sources/HAModels/Sources/AssistPipelines.swift:29-40 | Sources/HAModels/Sources/HACalendarEvent.swift:37-48 | Sources/Shared/LiveActivity/HALiveActivityAttributes.swift:186-197 | Sources/Shared/Notifications/NotificationHistory.swift:24-35 — before extracting anything, compare `Sources/HAModels/Sources/AssistPipelines.swift` and `Sources/HAModels/Sources/HACalendarEvent.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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/HAModels/Sources/AssistPipelines.swift:29` 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–12 lines × 2) Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift:35— Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift:35-46 | Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift:54-61 — 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/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift:35` 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 (8–12 lines × 2) Sources/Watch/WatchCommunicatorService.swift:107— Sources/Watch/WatchCommunicatorService.swift:107-118 | Sources/WatchApp/ExtensionDelegate.swift:297-304 — 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/Watch/WatchCommunicatorService.swift:107` 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 (7 lines × 6) Sources/Extensions/AppIntents/Sensor/IntentSensorsAppEntity.swift:109— Sources/Extensions/AppIntents/Sensor/IntentSensorsAppEntity.swift:109-115 | Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:107-113 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:107-113 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:107-113 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:107-113 | Sources/Extensions/Widgets/Entities/WidgetEntitiesAppEntityQuery.swift:61-67 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift` and `Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 6) Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreAudioObjectDevice.swift:4— Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreAudioObjectDevice.swift:4-11 | Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreAudioObjectDevice.swift:13-19 | Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreAudioObjectDevice.swift:21-27 | Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreMediaObjectCamera.swift:7-14 | Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreMediaObjectCamera.swift:16-22 | Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreMediaObjectCamera.swift:24-30 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) Sources/HADesignSystem/Sources/Widgets/TodoList/WidgetTodoListStrings.swift:10— Sources/HADesignSystem/Sources/Widgets/TodoList/WidgetTodoListStrings.swift:10-14 | Sources/HAWatchCommunicationMessages/Sources/AssistTextInputPayload.swift:10-14 | Sources/Shared/Watch/WatchEntityDetails.swift:16-20 — 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.
Duplicated block (5 lines × 3) Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:79— Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:79-83 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:140-144 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:79-83 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift` and `Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) Sources/Shared/API/Webhook/Sensors/HingeSensor.swift:30— Sources/Shared/API/Webhook/Sensors/HingeSensor.swift:30-36 | Sources/Shared/API/Webhook/Sensors/KioskBrightnessSensor.swift:34-40 | Sources/Shared/API/Webhook/Sensors/KioskModeSensor.swift:30-36 | Sources/Shared/API/Webhook/Sensors/KioskScreensaverSensor.swift:29-35 — 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 4 call sites, so a change lands once.
Duplicated block (7 lines × 4) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlViewModel.swift:67— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlViewModel.swift:67-73 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsViewModel.swift:68-74 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsViewModel.swift:76-82 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsViewModel.swift:45-51 — 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 (8 lines × 4) Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:27— Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:27-34 | Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift:29-36 | Sources/Extensions/Widgets/Controls/Light/ControlLightsValueProvider.swift:39-46 | Sources/Extensions/Widgets/Controls/Switch/ControlSwitchValueProvider.swift:30-37 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift` and `Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:36— Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift:36-43 | Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift:38-45 | Sources/Extensions/Widgets/Controls/Light/ControlLightsValueProvider.swift:48-55 | Sources/Extensions/Widgets/Controls/Switch/ControlSwitchValueProvider.swift:39-46 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Cover/ControlCoverValueProvider.swift` and `Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `configuration` to `ControlCoverConfiguration` in one and `ControlFanConfiguration` 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.
WebViewExternalMessageHandler.handleExternalMessage (cyclomatic 59) Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:54— WebViewExternalMessageHandler.handleExternalMessage has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LegacyNotificationParserImpl.result (cyclomatic 55) Sources/SharedPush/Sources/NotificationParserLegacy.swift:48— LegacyNotificationParserImpl.result has cyclomatic complexity 55 (threshold 15). Of this number, 52 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.
LegacyNotificationParserImpl.result (cyclomatic 49) Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:48— LegacyNotificationParserImpl.result has cyclomatic complexity 49 (threshold 15). Of this number, 46 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DesignSystemComponent.moreInfoVariants (cyclomatic 37) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:8— DesignSystemComponent.moreInfoVariants has cyclomatic complexity 37 (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.
AKConverter.convertAsset (cyclomatic 31) Sources/App/Utilities/AKConverter.swift:149— AKConverter.convertAsset has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IncomingURLHandler.handle (cyclomatic 30) Sources/App/Frontend/IncomingURLHandler.swift:40— IncomingURLHandler.handle 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.
Domain.stateForDeviceClass (cyclomatic 30) Sources/Shared/Domain/Domain.swift:171— Domain.stateForDeviceClass 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. This is NOT this file's highest cyclomatic complexity: Domain.icon (cyclomatic 65) 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.
WatchWidgetComplicationSnapshot.make (cyclomatic 30) Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:149— WatchWidgetComplicationSnapshot.make has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 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.
BitapSearcher.search (cyclomatic 29) Sources/Shared/Environment/EntityFuzzySearch/BitapSearcher.swift:125— BitapSearcher.search has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 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.
WatchHomeView.body (cyclomatic 29) Sources/WatchApp/Home/WatchHomeView.swift:52— WatchHomeView.body has cyclomatic complexity 29 (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.
AKConverter.convertToPCM (cyclomatic 28) Sources/App/Utilities/AKConverter.swift:376— AKConverter.convertToPCM 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.
HAEntity.getCoverIcon (cyclomatic 28) Sources/Shared/HAEntity+CarPlay.swift:171— HAEntity.getCoverIcon has cyclomatic complexity 28 (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.
HAMoreInfoBattery.icon (cyclomatic 24) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoBattery.swift:27— HAMoreInfoBattery.icon 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.
ImprovDiscoverView.body (cyclomatic 24) Sources/Improv/ImprovDiscoverView.swift:44— ImprovDiscoverView.body 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.
IncomingURLHandler.customMagicItemAction (cyclomatic 22) Sources/App/Frontend/IncomingURLHandler.swift:465— IncomingURLHandler.customMagicItemAction 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.
ServerDetailsRowView.body (cyclomatic 22) Sources/App/Settings/Connection/ServerDetailsRowView.swift:118— ServerDetailsRowView.body has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ComplicationEditViewModel.init (cyclomatic 20) Sources/App/Settings/AppleWatch/Complications/ComplicationEditViewModel.swift:41— ComplicationEditViewModel.init 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.
EntityContextSubtitle.make (cyclomatic 20) Sources/Extensions/EntityProvider+Details.swift:37— EntityContextSubtitle.make 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.
HAControlSlider.fill (cyclomatic 20) Sources/HADesignSystem/Sources/Components/HAControlSlider.swift:128— HAControlSlider.fill 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.
WatchCommunicatorService.magicItemPressed (cyclomatic 20) Sources/Watch/WatchCommunicatorService.swift:777— WatchCommunicatorService.magicItemPressed has cyclomatic complexity 20 (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 is NOT this file's highest cyclomatic complexity: WatchCommunicatorService.setupMessages (cyclomatic 22) 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.
IncomingURLHandler.runAppIconShortcut (cyclomatic 19) Sources/App/Frontend/IncomingURLHandler.swift:388— IncomingURLHandler.runAppIconShortcut 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.
WidgetGaugeAppIntentTimelineProvider.templateEntry (cyclomatic 19) Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift:167— WidgetGaugeAppIntentTimelineProvider.templateEntry 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.
HAMoreInfoLight.body (cyclomatic 19) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoLight.swift:86— HAMoreInfoLight.body 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.
WatchDatabaseMirror.tableDigests (cyclomatic 19) Sources/Shared/Watch/WatchDatabaseMirror.swift:465— WatchDatabaseMirror.tableDigests 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.
WatchClimateControlView.body (cyclomatic 19) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:21— WatchClimateControlView.body 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.
PermissionType.request (cyclomatic 18) Sources/App/Utilities/Permissions.swift:224— PermissionType.request 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.
SensorListView.body (cyclomatic 18) Sources/App/Settings/Sensors/List/SensorListView.swift:39— SensorListView.body 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.
MagicItemProvider.getInfo (cyclomatic 18) Sources/Shared/MagicItem/MagicItemProvider.swift:239— MagicItemProvider.getInfo 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.
WebhookUpdateLocation.init (cyclomatic 18) Sources/Shared/API/Models/WebhookUpdateLocation.swift:39— WebhookUpdateLocation.init 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.
ComplicationGroupMember.fallbackTemplate (cyclomatic 18) Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:380— ComplicationGroupMember.fallbackTemplate 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. This is NOT this file's highest cyclomatic complexity: ComplicationTemplate.description (cyclomatic 45) 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.
UpdateSwiftPackages.main (cyclomatic 18) Tools/UpdateSwiftPackages.py:300— UpdateSwiftPackages.main has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemindersSyncPlanner.plan (cyclomatic 17) Sources/App/Utilities/RemindersSync/RemindersSyncPlanner.swift:33— RemindersSyncPlanner.plan 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.
HAMoreInfoMediaPlayer.transport (cyclomatic 17) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:217— HAMoreInfoMediaPlayer.transport 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.
ConnectionInfo.evaluateActiveURL (cyclomatic 17) Sources/HANetworking/Sources/ConnectionInfo.swift:224— ConnectionInfo.evaluateActiveURL 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.
EntityIconResolver.stateIcon (cyclomatic 17) Sources/Shared/Domain/EntityIconResolver.swift:81— EntityIconResolver.stateIcon 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.
CarPlaySceneDelegate.setTemplates (cyclomatic 16) Sources/App/Scenes/CarPlaySceneDelegate.swift:53— CarPlaySceneDelegate.setTemplates 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.
LiveActivitySample.yaml (cyclomatic 16) Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:806— LiveActivitySample.yaml has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (payload). 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.
HAControlCircularSlider.arcs (cyclomatic 16) Sources/HADesignSystem/Sources/Components/HAControlCircularSlider.swift:182— HAControlCircularSlider.arcs 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.
HAControlSlider.body (cyclomatic 16) Sources/HADesignSystem/Sources/Components/HAControlSlider.swift:73— HAControlSlider.body 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.
HAMoreInfoUpdate.body (cyclomatic 16) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoUpdate.swift:108— HAMoreInfoUpdate.body 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.
ImmediateCommunicatorService.evaluateMessage (cyclomatic 16) Sources/WatchApp/WatchCommunicatorService.swift:41— ImmediateCommunicatorService.evaluateMessage 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.
WatchConfigItemEditView.body (cyclomatic 16) Sources/WatchApp/Home/Edit/WatchConfigItemEditView.swift:84— WatchConfigItemEditView.body 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.
Floating branch dependency: sdk-ios — Dependency `sdk-ios` is resolved in HomeAssistant.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `main` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
HackComment Sources/WatchApp/Notifications/DynamicNotificationView.swift:72— // Hack to remove extra padding in the custom notifications view — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
LegacyNotificationParserImpl.result (cognitive 65) Sources/SharedPush/Sources/NotificationParserLegacy.swift:48— LegacyNotificationParserImpl.result has cognitive complexity 65 (threshold 15). Drivers by points: if/else 41 (55 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 16). Of this number, 62 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.
WebViewExternalMessageHandler.handleExternalMessage (cognitive 64) Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift:54— WebViewExternalMessageHandler.handleExternalMessage has cognitive complexity 64 (threshold 15). Drivers by points: if/else 23 (57 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitapSearcher.search (cognitive 55) Sources/Shared/Environment/EntityFuzzySearch/BitapSearcher.swift:125— BitapSearcher.search has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 6 (11 pts), boolean chains 6, ternaries 3 (5 pts) (nesting depth added 26). Of this number, 49 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.
LegacyNotificationParserImpl.result (cognitive 53) Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:48— LegacyNotificationParserImpl.result has cognitive complexity 53 (threshold 15). Drivers by points: if/else 36 (45 pts), boolean chains 4, ternaries 1 (2 pts), loops 1, match/switch 1 (nesting depth added 10). Of this number, 50 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
IncomingURLHandler.handle (cognitive 47) Sources/App/Frontend/IncomingURLHandler.swift:40— IncomingURLHandler.handle has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 3, match/switch 1 (2 pts) (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.
WatchWidgetComplicationSnapshot.make (cognitive 46) Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:149— WatchWidgetComplicationSnapshot.make has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 6 (10 pts), boolean chains 5, match/switch 2, loops 1 (nesting depth added 17). Of this number, 35 points are the body's own statements and 11 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.
Domain.stateForDeviceClass (cognitive 42) Sources/Shared/Domain/Domain.swift:171— Domain.stateForDeviceClass has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 10 (30 pts), if/else 6, match/switch 3 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AKConverter.convertAsset (cognitive 38) Sources/App/Utilities/AKConverter.swift:149— AKConverter.convertAsset has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (24 pts), match/switch 3 (8 pts), error handling 3, boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
HAControlSlider.fill (cognitive 38) Sources/HADesignSystem/Sources/Components/HAControlSlider.swift:128— HAControlSlider.fill has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 16 (35 pts), if/else 1 (2 pts), match/switch 1 (nesting depth added 20). 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.
HAMoreInfoMediaPlayer.transport (cognitive 35) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:217— HAMoreInfoMediaPlayer.transport has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 5 (15 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchClimateControlView.body (cognitive 34) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:21— WatchClimateControlView.body has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HAMoreInfoLight.body (cognitive 32) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoLight.swift:86— HAMoreInfoLight.body has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenInChromeController.openInChrome (cognitive 31) Sources/App/Utilities/OpenInChromeController.swift:63— OpenInChromeController.openInChrome has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 2 (nesting depth added 18). 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.
ServerDetailsRowView.body (cognitive 31) Sources/App/Settings/Connection/ServerDetailsRowView.swift:118— ServerDetailsRowView.body has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 6 (10 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
SensorListView.body (cognitive 31) Sources/App/Settings/Sensors/List/SensorListView.swift:39— SensorListView.body has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5 (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.
WebhookUpdateLocation.init (cognitive 31) Sources/Shared/API/Models/WebhookUpdateLocation.swift:39— WebhookUpdateLocation.init has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 3 (7 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.
AKConverter.convertToPCM (cognitive 30) Sources/App/Utilities/AKConverter.swift:376— AKConverter.convertToPCM has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 3, loops 1, match/switch 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ComplicationEditViewModel.init (cognitive 30) Sources/App/Settings/AppleWatch/Complications/ComplicationEditViewModel.swift:41— ComplicationEditViewModel.init has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntityIconResolver.stateIcon (cognitive 27) Sources/Shared/Domain/EntityIconResolver.swift:81— EntityIconResolver.stateIcon has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (12 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IncomingURLHandler.customMagicItemAction (cognitive 25) Sources/App/Frontend/IncomingURLHandler.swift:465— IncomingURLHandler.customMagicItemAction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (3 pts), boolean chains 2, match/switch 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.
HAEntity.getCoverIcon (cognitive 25) Sources/Shared/HAEntity+CarPlay.swift:171— HAEntity.getCoverIcon has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 8, ternaries 2 (4 pts) (nesting depth added 8). 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.
LocalPushEvent.content (cognitive 24) Sources/Shared/Notifications/LocalPush/LocalPushEvent.swift:82— LocalPushEvent.content has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (24 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateSwiftPackages.main (cognitive 23) Tools/UpdateSwiftPackages.py:300— UpdateSwiftPackages.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HAMoreInfoMediaPlayer.body (cognitive 22) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:115— HAMoreInfoMediaPlayer.body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4 (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.
HAMoreInfoMediaPlayer.volumeRow (cognitive 22) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:276— HAMoreInfoMediaPlayer.volumeRow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationManager.userNotificationCenter (cognitive 21) Sources/App/Notifications/NotificationManager.swift:448— NotificationManager.userNotificationCenter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CarPlaySceneDelegate.setTemplates (cognitive 21) Sources/App/Scenes/CarPlaySceneDelegate.swift:53— CarPlaySceneDelegate.setTemplates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetEnergyAppIntentTimelineProvider.directionalLivePower (cognitive 21) Sources/Extensions/AppIntents/Widget/Energy/WidgetEnergyAppIntentTimelineProvider.swift:405— WidgetEnergyAppIntentTimelineProvider.directionalLivePower has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
detect_unused_strings.parse_strings_swift (cognitive 21) Tools/detect_unused_strings.py:37— detect_unused_strings.parse_strings_swift has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebSocketBridge.collectThemeVariableNames (cognitive 21) Sources/App/Resources/WebSocketBridge.js:6— WebSocketBridge.collectThemeVariableNames has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts), error handling 1 (2 pts) (nesting depth added 10). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (collectFromRules). 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.
AnyEntityAddToAction.encode (cognitive 20) Sources/App/Frontend/ExternalMessageBus/EntityAddToAction.swift:199— AnyEntityAddToAction.encode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 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.
HAMoreInfoLock.body (cognitive 20) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoLock.swift:69— HAMoreInfoLock.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchConfigItemEditView.body (cognitive 20) Sources/WatchApp/Home/Edit/WatchConfigItemEditView.swift:84— WatchConfigItemEditView.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5 (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.
detect_unused_strings.find_unused_strings (cognitive 20) Tools/detect_unused_strings.py:154— detect_unused_strings.find_unused_strings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncomingURLHandler.runAppIconShortcut (cognitive 19) Sources/App/Frontend/IncomingURLHandler.swift:388— IncomingURLHandler.runAppIconShortcut has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, error handling 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.
AssistAudioConverter.convert (cognitive 19) Sources/App/Assist/Audio/AssistAudioConverter.swift:77— AssistAudioConverter.convert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 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.
RemindersSyncPlanner.plan (cognitive 19) Sources/App/Utilities/RemindersSync/RemindersSyncPlanner.swift:33— RemindersSyncPlanner.plan has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 3 (7 pts), boolean chains 4, if/else 2 (4 pts), loops 4 (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.
SpotlightEntityIndexer.reindex (cognitive 19) Sources/App/Utilities/Spotlight/SpotlightEntityIndexer.swift:188— SpotlightEntityIndexer.reindex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntityContextSubtitle.make (cognitive 19) Sources/Extensions/EntityProvider+Details.swift:37— EntityContextSubtitle.make has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HAMoreInfoUpdate.body (cognitive 19) Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoUpdate.swift:108— HAMoreInfoUpdate.body has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ImmediateCommunicatorService.evaluateMessage (cognitive 19) Sources/WatchApp/WatchCommunicatorService.swift:41— ImmediateCommunicatorService.evaluateMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), 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.
RestoredRegistrationsViewModel.setUpAsNewDevice (cognitive 18) Sources/App/Frontend/RestoredRegistrations/RestoredRegistrationsViewModel.swift:130— RestoredRegistrationsViewModel.setUpAsNewDevice has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), error handling 2 (4 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.
OnboardingAuthStepClientCertificate.requiresClientCertificate (cognitive 18) Sources/App/Onboarding/API/OnboardingAuthStepClientCertificate.swift:30— OnboardingAuthStepClientCertificate.requiresClientCertificate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
OnboardingPermissionsNavigationViewModel.init (cognitive 18) Sources/App/Onboarding/Steps/Permissions/OnboardingPermissionsNavigationViewModel.swift:103— OnboardingPermissionsNavigationViewModel.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 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.
WidgetTodoListView.dueDisplay (cognitive 18) Sources/Extensions/Widgets/TodoList/WidgetTodoListView.swift:100— WidgetTodoListView.dueDisplay has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (4 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.
WidgetGaugeAppIntentTimelineProvider.templateEntry (cognitive 18) Sources/Extensions/AppIntents/Widget/Gauge/WidgetGaugeAppIntentTimelineProvider.swift:167— WidgetGaugeAppIntentTimelineProvider.templateEntry has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9, if/else 4, boolean chains 3, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HAControlSlider.body (cognitive 18) Sources/HADesignSystem/Sources/Components/HAControlSlider.swift:73— HAControlSlider.body has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 6, boolean chains 1, 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.
ServerInfo.== (cognitive 18) Sources/HANetworking/Sources/Server.swift:152— ServerInfo.== has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (6 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (areEqual, areEqualSettings). 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.
RectangularComplicationContentView.body (cognitive 18) Sources/HAWatchComplications/Sources/RectangularComplicationContentView.swift:32— RectangularComplicationContentView.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 1 (2 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.
HomeAssistantAPI.fetchRemoteProfilePicture (cognitive 18) Sources/Shared/API/HAAPI.swift:1415— HomeAssistantAPI.fetchRemoteProfilePicture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchMirrorPushCoordinator.performPush (cognitive 18) Sources/Shared/API/WatchHelpers.swift:332— WatchMirrorPushCoordinator.performPush has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1, match/switch 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.
WatchDatabaseMirror.tableDigests (cognitive 18) Sources/Shared/Watch/WatchDatabaseMirror.swift:465— WatchDatabaseMirror.tableDigests has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 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.
ComplicationGroupMember.fallbackTemplate (cognitive 18) Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:380— ComplicationGroupMember.fallbackTemplate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 1 (2 pts), 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.
FuzzySearcher.search (cognitive 18) Sources/Shared/Environment/EntityFuzzySearch/FuzzySearcher.swift:19— FuzzySearcher.search has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SensorUpdateRetry.noteSuccess (cognitive 18) Sources/Shared/API/Webhook/Sensors/SensorUpdateRetry.swift:99— SensorUpdateRetry.noteSuccess has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PermissionType.request (cognitive 17) Sources/App/Utilities/Permissions.swift:224— PermissionType.request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, match/switch 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationSoundsViewModel.copySounds (cognitive 17) Sources/App/Settings/Notifications/NotificationSoundsView.swift:463— NotificationSoundsViewModel.copySounds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (5 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SensorDetailView.makeRow (cognitive 17) Sources/App/Settings/Sensors/Details/SensorDetailView.swift:98— SensorDetailView.makeRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (nesting depth added 9). 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.
EntityControlDonation.command (cognitive 17) Sources/App/Utilities/AppIntents/Donation/EntityControlDonation.swift:58— EntityControlDonation.command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 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.
HASankeyLayout.init (cognitive 17) Sources/HADesignSystem/Sources/Components/HASankeyLayout.swift:38— HASankeyLayout.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, loops 3 (4 pts), ternaries 2 (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.
WidgetAreasLayout.pages (cognitive 17) Sources/HADesignSystem/Sources/Widgets/Areas/WidgetAreasLayout.swift:66— WidgetAreasLayout.pages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchComplicationConfig.defaultFormula (cognitive 17) Sources/HAModels/Sources/WatchComplicationConfig.swift:508— WatchComplicationConfig.defaultFormula has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (6 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.
URL.isLocal (cognitive 17) Sources/HANetworking/Sources/URL+Extensions.swift:125— URL.isLocal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MagicItemProvider.getInfo (cognitive 17) Sources/Shared/MagicItem/MagicItemProvider.swift:239— MagicItemProvider.getInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LastSentSensors.combine (cognitive 17) Sources/Shared/API/Webhook/Sensors/SensorContainer.swift:208— LastSentSensors.combine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiveActivitySample.yaml (cognitive 16) Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:806— LiveActivitySample.yaml has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 1, loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (payload). 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.
ManageStorageView.body (cognitive 16) Sources/App/Settings/ManageStorage/ManageStorageView.swift:15— ManageStorageView.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RemindersSyncPlanner.linkOperations (cognitive 16) Sources/App/Utilities/RemindersSync/RemindersSyncPlanner.swift:109— RemindersSyncPlanner.linkOperations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (5 pts) (nesting depth added 9). 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.
WatchComplicationConfigurationSheet.valueSlotOptions (cognitive 16) Sources/App/Settings/AppleWatch/Complications/WatchComplicationConfigurationSheet.swift:191— WatchComplicationConfigurationSheet.valueSlotOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (16 pts) (nesting depth added 10). 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.
CarPlayEntitiesListViewModel.sortedEntities (cognitive 16) Sources/CarPlay/Templates/Entities/CarPlayEntitiesListViewModel.swift:24— CarPlayEntitiesListViewModel.sortedEntities has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, 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.
ConnectionInfo.evaluateActiveURL (cognitive 16) Sources/HANetworking/Sources/ConnectionInfo.swift:224— ConnectionInfo.evaluateActiveURL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 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.
MagicItem.resolveServiceCall (cognitive 16) Sources/Shared/MagicItem/MagicItem.swift:1022— MagicItem.resolveServiceCall has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 pts) (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.
WatchEntityDetails.displayValue (cognitive 16) Sources/Shared/Watch/WatchEntityDetails.swift:76— WatchEntityDetails.displayValue has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 3 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WatchHomeView.body (cognitive 16) Sources/WatchApp/Home/WatchHomeView.swift:52— WatchHomeView.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 3, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FunctionTooLong: HomeAssistantStandByView.swift.top-level code Sources/App/Frontend/WebView/Views/HomeAssistantStandByView.swift:653— FunctionTooLong — top-level code runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Near-duplicate member family (3 members, 24 shared lines) · ×1
Near-duplicate member family (3 members, 24 shared lines) Sources/HAModels/Sources/AppDeviceRegistry.swift:40— Sources/HAModels/Sources/AppDeviceRegistry.swift:40-92 | Sources/HAModels/Sources/WatchComplicationConfig.swift:179-239 | Sources/Shared/Environment/DeviceRegistryEntry.swift:86-140 — These 3 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) Sources/Shared/Intents/AppIntent/AssistInApp/AssistRequests.swift:6— Sources/Shared/Intents/AppIntent/AssistInApp/AssistRequests.swift:6-31 | Sources/Shared/Intents/AppIntent/AssistInApp/AssistRequests.swift:33-58 — 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 copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) Sources/Shared/HATypedRequest+App.swift:260— Sources/Shared/HATypedRequest+App.swift:260-285 | Sources/Shared/HATypedRequest+App.swift:289-318 — These two members are one piece of code written twice and then edited apart: 25 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 (15 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (15 members, 50+ identical tokens) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:84— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:84-108 | Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift:41-65 | Sources/Extensions/AppIntents/Control/LockAppEntity.swift:41-65 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:63-87 | Sources/Extensions/AppIntents/Control/ThermostatAppEntity.swift:41-65 | Sources/Extensions/AppIntents/EntityState/ReadableEntityAppEntity.swift:58-82 | Sources/Extensions/AppIntents/Script/IntentScriptEntity.swift:34-58 | Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:37-61 | Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:36-58 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:94-120 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:37-61 — 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 (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:92— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:92-126 | Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:28-56 | Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift:28-56 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntityQuery.swift:65-93 | Sources/Extensions/AppIntents/Control/ThermostatAppEntityQuery.swift:28-56 | Sources/Extensions/AppIntents/EntityState/ReadableEntityOptionsProvider.swift:27-39 — 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.
Duplicated block (200 lines × 2) Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:48— Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:48-247 | Sources/SharedPush/Sources/NotificationParserLegacy.swift:48-247 — before extracting anything, compare `Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift` and `Sources/SharedPush/Sources/NotificationParserLegacy.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 240 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/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:48` 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 (147 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:166— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:166-312 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:317-463 — 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 (60 lines × 2) Sources/App/Settings/AppleWatch/Complications/Preview/AllFamiliesComplicationPreview.swift:329— Sources/App/Settings/AppleWatch/Complications/Preview/AllFamiliesComplicationPreview.swift:329-388 | Sources/App/Settings/AppleWatch/Complications/Preview/CornerComplicationPreview.swift:78-137 — 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/App/Settings/AppleWatch/Complications/Preview/AllFamiliesComplicationPreview.swift:329` 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/App/Settings/AppleWatch/Complications/Preview/CornerComplicationPreview.swift:75` calls `CornerVariantsPreview` and `Sources/App/Settings/AppleWatch/Complications/Preview/AllFamiliesComplicationPreview.swift:325` 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 (42 lines × 2) Sources/WatchApp/Home/WatchHomeView.swift:515— Sources/WatchApp/Home/WatchHomeView.swift:515-556 | Sources/WatchApp/Home/WatchHomeView.swift:568-609 — 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/WatchApp/Home/WatchHomeView.swift:515` 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 (40 lines × 2) Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:1464— Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:1464-1503 | Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:1505-1544 — 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 (27–34 lines × 2) Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:496— Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:496-529 | Sources/App/Settings/LiveActivity/LiveActivitySettingsView.swift:533-559 — 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/App/Settings/LiveActivity/LiveActivitySettingsView.swift:496` 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 (28–31 lines × 2) Sources/App/Utilities/MenuManager.swift:175— Sources/App/Utilities/MenuManager.swift:175-205 | Sources/App/Utilities/MenuManager.swift:424-451 — 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/App/Utilities/MenuManager.swift:175` 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 (31 lines × 2) Sources/App/Utilities/MenuManager.swift:336— Sources/App/Utilities/MenuManager.swift:336-366 | Sources/App/Utilities/MenuManager.swift:507-537 — 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 (30 lines × 2) Sources/App/Settings/Components/YamlPreviewSection.swift:70— Sources/App/Settings/Components/YamlPreviewSection.swift:70-99 | Sources/App/Settings/NFC/NFCTagView.swift:134-163 — 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 (28 lines × 2) Sources/App/Settings/ConfigurationTransfer/AppConfigurationCategory.swift:37— Sources/App/Settings/ConfigurationTransfer/AppConfigurationCategory.swift:37-64 | Sources/App/Settings/ConfigurationTransfer/AppConfigurationCategory.swift:68-95 — 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 (22–26 lines × 2) Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:108— Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:108-129 | Sources/App/Settings/MagicItem/AssistPipelinePicker.swift:132-157 — before extracting anything, compare `Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift` and `Sources/App/Settings/MagicItem/AssistPipelinePicker.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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/App/Settings/MagicItem/AssistPipelinePicker.swift:132` 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, `Sources/App/Settings/MagicItem/AssistPipelinePicker.swift:131` calls `info` and `Sources/App/Settings/MagicItem/Add/AssistPipelineAddList.swift:107` 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 (26 lines × 2) Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:220— Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:220-245 | Sources/Shared/Common/Extensions/CLKComplication+Strings.swift:247-272 — 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–26 lines × 2) Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:79— Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:79-99 | Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift:84-109 — before extracting anything, compare `Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift` and `Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:79` 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 (24 lines × 9) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:85— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:85-108 | Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift:42-65 | Sources/Extensions/AppIntents/Control/LockAppEntity.swift:42-65 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:64-87 | Sources/Extensions/AppIntents/Control/ThermostatAppEntity.swift:42-65 | Sources/Extensions/AppIntents/EntityState/ReadableEntityAppEntity.swift:59-82 | Sources/Extensions/AppIntents/Script/IntentScriptEntity.swift:35-58 | Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:38-61 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:38-61 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift` and `Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:85` 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 (16–24 lines × 2) Sources/App/Assist/Audio/AudioPlayer.swift:25— Sources/App/Assist/Audio/AudioPlayer.swift:25-48 | Sources/WatchApp/Assist/WatchSpeechSynthesizer.swift:26-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (24 lines × 2) Sources/App/Settings/Notifications/NotificationActionEditorView.swift:164— Sources/App/Settings/Notifications/NotificationActionEditorView.swift:164-187 | Sources/App/Settings/Notifications/NotificationCategoryEditorView.swift:180-203 — 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/App/Settings/Notifications/NotificationActionEditorView.swift:164` 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 (23–24 lines × 2) Sources/CarPlay/Templates/Entities/CarPlayEntitiesListTemplate.swift:90— Sources/CarPlay/Templates/Entities/CarPlayEntitiesListTemplate.swift:90-112 | Sources/CarPlay/Templates/Entities/CarPlayEntitiesListTemplate.swift:136-159 — 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/CarPlay/Templates/Entities/CarPlayEntitiesListTemplate.swift:90` 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. 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 (23 lines × 5) Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:36— Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:36-58 | Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:36-58 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift` and `Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 (22–23 lines × 2) Sources/App/Settings/ClientEventsLogView/ClientEventsLogView.swift:101— Sources/App/Settings/ClientEventsLogView/ClientEventsLogView.swift:101-123 | Sources/App/Settings/Notifications/NotificationHistoryView.swift:101-122 — 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/App/Settings/ClientEventsLogView/ClientEventsLogView.swift:101` 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 after the matched lines, `Sources/App/Settings/Notifications/NotificationHistoryView.swift:124` calls `Text` and `Sources/App/Settings/ClientEventsLogView/ClientEventsLogView.swift:124` 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 (23 lines × 2) Sources/Shared/Intents/AppIntent/AssistInApp/AssistRequests.swift:9— Sources/Shared/Intents/AppIntent/AssistInApp/AssistRequests.swift:9-31 | Sources/Shared/Intents/AppIntent/AssistInApp/AssistRequests.swift:36-58 — 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/Shared/Intents/AppIntent/AssistInApp/AssistRequests.swift:9` 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 (14–22 lines × 2) Sources/App/Frontend/WebView/WebViewController/WebViewController+URLLoading.swift:107— Sources/App/Frontend/WebView/WebViewController/WebViewController+URLLoading.swift:107-128 | Sources/App/Frontend/WebView/WebViewController/WebViewController+URLLoading.swift:147-160 — 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 (20–22 lines × 2) Sources/Shared/Environment/AppDatabaseUpdater.swift:780— Sources/Shared/Environment/AppDatabaseUpdater.swift:780-799 | Sources/Shared/Environment/AppDatabaseUpdater.swift:849-870 — 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/Shared/Environment/AppDatabaseUpdater.swift:780` 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 (21 lines × 14) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:86— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:86-106 | Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift:43-63 | Sources/Extensions/AppIntents/Control/LockAppEntity.swift:43-63 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:65-85 | Sources/Extensions/AppIntents/Control/ThermostatAppEntity.swift:43-63 | Sources/Extensions/AppIntents/EntityState/ReadableEntityAppEntity.swift:60-80 | Sources/Extensions/AppIntents/Script/IntentScriptEntity.swift:36-56 | Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:39-59 | Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:37-57 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:37-57 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:37-57 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:37-57 | Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:37-57 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:39-59 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift` and `Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:86` 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 (19–21 lines × 2) Sources/App/Utilities/MenuManager.swift:225— Sources/App/Utilities/MenuManager.swift:225-245 | Sources/App/Utilities/MenuManager.swift:453-471 — 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) Sources/HADesignSystem/Sources/Components/HAHumidifierCard.swift:72— Sources/HADesignSystem/Sources/Components/HAHumidifierCard.swift:72-92 | Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:108-128 — 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/HADesignSystem/Sources/Components/HAHumidifierCard.swift:72` 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–21 lines × 2) Sources/Shared/API/HAAPI.swift:983— Sources/Shared/API/HAAPI.swift:983-999 | Sources/Shared/MagicItem/MagicItem.swift:847-867 — 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/Shared/MagicItem/MagicItem.swift:847` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–20 lines × 4) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:51— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:51-68 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:54-71 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:61-80 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:86-103 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift` and `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 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/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.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 (20 lines × 2) Sources/Shared/ControlEntityProvider.swift:111— Sources/Shared/ControlEntityProvider.swift:111-130 | Sources/Shared/ControlEntityProvider.swift:144-163 — 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 (18–20 lines × 2) Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:38— Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:38-55 | Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift:40-59 — before extracting anything, compare `Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift` and `Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:38` 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–19 lines × 2) Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:203— Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:203-218 | Sources/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:241-259 — 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/CarPlay/Templates/QuickAccess/AddItem/CarPlayAddItemViewModel.swift:203` 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 (17–18 lines × 2) Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:180— Sources/HADesignSystem/Sources/Components/HAThermostatCard.swift:180-197 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1551-1567 — 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/HADesignSystem/Sources/Components/HAThermostatCard.swift:180` 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 (16–18 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:375— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:375-390 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:198-215 — 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/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:198` 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–17 lines × 2) Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:56— Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:56-72 | Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift:57-72 — before extracting anything, compare `Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift` and `Sources/App/Settings/CarPlay/CarPlayFolderDetailView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift:56` 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–16 lines × 2) Sources/Watch/WatchCommunicatorService.swift:523— Sources/Watch/WatchCommunicatorService.swift:523-538 | Sources/WatchApp/Home/WatchHomeViewModel.swift:749-757 — 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 (14–16 lines × 2) Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:60— Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:60-73 | Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift:66-81 — before extracting anything, compare `Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift` and `Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:60` 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 (15 lines × 7) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:326— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:326-340 | Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:156-170 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:125-139 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:193-207 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:153-167 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:213-227 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift:116-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:326` 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/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:209` calls `accessibilityLabel`, `Text` and `Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:149` 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 (14–15 lines × 3) Sources/Shared/Environment/AppDatabaseUpdater.swift:722— Sources/Shared/Environment/AppDatabaseUpdater.swift:722-735 | Sources/Shared/Environment/AppDatabaseUpdater.swift:797-810 | Sources/Shared/Environment/AppDatabaseUpdater.swift:867-881 — 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/Shared/Environment/AppDatabaseUpdater.swift:722` 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–15 lines × 2) Sources/HADesignSystem/Sources/Components/HASelectBox.swift:89— Sources/HADesignSystem/Sources/Components/HASelectBox.swift:89-99 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1311-1325 — 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 after the matched lines, `Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1327` calls `init` and `Sources/HADesignSystem/Sources/Components/HASelectBox.swift:100` 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–14 lines × 2) Sources/Shared/API/HAAPI+RequestHelpers.swift:28— Sources/Shared/API/HAAPI+RequestHelpers.swift:28-41 | Sources/Shared/API/HAAPI+RequestHelpers.swift:142-149 — 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/Shared/API/HAAPI+RequestHelpers.swift:28` 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 (13 lines × 5) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:46— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:46-58 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:49-61 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:56-68 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:81-93 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:54-66 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift` and `Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 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/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:112— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:112-123 | Sources/Extensions/AppIntents/EntityState/ReadableEntityAppEntityQuery.swift:45-57 — 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/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.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. 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 × 29) Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:42— Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:42-53 | Sources/App/Onboarding/Views/BaseOnboardingView.swift:58-69 | Sources/Extensions/Widgets/Common/WidgetBasicViewModel.swift:36-47 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:109-120 | Sources/HADesignSystem/Sources/Components/HABaseTimeInput.swift:79-90 | Sources/HADesignSystem/Sources/Components/HAControlSwitch.swift:44-55 | Sources/HADesignSystem/Sources/Components/HAMediaControlCard.swift:58-69 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:98-109 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoMediaPlayer.swift:83-94 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoUpdate.swift:93-104 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoWaterHeater.swift:40-51 | Sources/HADesignSystem/Sources/Widgets/Energy/WidgetEnergyMediumContentView.swift:44-55 | Sources/HAModels/Sources/AppDeviceRegistry.swift:81-92 | Sources/HAModels/Sources/AssistPipelines.swift:35-46 | Sources/HAModels/Sources/HACalendarEventRecord.swift:45-56 | Sources/HAModels/Sources/KioskSettings.swift:53-64 | Sources/HAModels/Sources/KioskSettings.swift:132-143 | Sources/HAModels/Sources/WatchComplicationConfig.swift:156-167 | Sources/HAModels/Sources/WatchComplicationConfig.swift:228-239 | Sources/HANetworking/Sources/ConnectionInfo.swift:117-128 | Sources/HAWatchComplications/Sources/CircularComplicationRenderModel.swift:42-53 | Sources/HAWatchComplications/Sources/RectangularComplicationRenderModel.swift:66-77 | Sources/Shared/API/Models/AppZone.swift:71-82 | Sources/Shared/API/Webhook/Sensors/Health/HealthKitMetric.swift:69-80 | Sources/Shared/Environment/DeviceRegistryEntry.swift:129-140 | Sources/Shared/LiveActivity/HALiveActivityAttributes.swift:195-206 | Sources/Shared/Models/EntityRegistryListForDisplay.swift:120-131 | Sources/Shared/Watch/DeviceRegistration/WatchDeviceReporter.swift:66-77 | Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:93-104 — there are 29 copies across 27 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 29 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/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:42` 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 after the matched lines, `Sources/HADesignSystem/Sources/Components/HAMediaControlCard.swift:74` calls `contrastingForeground` and `Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:111` 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 (12 lines × 26) Sources/App/Frontend/WebView/Views/HomeAssistantStandByView.swift:116— Sources/App/Frontend/WebView/Views/HomeAssistantStandByView.swift:116-127 | Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:39-50 | Sources/App/Onboarding/Views/BaseOnboardingView.swift:56-67 | Sources/Extensions/Widgets/Common/WidgetBasicViewModel.swift:29-40 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:107-118 | Sources/HADesignSystem/Sources/Components/HAMediaControlCard.swift:55-66 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoClimate.swift:93-104 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoUpdate.swift:83-94 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoWaterHeater.swift:38-49 | Sources/HADesignSystem/Sources/Widgets/Energy/WidgetEnergyMediumContentView.swift:41-52 | Sources/HAModels/Sources/AppDeviceRegistry.swift:66-77 | Sources/HAModels/Sources/AssistPipelines.swift:33-44 | Sources/HAModels/Sources/HACalendarEventRecord.swift:43-54 | Sources/HAModels/Sources/KioskSettings.swift:47-58 | Sources/HAModels/Sources/KioskSettings.swift:129-140 | Sources/HAModels/Sources/WatchComplicationConfig.swift:152-163 | Sources/HAModels/Sources/WatchComplicationConfig.swift:209-220 | Sources/HANetworking/Sources/ConnectionInfo.swift:115-126 | Sources/HAWatchComplications/Sources/CircularComplicationRenderModel.swift:40-51 | Sources/HAWatchComplications/Sources/RectangularComplicationRenderModel.swift:57-68 | Sources/Shared/API/Webhook/Sensors/Health/HealthKitMetric.swift:63-74 | Sources/Shared/Environment/DeviceRegistryEntry.swift:113-124 | Sources/Shared/LiveActivity/HALiveActivityAttributes.swift:190-201 | Sources/Shared/Models/EntityRegistryListForDisplay.swift:116-127 | Sources/Shared/Watch/DeviceRegistration/WatchDeviceReporter.swift:61-72 | Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:91-102 — there are 26 copies across 24 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 26 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/App/Frontend/WebView/Views/HomeAssistantStandByView.swift:116` 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 × 12) Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:39— Sources/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:39-50 | Sources/HADesignSystem/Sources/Components/HAMediaControlCard.swift:55-66 | Sources/HADesignSystem/Sources/MoreInfo/HAMoreInfoUpdate.swift:83-94 | Sources/HAModels/Sources/AppArea.swift:35-46 | Sources/HAModels/Sources/AssistPipelines.swift:33-44 | Sources/HAModels/Sources/WatchComplicationConfig.swift:152-163 | Sources/HAModels/Sources/WatchComplicationConfig.swift:209-220 | Sources/HANetworking/Sources/ConnectionInfo.swift:115-126 | Sources/HAWatchComplications/Sources/CircularComplicationRenderModel.swift:40-51 | Sources/Shared/LiveActivity/HALiveActivityAttributes.swift:190-201 | Sources/Shared/Models/EntityRegistryListForDisplay.swift:116-127 | Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift:91-102 — there are 12 copies across 11 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 12 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/App/Frontend/WebView/Views/WebViewEmptyStateView.swift:39` 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 × 7) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:39— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:39-50 | Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:59-70 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:62-73 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:69-82 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:94-105 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:72-83 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift:36-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:39` 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 × 3) Sources/Extensions/Widgets/Controls/Fan/ControlFan.swift:17— Sources/Extensions/Widgets/Controls/Fan/ControlFan.swift:17-28 | Sources/Extensions/Widgets/Controls/Light/ControlLight.swift:18-29 | Sources/Extensions/Widgets/Controls/Switch/ControlSwitch.swift:17-28 — 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 `Sources/Extensions/Widgets/Controls/Fan/ControlFan.swift:17` 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 (9–12 lines × 3) Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerControlsView.swift:87— Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerControlsView.swift:87-98 | Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerControlsView.swift:103-114 | Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerControlsView.swift:118-126 — 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/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerControlsView.swift:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (11–12 lines × 2) Sources/HADesignSystem/Sources/Components/ExternalLinkButton.swift:36— Sources/HADesignSystem/Sources/Components/ExternalLinkButton.swift:36-47 | Sources/HADesignSystem/Sources/Components/ExternalLinkButton.swift:75-85 — 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–12 lines × 2) Sources/HADesignSystem/Sources/Components/HAEntityCard.swift:43— Sources/HADesignSystem/Sources/Components/HAEntityCard.swift:43-54 | Sources/HADesignSystem/Sources/Components/HASensorCard.swift:66-75 — 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/HADesignSystem/Sources/Components/HAEntityCard.swift:43` 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 × 10) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:84— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:84-95 | Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift:41-52 | Sources/Extensions/AppIntents/Control/LockAppEntity.swift:41-52 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntity.swift:63-74 | Sources/Extensions/AppIntents/Control/ThermostatAppEntity.swift:41-52 | Sources/Extensions/AppIntents/EntityState/ReadableEntityAppEntity.swift:58-69 | Sources/Extensions/AppIntents/Script/IntentScriptEntity.swift:34-45 | Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:37-48 | Sources/Extensions/Widgets/HAAppEntityAppIntentEntity.swift:94-104 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:37-48 — before extracting anything, compare `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift` and `Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift:84` 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 (11 lines × 3) Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:86— Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:86-96 | Sources/WatchApp/Home/Areas/WatchAreasListView.swift:25-35 | Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift:96-106 — before extracting anything, compare `Sources/WatchApp/Home/Areas/WatchAreaEntitiesView.swift` and `Sources/WatchApp/Home/Devices/WatchDeviceEntitiesView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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/WatchApp/Home/Areas/WatchAreaEntitiesView.swift:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:26— Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:26-35 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:47-56 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:162-171 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:183-192 — 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/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:26` 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–10 lines × 4) Sources/Extensions/NotificationContent/CameraStreamWebRTCViewController.swift:116— Sources/Extensions/NotificationContent/CameraStreamWebRTCViewController.swift:116-124 | Sources/Extensions/NotificationContent/CameraViewController.swift:124-133 | Sources/Extensions/NotificationContent/NotificationViewController.swift:20-29 | Sources/Extensions/NotificationContent/VideoAudioAttachmentViewController.swift:59-68 — 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 4 call sites, so a change lands once.
Duplicated block (10 lines × 3) Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:67— Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift:67-76 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift:82-91 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsViewModel.swift:65-74 — before extracting anything, compare `Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsViewModel.swift` and `Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsViewModel.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The 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–10 lines × 2) Sources/HADesignSystem/Sources/Components/HASelectBox.swift:100— Sources/HADesignSystem/Sources/Components/HASelectBox.swift:100-109 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1328-1336 — 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/HADesignSystem/Sources/Components/HASelectBox.swift:100` 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/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift:1327` calls `init` and `Sources/HADesignSystem/Sources/Components/HASelectBox.swift:99` 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/WatchApp/Home/CircularGlassOrLegacyBackground.swift:42— Sources/WatchApp/Home/CircularGlassOrLegacyBackground.swift:42-51 | Sources/WatchApp/Home/CircularGlassOrLegacyBackground.swift:77-84 — 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/WatchApp/Home/CircularGlassOrLegacyBackground.swift:42` 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 (8–9 lines × 3) Sources/Extensions/NotificationContent/ImageAttachmentViewController.swift:168— Sources/Extensions/NotificationContent/ImageAttachmentViewController.swift:168-175 | Sources/Extensions/NotificationContent/MapViewController.swift:62-70 | Sources/Extensions/NotificationContent/NotificationLoadingViewController.swift:28-35 — 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.
Duplicated block (8 lines × 7) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:23— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:23-30 | Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:47-54 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:50-57 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:57-64 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:82-89 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:55-62 | Sources/WatchApp/Home/EntityDetails/WatchEntityDetailsView.swift:19-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:23` 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 × 6) Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:30— Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:30-37 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:51-58 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:74-81 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:122-129 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:166-173 | Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:187-194 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift:30` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) Sources/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:66— Sources/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:66-73 | Sources/App/Settings/Connection/ConnectionURLsHowItWorksView.swift:58-65 | Sources/App/Settings/Connection/ConnectionURLsHowItWorksView.swift:77-84 | Sources/App/Settings/Focus/FocusHowItWorksView.swift:75-82 | Sources/App/Settings/Settings/ServerSwitchingHowItWorksView.swift:65-72 — there are 5 copies across 4 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/App/Onboarding/Steps/ServerIdentity/ServerIdentityExplanationView.swift:66` 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–8 lines × 2) Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:719— Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:719-726 | Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:729-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent+MoreInfo.swift:719` 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 (7 lines × 8) Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:42— Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:42-48 | Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift:42-48 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntityQuery.swift:79-85 | Sources/Extensions/AppIntents/Control/ThermostatAppEntityQuery.swift:42-48 | Sources/Extensions/AppIntents/EntityState/ReadableEntityOptionsProvider.swift:52-58 | Sources/Extensions/AppIntents/Script/IntentScriptAppEntityQuery.swift:42-48 | Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:95-101 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:95-101 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift` and `Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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 × 17) Sources/App/Utilities/Spotlight/SpotlightEntityIndexer.swift:321— Sources/App/Utilities/Spotlight/SpotlightEntityIndexer.swift:321-325 | Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:116-120 | Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:46-50 | Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift:46-50 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntityQuery.swift:83-87 | Sources/Extensions/AppIntents/Control/ThermostatAppEntityQuery.swift:46-50 | Sources/Extensions/AppIntents/EntityState/ReadableEntityAppEntityQuery.swift:49-53 | Sources/Extensions/AppIntents/EntityState/ReadableEntityOptionsProvider.swift:56-60 | Sources/Extensions/AppIntents/Script/IntentScriptAppEntityQuery.swift:46-50 | Sources/Extensions/AppIntents/Sensor/IntentSensorsAppEntity.swift:112-116 | Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:99-103 | Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:110-114 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:110-114 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:110-114 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:110-114 | Sources/Extensions/Widgets/Entities/WidgetEntitiesAppEntityQuery.swift:64-68 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:99-103 — before extracting anything, compare `Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift` and `Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 (27 lines × 3) Sources/Extensions/Widgets/Controls/Automation/ControlAutomation.swift:8— Sources/Extensions/Widgets/Controls/Automation/ControlAutomation.swift:8-37 | Sources/Extensions/Widgets/Scene/Control/ControlScene.swift:8-34 | Sources/Extensions/Widgets/Script/Control/ControlScript.swift:8-34 — 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.
Duplicated block (6 lines × 10) Sources/Extensions/AppIntents/Script/IntentScriptEntity.swift:27— Sources/Extensions/AppIntents/Script/IntentScriptEntity.swift:27-32 | Sources/Extensions/AppIntents/Sensor/IntentSensorsAppEntity.swift:29-34 | Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift:30-35 | Sources/Extensions/Widgets/Controls/Button/IntentButtonEntity.swift:29-34 | Sources/Extensions/Widgets/Controls/Cover/IntentCoverEntity.swift:29-34 | Sources/Extensions/Widgets/Controls/Fan/IntentFanEntity.swift:29-34 | Sources/Extensions/Widgets/Controls/Light/IntentLightEntity.swift:29-34 | Sources/Extensions/Widgets/Controls/Switch/IntentSwitchEntity.swift:29-34 | Sources/Extensions/Widgets/Entities/WidgetEntitiesAppEntity.swift:29-34 | Sources/Extensions/Widgets/Scene/Control/IntentSceneEntity.swift:30-35 — before extracting anything, compare `Sources/Extensions/AppIntents/Script/IntentScriptEntity.swift` and `Sources/Extensions/Widgets/Controls/Automation/IntentAutomationEntity.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 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 × 6) Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:15— Sources/WatchApp/Home/EntityDetails/Climate/WatchClimateControlView.swift:15-19 | Sources/WatchApp/Home/EntityDetails/Cover/WatchCoverControlsView.swift:15-19 | Sources/WatchApp/Home/EntityDetails/Fan/WatchFanControlsView.swift:14-18 | Sources/WatchApp/Home/EntityDetails/Light/WatchLightControlsView.swift:15-19 | Sources/WatchApp/Home/EntityDetails/Lock/WatchLockControlsView.swift:20-24 | Sources/WatchApp/Home/EntityDetails/Vacuum/WatchVacuumControlsView.swift:15-19 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times.
Duplicated block (6 lines × 6) Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:99— Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:99-104 | Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift:30-35 | Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift:30-35 | Sources/Extensions/AppIntents/Control/OpenableEntityAppEntityQuery.swift:67-72 | Sources/Extensions/AppIntents/Control/ThermostatAppEntityQuery.swift:30-35 | Sources/Extensions/AppIntents/EntityState/ReadableEntityOptionsProvider.swift:31-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Extensions/AppIntents/Control/ControllableEntityAppEntityQuery.swift:99` 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 (17–19 lines × 2) Tools/detect_unused_strings.py:75— Tools/detect_unused_strings.py:75-93 | Tools/detect_unused_strings.py:94-110 — 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 `Tools/detect_unused_strings.py:94` 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.
Swallowed exception (empty catch) Sources/App/Resources/WebSocketBridge.js:216— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Orphaned file Sources/Shared/Environment/CameraStreamServer.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/HANetworking/Sources/Alamofire+EncryptedResponses.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/App/ClientEvents/LocationHistoryDetailViewController.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/HAIconic/Sources/MDIMigration.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Environment/ActiveStateManager.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file fastlane/SnapshotHelper.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Common/Extensions/UIColor+CSS3+Hex.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Extensions/NotificationContent/ImageAttachmentViewController.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/API/Webhook/Sensors/GeocoderSensor.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Extensions/NotificationContent/MapViewController.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Environment/ServerAlerter.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/HANetworking/Sources/KeyedDecodingContainer+JSON.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Environment/DeviceWrapper.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PushServer/Sources/App/Controllers/PushController.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/App/ZoneManager/ZoneManagerRegionFilter.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/App/Utilities/OpenInChromeController.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Common/Extensions/CLLocation+Extensions.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/App/ClientEvents/LocationHistoryListView.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/MacBridge/MacBridgeNetworkMonitor.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/API/Webhook/Networking/Promise+WebhookJson.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Environment/DeviceBattery.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Extensions/NotificationContent/VideoAudioAttachmentViewController.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Extensions/Widgets/Controls/Fan/ControlFanValueProvider.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Notifications/NotificationSender/NotificationIconCache.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Shared/Common/Extensions/UIView+StackView.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate Sources/App/Utilities/Spotlight/HAAppEntityAppIntentEntity+IndexedEntity.swift:50— `!$0.isEmpty && seen.insert($0.lowercased()).inserted` appears character-identically in 2 files — Sources/App/Utilities/Spotlight/HAAppEntityAppIntentEntity+IndexedEntity.swift, Sources/App/Utilities/Spotlight/HACalendarAppEntity+IndexedEntity.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/Extensions/Widgets/Assist/WidgetAssistView.swift:55— `!entry.isPreview && Current.servers.all.count > 1` appears character-identically in 2 files — Sources/Extensions/Widgets/Assist/WidgetAssistView.swift, Sources/Extensions/Widgets/OpenPage/WidgetOpenPage.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/App/Frontend/ExternalMessageBus/EntityAddToHandler.swift:178— `$0.id == entityId && $0.serverId == serverId` appears character-identically in 2 files — Sources/App/Frontend/ExternalMessageBus/EntityAddToHandler.swift, Sources/App/Utilities/AppIntents/AddTo/EntityAddToConfigWriter.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/App/Settings/Widgets/Builder/WidgetCreationViewModel.swift:53— `$0.id == item.id && $0.serverId == item.serverId` appears character-identically in 2 files — Sources/App/Settings/Widgets/Builder/WidgetCreationViewModel.swift, Sources/WatchApp/Home/WatchHomeViewModel+Editing.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/WatchApp/ExtensionDelegate.swift:290— `["homeassistant", "homeassistant-dev"].contains(url.scheme) && url.host == "assist"` appears character-identically in 2 files — Sources/WatchApp/ExtensionDelegate.swift, Sources/WatchApp/Home/WatchHomeView.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/App/FlightGreetings/FlightDetector.swift:53— `authorizationStatus == .authorizedAlways || authorizationStatus == .authorizedWhenInUse` appears character-identically in 2 files — Sources/App/FlightGreetings/FlightDetector.swift, Sources/App/ServerSwitching/LocationBasedServerSwitcher.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/App/Settings/Calendars/HACalendarAppEntityQuery.swift:19— `calendar.name.localizedCaseInsensitiveContains(string) || calendar.entityId.localizedCaseInsensitiveContains(string)` appears character-identically in 2 files — Sources/App/Settings/Calendars/HACalendarAppEntityQuery.swift, Sources/Extensions/Widgets/Calendar/WidgetCalendarAppEntityQuery.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/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreMediaObjectCamera.swift:3— `canImport(CoreMediaIO) && targetEnvironment(macCatalyst)` appears character-identically in 3 files — Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreMediaObjectCamera.swift, Sources/Shared/API/Webhook/Sensors/CoreMedia and CoreAudio Helpers/HACoreMediaObjectSystem.swift, Sources/Shared/API/Webhook/Sensors/InputOutputDeviceSensor.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/App/Onboarding/API/OnboardingAuthError.swift:43— `lhsError.domain == rhsError.domain && lhsError.code == rhsError.code` appears character-identically in 2 files — Sources/App/Onboarding/API/OnboardingAuthError.swift, Sources/Shared/Notifications/NotificationAttachments/NotificationAttachmentParser.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/App/AppDelegate.swift:403— `os(iOS) && !targetEnvironment(macCatalyst)` appears character-identically in 83 files — Sources/App/AppDelegate.swift, Sources/App/LifecycleManager.swift, Sources/App/Notifications/NotificationManager.swift, Sources/App/Settings/Kiosk/KioskScreensaverView.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/PushServer/SharedPush/Sources/NotificationParserLegacy.swift:192— `payload[NotificationPayloadKey.iconURL.rawValue] != nil || payload[NotificationPayloadKey.notificationIcon.rawValue] != nil` appears character-identically in 2 files — Sources/PushServer/SharedPush/Sources/NotificationParserLegacy.swift, Sources/SharedPush/Sources/NotificationParserLegacy.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/App/Assist/Audio/AudioPlayer.swift:88— `server.info.connection.clientCertificate != nil || server.info.connection.securityExceptions.hasExceptions` appears character-identically in 2 files — Sources/App/Assist/Audio/AudioPlayer.swift, Sources/CarPlay/Templates/QuickAccess/CarPlayAssistSession.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/App/Utilities/Utils.swift:85— `status == errSecSuccess || status == errSecItemNotFound` appears character-identically in 2 files — Sources/App/Utilities/Utils.swift, Sources/HANetworking/Sources/ClientCertificate.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.
No direct assertions: testOnboardingConnectsAndFrontendOpensNativeSettings Tests/UI/OnboardingE2ETests.swift:22— No conventional assertion call was detected, and 7 of 9 tests in `UI` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: test1Onboards Tests/UI/RestoredDeviceFlowsRecordingTests.swift:26— No conventional assertion call was detected, and 7 of 9 tests in `UI` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: test2SetsUpAsANewDevice Tests/UI/RestoredDeviceFlowsRecordingTests.swift:31— No conventional assertion call was detected, and 7 of 9 tests in `UI` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: test3ReplacesTheOldDevice Tests/UI/RestoredDeviceFlowsRecordingTests.swift:40— No conventional assertion call was detected, and 7 of 9 tests in `UI` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: test4CancelsTheLogin Tests/UI/RestoredDeviceFlowsRecordingTests.swift:49— No conventional assertion call was detected, and 7 of 9 tests in `UI` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: test6SetsUpTwoServersAsANewDevice Tests/UI/RestoredDeviceFlowsRecordingTests.swift:58— No conventional assertion call was detected, and 7 of 9 tests in `UI` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: test5RegistersAsANewDeviceFromTheServerSettings Tests/UI/RestoredDeviceFlowsRecordingTests.swift:72— No conventional assertion call was detected, and 7 of 9 tests in `UI` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: circularComplicationVariants Tests/WatchAppTests/CircularComplicationWatchSnapshot.test.swift:9— No conventional assertion call was detected, and 4 of 4 tests in `WatchAppTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: cornerComplicationVariants Tests/WatchAppTests/CornerComplicationWatchSnapshot.test.swift:10— No conventional assertion call was detected, and 4 of 4 tests in `WatchAppTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: inlineComplicationVariants Tests/WatchAppTests/InlineComplicationWatchSnapshot.test.swift:8— No conventional assertion call was detected, and 4 of 4 tests in `WatchAppTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: rectangularComplicationVariants Tests/WatchAppTests/RectangularComplicationWatchSnapshot.test.swift:11— No conventional assertion call was detected, and 4 of 4 tests in `WatchAppTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
Silent fallback default in catch Sources/Shared/Watch/WatchDatabaseMirror.swift:204— `digestKeysForEmptyLocalTables` 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/Shared/Notifications/UNNotificationContent+Additions.swift:35— `userInfoActionConfigs` 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/WatchWidgets/WatchWidgetLiveFetch.swift:384— `readConfigs` 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.
D10 · Test Quality· Test project verifies nothing · ×1
Test project verifies nothing: WatchAppTests Tests/WatchAppTests/CircularComplicationWatchSnapshot.test.swift:9— No conventional assertion call was detected in 4 of 4 tests in `WatchAppTests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 542 significant file(s) lose their only recent owner: Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift, Sources/Watch/WatchCommunicatorService.swift, Sources/Shared/Common/Extensions/CLKComplication+Strings.swift, Sources/Shared/Extensions/MaterialDesignIcons+SFSymbol.swift, Sources/WatchApp/ExtensionDelegate.swift, Sources/Shared/MagicItem/MagicItem.swift, Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift, Sources/CarPlay/Templates/QuickAccess/CarPlayQuickAccessTemplate.swift (+534 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (546 single-owned of 1090 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1090 of the 2022 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Sources/App/Frontend/WebView/ClipboardWriteMessageHandler.swift, Sources/Shared/API/PeriodicUpdateManager.swift.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 14 project(s) overshoot their size bounds, lowering Project Cohesion to 7.1/10. The most over is `(repository root)` (185401 LoC, 4253 module-visible types across 264 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 46 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: Sources/Shared/Environment/CameraStreamServer.swift, Sources/HANetworking/Sources/Alamofire+EncryptedResponses.swift, Sources/App/ClientEvents/LocationHistoryDetailViewController.swift, Sources/HAIconic/Sources/MDIMigration.swift, Sources/Shared/Environment/ActiveStateManager.swift, fastlane/SnapshotHelper.swift, Sources/Shared/Common/Extensions/UIColor+CSS3+Hex.swift, Sources/Extensions/NotificationContent/ImageAttachmentViewController.swift (and 38 more) (47 orphaned of 1092 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1092 of the 2022 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 491/547 types (90%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
No SAST .github/workflows/ci.yml:8— 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 87121 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.
X5 · Nullable reference types· Ruby's type checker does not check nil everywhere · ×1
Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 12 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
Outdated: abseil-cpp-binary — `abseil-cpp-binary` is resolved at 1.2024072200.0, but 1.2025051202.0 is the newest release tagged on https://github.com/google/abseil-cpp-binary.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update abseil-cpp-binary` reaches this one with no change to Package.swift.
Outdated: app-check — `app-check` is resolved at 11.3.0, but 11.3.2 is the newest release tagged on https://github.com/google/app-check.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update app-check` reaches this one with no change to Package.swift.
Outdated: combine-schedulers — `combine-schedulers` is resolved at 1.2.0, but 1.2.2 is the newest release tagged on https://github.com/pointfreeco/combine-schedulers within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update combine-schedulers` reaches this one with no change to Package.swift.
Outdated: debugswift — `debugswift` is resolved at 1.16.0, but 1.19.0 is the newest release tagged on https://github.com/DebugSwift/DebugSwift.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update debugswift` reaches this one with no change to Package.swift.
Outdated: firebase-ios-sdk — `firebase-ios-sdk` is resolved at 12.15.0, but 12.19.3 is the newest release tagged on https://github.com/firebase/firebase-ios-sdk.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update firebase-ios-sdk` reaches this one with no change to Package.swift.
Outdated: google-ads-on-device-conversion-ios-sdk — `google-ads-on-device-conversion-ios-sdk` is resolved at 3.6.1, but 3.7.0 is the newest release tagged on https://github.com/googleads/google-ads-on-device-conversion-ios-sdk within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update google-ads-on-device-conversion-ios-sdk` reaches this one with no change to Package.swift.
Outdated: googleappmeasurement — `googleappmeasurement` is resolved at 12.15.0, but 12.19.2 is the newest release tagged on https://github.com/google/GoogleAppMeasurement.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update googleappmeasurement` reaches this one with no change to Package.swift.
Outdated: googledatatransport — `googledatatransport` is resolved at 10.1.0, but 10.1.1 is the newest release tagged on https://github.com/google/GoogleDataTransport.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update googledatatransport` reaches this one with no change to Package.swift.
Outdated: googleutilities — `googleutilities` is resolved at 8.1.2, but 8.1.5 is the newest release tagged on https://github.com/google/GoogleUtilities.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update googleutilities` reaches this one with no change to Package.swift.
Outdated: grdb.swift — `grdb.swift` is resolved at 7.8.0, but 7.11.1 is the newest release tagged on https://github.com/groue/GRDB.swift.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update grdb.swift` reaches this one with no change to Package.swift.
Outdated: grpc-binary — `grpc-binary` is resolved at 1.69.1, but 1.83.1 is the newest release tagged on https://github.com/google/grpc-binary.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update grpc-binary` reaches this one with no change to Package.swift.
Outdated: gtm-session-fetcher — `gtm-session-fetcher` is resolved at 5.3.0, but 5.3.1 is the newest release tagged on https://github.com/google/gtm-session-fetcher.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update gtm-session-fetcher` reaches this one with no change to Package.swift.
Outdated: promisekit — `promisekit` is resolved at 8.1.1, but 8.2.0 is the newest release tagged on https://github.com/mxcl/PromiseKit/ within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update promisekit` reaches this one with no change to Package.swift.
Outdated: redis — `redis` is resolved at 4.10.0, but 4.14.0 is the newest release tagged on https://github.com/vapor/redis.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update redis` reaches this one with no change to Package.swift.
Outdated: stencil — `stencil` is resolved at 0.14.1, but 0.15.1 is the newest release tagged on https://github.com/kylef/Stencil.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update stencil` reaches this one with no change to Package.swift.
Outdated: stencilswiftkit — `stencilswiftkit` is resolved at 2.8.0, but 2.10.1 is the newest release tagged on https://github.com/SwiftGen/StencilSwiftKit.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update stencilswiftkit` reaches this one with no change to Package.swift.
Outdated: swift-clocks — `swift-clocks` is resolved at 1.1.0, but 1.1.1 is the newest release tagged on https://github.com/pointfreeco/swift-clocks within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-clocks` reaches this one with no change to Package.swift.
Outdated: swift-concurrency-extras — `swift-concurrency-extras` is resolved at 1.4.0, but 1.4.3 is the newest release tagged on https://github.com/pointfreeco/swift-concurrency-extras within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-concurrency-extras` reaches this one with no change to Package.swift.
Outdated: swift-custom-dump — `swift-custom-dump` is resolved at 1.6.1, but 1.7.3 is the newest release tagged on https://github.com/pointfreeco/swift-custom-dump within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-custom-dump` reaches this one with no change to Package.swift.
Outdated: swift-dependencies — `swift-dependencies` is resolved at 1.14.1, but 1.17.1 is the newest release tagged on https://github.com/pointfreeco/swift-dependencies within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-dependencies` reaches this one with no change to Package.swift.
Outdated: swift-snapshot-testing — `swift-snapshot-testing` is resolved at 1.18.1, but 1.19.7 is the newest release tagged on https://github.com/pointfreeco/swift-snapshot-testing within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-snapshot-testing` reaches this one with no change to Package.swift.
Outdated: swiftformat — `swiftformat` is resolved at 0.53.1, but 0.64.4 is the newest release tagged on https://github.com/nicklockwood/SwiftFormat within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swiftformat` reaches this one with no change to Package.swift.
Outdated: swiftgen — `swiftgen` is resolved at 6.5.1, but 6.6.3 is the newest release tagged on https://github.com/SwiftGen/SwiftGen within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swiftgen` reaches this one with no change to Package.swift.
Outdated: vapor — `vapor` is resolved at 4.92.3, but 4.122.3 is the newest release tagged on https://github.com/vapor/vapor.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update vapor` reaches this one with no change to Package.swift.
Outdated: xctest-dynamic-overlay — `xctest-dynamic-overlay` is resolved at 1.10.1, but 1.13.1 is the newest release tagged on https://github.com/pointfreeco/xctest-dynamic-overlay within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update xctest-dynamic-overlay` reaches this one with no change to Package.swift.
Off the main sequence: SharedPush (Sources/PushServer/SharedPush) — SharedPush (Sources/PushServer/SharedPush): abstractness 0.25, instability 0.00, distance 0.75 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: SharedPush (Sources/SharedPush) — SharedPush (Sources/SharedPush): abstractness 0.25, instability 0.00, distance 0.75 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
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.
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 491 file(s) — `Sources/App/Assist/AssistTypingIndicator.swift`, `Sources/App/Assist/AssistView.swift`, `Sources/App/Assist/Local/TTSVoicePickerView.swift`, `Sources/App/Assist/Views/AssistWavesAnimation.swift`, `Sources/App/BarcodeScanner/Camera/BarcodeScannerView.swift`, … (+486 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 01a186f7-ca63-77b4-80b8-594dfdad56f3 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 91 · Warnings: 1170 · Recommendations: 89 · Info: 27 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-10-2026 @ 09:22 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.