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

Kruszoneq/macUSB

Measured 28 October 2026, 23:13 UTC, at code version 777ed53

No regression since the last survey Test distribution: not measured

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.

Test distribution is not measured: No automated tests.

CAI score 50out of 100 Weak
CriticalWeakAdequateStrongExemplary
No change since the last survey

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

A medium codebase: 34,286 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.2 person-years · Weakest lens: Production Readiness, 26

Findings by how serious they are

1 critical 335 serious 12 minor

35 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
28 October 2026, 23:13 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 ▸

35of 35 dimensions measured by tools.
340of 348 findings point to an exact file and line, so you can open each one in the code. The other 8 concern the repository as a whole, such as missing documentation.
35dimensions across 6 lenses, read from 34,286 lines of product code in 1 project.
Chapters

Executive summary

Kruszoneq/macUSB falls short of our standard for production because its Testing dimensions are rated Critical, and the project has no automated tests. It scores 50 out of 100, which alone would earn Adequate, but it is rated Weak: a rating can't sit more than one step above its weakest group.

Production Readiness, at 26, is the weakest lens and counts most in the score. The best first step is adding automated tests, worth about 20 points. Raising Production Readiness to 70 would lift the score to about 69.

The project has no automated tests, so a change can break it without warning. Adding automated tests would close this risk.

The product code is 34,286 lines, about €32,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 26 · counts for 46%Maturity 63 · counts for 25%Code Health 72 · counts for 14%Performance 78 · counts for 8%Architecture 88 · counts for 4%Security and Compliance 100 · counts for 2%

If Production Readiness rose from 26 to 70, the lowest score rated Strong, the score would rise from 50 to about 69.

Code composition: what the lines of code are
Product code 100%
New since the last survey: 91 findings

These 91 critical or serious findings weren't in the previous survey, on 14 October 2026.

  • Cyclomatic Complexity · USBTargetDiscoveryService.scan (cyclomatic 80) macUSB/Shared/Services/USBTargetDiscoveryService.swift
  • Cyclomatic Complexity · AnalysisLogic.confirmUSBTargetForHandoff (cyclomatic 38) macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift
  • Cyclomatic Complexity · USBDiscoveryProcessRunner.runReport (cyclomatic 38) macUSB/Shared/Services/USBDiscoveryProcessRunner.swift
  • Cyclomatic Complexity · USBDiscoveryVolumeCollector.collect (cyclomatic 30) macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift
  • Cyclomatic Complexity · AnalysisLogic.usbDiscoveryNotice (cyclomatic 21) macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift
  • Cyclomatic Complexity · AnalysisLogic.checkCapacity (cyclomatic 20) macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift
  • Cyclomatic Complexity · SystemAnalysisUSBSectionView.body (cyclomatic 19) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • Cyclomatic Complexity · WelcomeStartupUpdateChecker.check (cyclomatic 17) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift
  • Cyclomatic Complexity · USBDiscoveryRegistryProbe.media (cyclomatic 17) macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift
  • Cyclomatic Complexity · AnalysisLogic.selectedDriveForInstallation (cyclomatic 16) macUSB/Features/Analysis/AnalysisLogic.swift
  • Cognitive Complexity · USBTargetDiscoveryService.scan (cognitive 118) macUSB/Shared/Services/USBTargetDiscoveryService.swift
  • Cognitive Complexity · USBDiscoveryProcessRunner.runReport (cognitive 63) macUSB/Shared/Services/USBDiscoveryProcessRunner.swift
  • Cognitive Complexity · AnalysisLogic.confirmUSBTargetForHandoff (cognitive 50) macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift
  • Cognitive Complexity · USBDiscoveryVolumeCollector.collect (cognitive 45) macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift
  • Cognitive Complexity · SystemAnalysisUSBSectionView.body (cognitive 34) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • Cognitive Complexity · AppLogging.startSession (cognitive 27) macUSB/Shared/Services/Logging.swift
  • Cognitive Complexity · WelcomeStartupUpdateChecker.check (cognitive 24) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift
  • Cognitive Complexity · USBDiscoveryRegistryProbe.media (cognitive 21) macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift
  • Cognitive Complexity · AnalysisLogic.selectedDriveForInstallation (cognitive 20) macUSB/Features/Analysis/AnalysisLogic.swift
  • Cognitive Complexity · AnalysisLogic.usbDiscoveryNotice (cognitive 20) macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift
  • Cognitive Complexity · AnalysisLogic.checkCapacity (cognitive 20) macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift
  • Cognitive Complexity · AnalysisLogic.forceTigerMultiDVDSelection (cognitive 17) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSLifecycle.swift
  • God Classes · MethodTooLong: USBTargetDiscoveryService.scan macUSB/Shared/Services/USBTargetDiscoveryService.swift
  • God Classes · MethodTooLong: SystemAnalysisUSBSectionView.body macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • God Classes · ClassTooLong: PrivilegedOperationClient macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Near-duplicate member pair (117 shared lines) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift
  • Code Duplication · Edited copy of a member (14 corresponding lines) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift
  • Code Duplication · Edited copy of a member (16 corresponding lines) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • Code Duplication · Edited copy of a member (25 corresponding lines) macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift
  • Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) macUSB/Features/Installation/CreatorLogic.swift
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) macUSB/App/macUSBApp.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) macUSB/Features/Analysis/AnalysisLogic.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) macUSB/Features/Analysis/AnalysisLogic.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) macUSB/Features/Installation/CreatorHelperLogic.swift
  • Code Duplication · Duplicated block (27 lines × 2) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift
  • Code Duplication · Duplicated block (19 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift
  • Code Duplication · Duplicated block (19 lines × 2) macUSB/Features/Installation/UniversalInstallationView.swift
  • Code Duplication · Duplicated block (17 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (17 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (16 lines × 2) macUSB/Features/Installation/CreatorHelperLogic.swift
  • Code Duplication · Duplicated block (15 lines × 2) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • Code Duplication · Duplicated block (10–14 lines × 3) macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift
  • Code Duplication · Duplicated block (13 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (12–13 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (12 lines × 2) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • Code Duplication · Duplicated block (12 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift
  • Code Duplication · Duplicated block (11 lines × 3) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (11 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift
  • Code Duplication · Duplicated block (11 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift
  • Code Duplication · Duplicated block (11 lines × 2) macUSB/Features/Installation/UniversalInstallationView.swift
  • Code Duplication · Duplicated block (10–11 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift
  • Code Duplication · Duplicated block (10 lines × 4) macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift
  • Code Duplication · Duplicated block (10 lines × 3) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift
  • Code Duplication · Duplicated block (10 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift
  • Code Duplication · Duplicated block (9 lines × 4) macUSB/Features/Installation/UniversalInstallationView.swift
  • Code Duplication · Duplicated block (7–9 lines × 3) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift
  • Code Duplication · Duplicated block (9 lines × 2) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift
  • Code Duplication · Duplicated block (9 lines × 2) macUSB/Features/Installation/UniversalInstallationView.swift
  • Code Duplication · Duplicated block (9 lines × 2) macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift
  • Code Duplication · Duplicated block (8 lines × 4) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift
  • Code Duplication · Duplicated block (8 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift
  • Code Duplication · Duplicated block (7 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift
  • Code Duplication · Duplicated block (7 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift
  • Code Duplication · Duplicated block (7 lines × 2) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift
  • Code Duplication · Duplicated block (6 lines × 15) macUSB/App/macUSBApp.swift
  • Code Duplication · Duplicated block (6 lines × 3) macUSB/Features/Analysis/SystemAnalysisView.swift
  • Code Duplication · Duplicated block (6 lines × 2) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift
  • Code Duplication · Duplicated block (5 lines × 11) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift
  • Code Duplication · Duplicated block (5 lines × 10) macUSB/App/macUSBApp.swift
  • Code Duplication · Duplicated block (2–5 lines × 11) macUSB/Features/Installation/CreatorLogic.swift
  • Code Duplication · Duplicated block (5 lines × 2) macUSB/Features/Analysis/RawLinuxImage/RawLinuxImageSelectionCoordinator.swift
  • Code Duplication · Duplicated block (5 lines × 2) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • Code Duplication · Duplicated block (5 lines × 2) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift
  • Code Duplication · Duplicated block (5 lines × 2) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift
  • Code Duplication · Duplicated block (4–5 lines × 5) macUSB/Shared/Services/FullDiskAccessPermissionManager.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Shared/Services/USBTargetDiscoveryService.swift macUSB/Shared/Services/USBTargetDiscoveryService.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Features/Analysis/AnalysisLogic.swift macUSB/Features/Analysis/AnalysisLogic.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.swift macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift
  • Churn × Complexity Hotspots · Hotspot: macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift
  • Change Coupling · Change coupling: MacOSCleanupLogic.swift ↔ MacOSDownloaderProcessView.swift macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift
  • Change Coupling · Change coupling: MacOSCleanupLogic.swift ↔ MacOSDownloaderWindowShellView.swift macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift
  • Change Coupling · Change coupling: AnalysisLogicUsbDrives.swift ↔ SystemAnalysisView.swift macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift
  • Change Coupling · Change-coupling hub: MacOSDownloadOrchestrator.swift → MacOSDownloaderProcessView.swift, MacOSDownloaderSummaryView.swift, MacOSDownloaderWindowShellView.swift macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift

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

Fixed since the last survey: 46 findings

These 46 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one.

  • Cyclomatic Complexity · UniversalInstallationView.prepareHelperWorkflowRequest (cyclomatic 16) macUSB/Features/Installation/CreatorHelperLogic.swift
  • Cognitive Complexity · SystemAnalysisUSBSectionView.body (cognitive 18) macUSB/Features/Analysis/SystemAnalysisView.swift
  • Cognitive Complexity · UniversalInstallationView.prepareHelperWorkflowRequest (cognitive 17) macUSB/Features/Installation/CreatorHelperLogic.swift
  • Cognitive Complexity · WelcomeView.checkForUpdates (cognitive 17) macUSB/Features/Welcome/WelcomeView.swift
  • Code Duplication · Near-duplicate member pair (69 shared lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Edited copy of a member (25 corresponding lines) macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) macUSB/Features/Installation/CreatorHelperLogic.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) macUSB/Features/Analysis/AnalysisLogic.swift
  • Code Duplication · Duplicated block (38 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (26 lines × 2) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift
  • Code Duplication · Duplicated block (20–23 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift
  • Code Duplication · Duplicated block (19 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift
  • Code Duplication · Duplicated block (19 lines × 2) macUSB/Features/Installation/UniversalInstallationView.swift
  • Code Duplication · Duplicated block (6–18 lines × 8) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift
  • Code Duplication · Duplicated block (17 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift
  • Code Duplication · Duplicated block (15 lines × 2) macUSB/Features/Analysis/SystemAnalysisView.swift
  • Code Duplication · Duplicated block (14–15 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (14 lines × 3) macUSB/Features/Installation/CreatorHelperLogic.swift
  • Code Duplication · Duplicated block (14 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift
  • Code Duplication · Duplicated block (14 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
  • Code Duplication · Duplicated block (12–13 lines × 2) macUSB/Features/Analysis/SystemAnalysisView.swift
  • Code Duplication · Duplicated block (12 lines × 2) macUSB/Features/Installation/UniversalInstallationView.swift
  • Code Duplication · Duplicated block (11 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift
  • Code Duplication · Duplicated block (11 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift
  • Code Duplication · Duplicated block (10 lines × 3) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift
  • Code Duplication · Duplicated block (10 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift
  • Code Duplication · Duplicated block (9 lines × 4) macUSB/Features/Installation/UniversalInstallationView.swift
  • Code Duplication · Duplicated block (9 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift
  • Code Duplication · Duplicated block (9 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift
  • Code Duplication · Duplicated block (9 lines × 2) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift
  • Code Duplication · Duplicated block (3–9 lines × 3) macUSB/Features/Finish/FinishUSBView.swift
  • Code Duplication · Duplicated block (9 lines × 2) macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift
  • Code Duplication · Duplicated block (8 lines × 2) macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift
  • Code Duplication · Duplicated block (7 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift
  • Code Duplication · Duplicated block (7 lines × 2) macUSB/Features/Welcome/WelcomeView.swift
  • Code Duplication · Duplicated block (6 lines × 9) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift
  • Code Duplication · Duplicated block (6 lines × 8) macUSB/App/macUSBApp.swift
  • Code Duplication · Duplicated block (6 lines × 7) macUSB/App/macUSBApp.swift
  • Code Duplication · Duplicated block (6 lines × 6) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift
  • Code Duplication · Duplicated block (6 lines × 4) macUSB/Shared/Services/FullDiskAccessPermissionManager.swift
  • Code Duplication · Duplicated block (4–6 lines × 3) macUSB/App/macUSBApp.swift
  • Code Duplication · Duplicated block (5 lines × 7) macUSB/Features/Installation/macOS/CreatorMacOSRosettaLogic.swift
  • Code Duplication · Duplicated block (5 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift
  • Change Coupling · Change coupling: macUSBApp.swift ↔ AnalysisLogicLinuxLifecycle.swift macUSB/App/macUSBApp.swift
  • Exception handling · Swallowed exception (caught, then discarded) macUSB/Shared/Services/USBDriveLogic.swift
Rebuild cost: about €32,000 · Estimate
Cost to rebuild€11,000 to €54,000, for 178 to 565 hours of work, about 0.2 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 50. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 34,286 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: 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
Resolve the 1 No automated tests finding(s) in Code Coverage.
Raises the score by about 20 points · Low effort · Code Coverage
2
Resolve the 1 No tests found finding(s) in Test Distribution.
Raises the score by about 20 points · Low effort · Test Distribution
3
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 4 points · Low effort · ADR Quality

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 €32,000 to build again, about 0.2 person-years of work. Its weakest lens is Production Readiness, at 26 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No automated tests finding(s) in Code Coverage. Of all the actions in this report, it raises the score most for the work it takes: about 20 points for low effort, because it clears the 1 Code Coverage findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.8 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 180,397 lines over the last 90 days, which is about 731,610 lines a year. At that pace, the extra work comes to an estimated 53.9 to 323.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

At a glance — Code Health · 72% · Adequate · gated by D2 ·

At a glance — Architecture · 88% · Adequate · gated by D26 ·

At a glance — Maturity · 63% · Adequate ·

At a glance — Readiness · 26% · Weak · gated by D8, D9, P1, P3 ·

At a glance — Security · 100% · Exemplary ·

At a glance — Performance · 78% · Strong ·

Roadmap

First, establish a CI workflow to automatically build and run tests on every push or pull request to ensure immediate feedback. Next, address the lack of automated testing by resolving the identified coverage gaps and ensuring tests are properly distributed across the codebase. Finally, improve architectural transparency by documenting significant design decisions in a dedicated folder, capturing the context, choices, and consequences for each.

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

Do thisHelpsEffortDimension
Resolve the 1 No automated tests finding(s) in Code Coverage.+20.1 ptsLowCode Coverage
Resolve the 1 No tests found finding(s) in Test Distribution.+20.1 ptsLowTest Distribution
Resolve the 1 No ADRs found finding(s) in ADR Quality.+4.3 ptsLowADR Quality
Add a CI workflow that builds and runs the test suite on every push/PR.+7.3 ptsMediumCI/CD gates
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.+2.7 ptsMediumArchitecture documentation
Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.+2.2 ptsMediumFolder & project structure
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.+1.7 ptsMediumDocumentation (README)
Swallowed exception (caught, then discarded)+1.3 ptsMediumException handling

File quality

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

FileScoreBandWorst signal
macUSB/Features/Analysis/SystemAnalysisView.swift5.5MixedCyclomatic Complexity: SystemAnalysisView.detectedOrUnsupportedView (cyclomatic 50)
macUSB/App/macUSBApp.swift5.6MixedCyclomatic Complexity: macUSBApp.body (cyclomatic 29)
macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift5.7MixedCyclomatic Complexity: MontereyDownloadFlowModel.runWorkflow (cyclomatic 26)
macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift6.3MixedCyclomatic Complexity: AnalysisLogic.checkCapacity (cyclomatic 20)
macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift6.3MixedCode Duplication: Duplicated block (15–16 lines × 2)
macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift7.0MixedCyclomatic Complexity: AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cyclomatic 84)
macUSB/Features/Installation/UniversalInstallationView.swift7.0MixedCyclomatic Complexity: UniversalInstallationView.body (cyclomatic 48)
macUSB/Features/Installation/CreatorHelperLogic.swift7.0MixedCyclomatic Complexity: UniversalInstallationView.startCreationProcessWithHelper (cyclomatic 48)
macUSB/Features/Finish/FinishUSBView.swift7.0MixedCyclomatic Complexity: FinishUSBView.body (cyclomatic 31)
macUSB/Shared/Services/USBDriveLogic.swift7.0MixedCyclomatic Complexity: USBDriveLogic.detectUSBSpeed (cyclomatic 18)
macUSB/Features/Analysis/AnalysisLogic.swift7.0MixedCyclomatic Complexity: AnalysisLogic.selectedDriveForInstallation (cyclomatic 16)
macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift7.0MixedCyclomatic Complexity: AnalysisLogic.classifyLinuxDistribution (cyclomatic 67)
macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift7.0MixedCognitive Complexity: HelperWorkflowExecutor.runLinuxUnmountTargetStage (cognitive 17)
macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift7.0MixedGod Classes: MethodTooLong: DownloaderAssemblyExecutor.runInstallerBasedOldestDiskImageAssemblyAndLocateApp
macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift7.0MixedCyclomatic Complexity: AnalysisLogic.classifyWindowsServerFamily (cyclomatic 40)
macUSBHelper/Workflow/HelperWorkflowStages.swift7.0MixedCyclomatic Complexity: HelperWorkflowExecutor.prepareWorkflowContext (cyclomatic 23)
macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift7.0MixedCyclomatic Complexity: SystemAnalysisUSBSectionView.body (cyclomatic 19)
macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift7.0MixedCyclomatic Complexity: AnalysisLogic.indexLinuxArchive (cyclomatic 16)
macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift7.0MixedCyclomatic Complexity: MontereyDownloadFlowModel.verifyIntegrityDataChunklistIfAvailable (cyclomatic 16)
macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift7.0MixedCognitive Complexity: MontereyDownloadFlowModel.resolveLegacyAssemblyFiles (cognitive 16)

How the grades work

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

Critical — 1

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

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

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

Could not be resolved — 35

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. 35 of 35 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 35 dimensions across the health lenses
D1D2D3D4D6D8D9D13D15D17D20D26D28D29D34D35D37AX10AX3AX4AX8AX9M1M2M3P1P2P3P6PF2PF3X14X26X28X3

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a184ca-2381-72dd-9fe1-6ece05fdb674.

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

Run transparency — what happened this run

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

  • D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. No dependency manifest this pass reads for hygiene (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems)) was found in this repository, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
  • D14 License Compliance — 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. Not scored — no dependency manifest this pass reads for licence data (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems)) was found in this repository, so it declares no third-party dependency closure to grade. A gap in the analyzer, NOT a finding that this repository's licences are compliant: a manifest in an ecosystem outside that list, or third-party code copied into the tree, is not read — so this dimension asserts nothing about this repository's licensing in either direction.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (7 contributor(s) across 495 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 6 hold 0.5% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • 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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
  • 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.
  • 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. `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift`, `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift`, `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxMetadata.swift`, `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift`, `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSInstallerMetadata.swift`, … (+24 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.
  • D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AX6 Interface segregation — 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
  • AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: a native UI project (macUSB.xcodeproj/project.pbxproj). The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • 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.
  • 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 no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Swift 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Swift 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.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • P8 Schema migrations — 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 EF Core usage in C# and the schema tooling its file scan recognises only, and no .NET project was loaded, and this repository's language is not one the scan models, 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.
  • 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.
  • X1 Async correctness — 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, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, 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.
  • X12 Unreachable branch — 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
  • X13 Undrained process stream — 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust and Dart source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust or Dart was found in this repository, 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.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
  • X17 Uncapped recursion over a caller-supplied document — 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, 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.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala or PHP was found in this repository, 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.
  • 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 JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python or Rust was found in this repository, 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.
  • X22 Contradicted release guard — 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 Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's Swift 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.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin or PHP was found in this repository, 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.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, 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.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby was found in this repository, 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.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
  • X30 Support guard that admits what it rejects — 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 Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart and Ruby source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart or Ruby was found in this repository, 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.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala or Rust was found in this repository, 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.
  • X5 Nullable reference types — 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 MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Swift 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.

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.
  • 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.
  • 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").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • 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.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity5.6 / 10Adequate✓ Tool-verified

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

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

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

48 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was AnalysisLogic.applyMacosCompatibilityForMountedInstaller at 84. A further 2 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being HelperWorkflowLocalizationKeys.presentation at 24 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: macUSB/Shared/Localization/HelperWorkflowLocalizationKeys.swift (HelperWorkflowLocalizationKeys.presentation at 24), macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsTypes.swift (WindowsFamily.displayVersionLabel at 16). 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.

AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cyclomatic 84)macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5
USBTargetDiscoveryService.scan (cyclomatic 80)macUSB/Shared/Services/USBTargetDiscoveryService.swift:6
AnalysisLogic.applyMacosCompatibilityForAppInstaller (cyclomatic 78)macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:183
AnalysisLogic.classifyLinuxDistribution (cyclomatic 67)macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:54
SystemAnalysisView.detectedOrUnsupportedView (cyclomatic 50)macUSB/Features/Analysis/SystemAnalysisView.swift:366

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

What to do

  1. Bring the 12 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cyclomatic 84), USBTargetDiscoveryService.scan (cyclomatic 80), AnalysisLogic.applyMacosCompatibilityForAppInstaller (cyclomatic 78). — 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 12 together lifts Cyclomatic Complexity from 5.6 to about 7.0/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
  2. Stand up a CI pipeline, then gate Cyclomatic Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity3.7 / 10Weak✓ Tool-verified

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

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

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

73 method(s) exceeded the cognitive complexity threshold of 15; the worst was USBTargetDiscoveryService.scan at 118.

USBTargetDiscoveryService.scan (cognitive 118)macUSB/Shared/Services/USBTargetDiscoveryService.swift:6
AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cognitive 92)macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5
UniversalInstallationView.startCreationProcessWithHelper (cognitive 91)macUSB/Features/Installation/CreatorHelperLogic.swift:32
AnalysisLogic.applyMacosCompatibilityForAppInstaller (cognitive 80)macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:183
AnalysisLogic.startAnalysis (cognitive 78)macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift:36

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

What to do

  1. Bring the 7 bodies over 60 down to 60 or less in Cognitive Complexity — start with USBTargetDiscoveryService.scan (cognitive 118), AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cognitive 92), UniversalInstallationView.startCreationProcessWithHelper (cognitive 91). — 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 7 together lifts Cognitive Complexity from 3.7 to about 5.1/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Stand up a CI pipeline, then gate Cognitive Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes6.7 / 10Adequate✓ Tool-verified

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

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

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

36 god class(es) detected.

MethodTooLong: UniversalInstallationView.body · ×19macUSB/Features/Installation/UniversalInstallationView.swift:188
TooManyMethods: AnalysisLogic · ×7macUSB/Features/Analysis/AnalysisLogic.swift:6
FileTooLong: Installation/CreatorHelperLogic.swift · ×6macUSB/Features/Installation/CreatorHelperLogic.swift
ClassTooLong: FinishUSBView · ×4macUSB/Features/Finish/FinishUSBView.swift:5

What to do

  1. Resolve the 19 MethodTooLong finding(s) in God Classes — start with CreatorHelperLogic.swift (2), HelperWorkflowStages.swift (2), AnalysisLogicMacOSCompatibility.swift (2). — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 7 TooManyMethods finding(s) in God Classes — start with AnalysisLogic.swift, HelperWorkflowExecutor.swift, MacOSDownloadState.swift. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 6 FileTooLong finding(s) in God Classes — start with CreatorHelperLogic.swift, FinishUSBView.swift, DownloaderAssemblyProcess.swift. — One of this dimension's main actionable groups (6 warning-level).
  4. Stand up a CI pipeline, then gate God Classes in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication8.2 / 10Strong✓ Tool-verified

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

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

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

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

Duplicated block (5 lines × 2) · ×11macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:44
Duplicated block (9 lines × 2) · ×8macUSB/Features/Analysis/AnalysisLogic.swift:445
Duplicated block (15 lines × 2) · ×6macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:160
Duplicated block (7 lines × 2) · ×6macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:60
Duplicated block (19 lines × 2) · ×5macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:239

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

What to do

  1. Resolve the 11 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with WelcomeStartupUpdateChecker.swift (2), HelperIPC.swift (2), AnalysisLogicFileSelection.swift. — One of this dimension's main actionable groups (11 warning-level).
  2. Resolve the 8 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with AnalysisLogicMacOSImageMounting.swift (2), AnalysisLogic.swift, AnalysisLogicLinuxClassification.swift. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 6 Duplicated block (15 lines × 2) finding(s) in Code Duplication — start with AnalysisLogicLinuxClassification.swift, SystemAnalysisUSBSectionView.swift, MacOSDownloaderProcessView.swift. — One of this dimension's main actionable groups (6 warning-level).
  4. Stand up a CI pipeline, then gate Code Duplication in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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.

D6 · Cohesion (LCOM4)9.7 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

1 of 47 classes have LCOM4 above 3.

Low cohesion: MenuState (LCOM4 4)macUSB/Shared/Services/MenuState.swift:4

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with MenuState.swift. — One of this dimension's main actionable groups (1 warning-level).
  2. Stand up a CI pipeline, then gate Cohesion (LCOM4) in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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.

D8 · Code Coverage0.0 / 10Critical✓ Tool-verified

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

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

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

No automated tests — no test code was found in this repository.

No automated tests

What to do

  1. Resolve the 1 No automated tests finding(s) in Code Coverage. — One of this dimension's main actionable groups (1 issue-level).
  2. Stand up a CI pipeline, then gate Code Coverage in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution0.0 / 10Critical✓ Tool-verified

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

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

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

No test suite found.

No tests found

What to do

  1. Resolve the 1 No tests found finding(s) in Test Distribution. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

Top hotspots: macUSB/Features/Analysis/SystemAnalysisView.swift (16×50=800); macUSB/Features/Installation/UniversalInstallationView.swift (15×48=720); macUSB/App/macUSBApp.swift (18×29=522)

Hotspot: macUSB/Features/Analysis/SystemAnalysisView.swift · ×20macUSB/Features/Analysis/SystemAnalysisView.swift:366

What to do

  1. Resolve the 20 Hotspot finding(s) in Churn × Complexity Hotspots — start with SystemAnalysisView.swift, UniversalInstallationView.swift, macUSBApp.swift. — One of this dimension's main actionable groups (20 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

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

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

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

1 of 1 build units (Xcode) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

semgrep found no security issues.

✓ On the Gold path — maintain.

Detailed fixes: d29_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.3 / 10Stronggated by 6 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: MacOSCleanupLogic.swift↔MacOSDownloaderProcessView.swift 70%; MacOSCleanupLogic.swift↔MacOSDownloaderWindowShellView.swift 70%; AnalysisLogicUsbDrives.swift↔SystemAnalysisView.swift 64%

Change coupling: MacOSCleanupLogic.swift ↔ MacOSDownloaderProcessView.swift · ×5macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:1
Change-coupling hub: MacOSDownloadOrchestrator.swift → MacOSDownloaderProcessView.swift, MacOSDownloaderSummaryView.swift, MacOSDownloaderWindowShellView.swiftmacUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift

What to do

  1. Resolve the 5 Change coupling finding(s) in Change Coupling — start with MacOSCleanupLogic.swift (2), AnalysisLogicUsbDrives.swift, SystemAnalysisView.swift. — One of this dimension's main actionable groups (5 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with MacOSDownloadOrchestrator.swift. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. 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 — check that business logic isn't leaking into the application/infrastructure layers (a thin domain is the anemic-domain smell).
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

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

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

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

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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

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

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

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure6.0 / 10Adequate✓ Tool-verified

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

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

  • Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.

What to do

  • Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
  • Start a test surface where your build system looks for one (tests/, test/, spec/, or your ecosystem's test source set) — the separation follows from putting the first tests in the right place.
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified

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.

  • No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.

What to do

  • Add a CI workflow that builds and runs the test suite on every push/PR.
P2 · Observability7.0 / 10Strong✓ Tool-verified

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

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

P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Run what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

What to do

  • Raise allocation-aware density on the hot paths — currently 12 use(s) across 38,227 production line(s) (~0.3/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.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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.

X3 · Exception handling6.6 / 10Adequate✓ Tool-verified

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

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

  • `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. (×9) — macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:63, macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:183, macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:198, …

What to do

  • Swallowed exception (caught, then discarded)

Reference — by lens

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

LensScoreRatingImpact
Code Health72%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture88%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity63%AdequateAcceptable, with room to improve.
Readiness26%Weak — gated by D8, D9, P1, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security100%ExemplaryStrongest area.
Performance78%StrongSolid.
Unscored — 1 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 — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: 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.
  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 79 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 applicable: this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads.
  • 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 — not assessed — interface segregation is computed over a type surface 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • D10 Test Quality — No tests were found in the analyzed repository to assess for quality.
  • D11 Test Reliability — No test suite was found to re-run, so reliability couldn't be assessed. Two searches produced that zero and both came back empty: the classifier that reads the loaded workspace recognised no suite it could run, and a walk of the source on disk — which covers the JS/TS `*.test.*` and `*.spec.*` conventions and probes for a Pester suite — found no test source in any other ecosystem either. Neither search reaches a suite that is missing from the loaded workspace and carries no name either walk recognises, so this is 'no suite found by those two searches', not a verdict that the repository has none.
  • D12 Dependency Hygiene — Dependency hygiene not measured — no supported dependency manifest was read
  • D14 License Compliance — No dependency manifest found — no declared dependency closure to grade for licences
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Swift not measured.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .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.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 29 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
  • 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.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D5 Coupling — Not applicable — this Xcode build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • 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 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • 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
  • M4 Documentation accuracy — Not applicable: the 25 current-state document(s) make no claim of a kind M4 checks. 205 claim(s) of kinds M4 does not check were not checked (path 190, environment variable 15); M4 checks only links and versions and artefact counts.
  • P12 CI test-gate honesty — no CI workflow found
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Swift source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — 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
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • 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.
  • X1 Async correctness — 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
  • X12 Unreachable branch — 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
  • X13 Undrained process stream — 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
  • X15 Unvalidated length from an untrusted reader — 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
  • X16 Unfloored truncation loop — 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
  • X17 Uncapped recursion over a caller-supplied document — 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
  • X18 Disposal-pattern correctness — 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
  • X19 Unrestored process-global state — 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
  • 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.
  • X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — 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
  • X23 Unguarded diagnostic materialisation — 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
  • X24 Document value interpolated into markup unescaped — 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
  • X25 Inert configuration knob — 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
  • X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. Swift's `Array`, `Dictionary` and `Set` are values: `for x in items` walks the copy taken when the loop starts, so a body that adds to or removes from `items` changes a different value, nothing is invalidated, and every original element is still visited. This repository's Swift names no Foundation mutable collection (`NSMutableArray` and kin), the one kind a Swift loop can walk by reference. Not a gap in the analyzer and not a finding about your code.
  • X29 Per-element action decided by a fixed element — 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
  • X30 Support guard that admits what it rejects — 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
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — 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
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — 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 — 1 finding(s)
D8 · Code Coverage · No automated tests · ×1
  • No automated tests — No automated tests — no test code was found in this repository. Untested code is the largest single risk to changing it safely. Start with the code you change most often: add a suite in a framework a runner can collect (XCTest or Swift Testing), and run it in CI so the gap cannot reopen.
Serious — 335 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×20
  • Hotspot: macUSB/Features/Analysis/SystemAnalysisView.swift macUSB/Features/Analysis/SystemAnalysisView.swift:366 — macUSB/Features/Analysis/SystemAnalysisView.swift changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in SystemAnalysisView.detectedOrUnsupportedView at line 366. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/SystemAnalysisView.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: macUSB/Features/Installation/UniversalInstallationView.swift macUSB/Features/Installation/UniversalInstallationView.swift:188 — macUSB/Features/Installation/UniversalInstallationView.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in UniversalInstallationView.body at line 188. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Installation/UniversalInstallationView.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: macUSB/App/macUSBApp.swift macUSB/App/macUSBApp.swift:71 — macUSB/App/macUSBApp.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in macUSBApp.body at line 71. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/App/macUSBApp.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: macUSB/Features/Installation/CreatorHelperLogic.swift macUSB/Features/Installation/CreatorHelperLogic.swift:32 — macUSB/Features/Installation/CreatorHelperLogic.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in UniversalInstallationView.startCreationProcessWithHelper 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Installation/CreatorHelperLogic.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: macUSB/Shared/Services/USBTargetDiscoveryService.swift macUSB/Shared/Services/USBTargetDiscoveryService.swift:6 — macUSB/Shared/Services/USBTargetDiscoveryService.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in USBTargetDiscoveryService.scan at line 6. 2 of those changes were fix/bug commits, and the other 2 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Shared/Services/USBTargetDiscoveryService.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: macUSB/Features/Finish/FinishUSBView.swift macUSB/Features/Finish/FinishUSBView.swift:175 — macUSB/Features/Finish/FinishUSBView.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in FinishUSBView.body at line 175. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Finish/FinishUSBView.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: macUSB/Features/Analysis/AnalysisLogic.swift macUSB/Features/Analysis/AnalysisLogic.swift:112 — macUSB/Features/Analysis/AnalysisLogic.swift changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AnalysisLogic.selectedDriveForInstallation at line 112. 1 of those changes was a fix/bug commit, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/AnalysisLogic.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: macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift:218 — macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in AnalysisLogic.checkCapacity at line 218. 1 of those changes was a fix/bug commit, and the other 12 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.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: macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in AnalysisLogic.applyMacosCompatibilityForMountedInstaller at line 5. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.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: macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift:4 — macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in MontereyDownloadFlowModel.runWorkflow at line 4. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.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: macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift:36 — macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in AnalysisLogic.startAnalysis at line 36. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.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: macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:88 — macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in SystemAnalysisUSBSectionView.body at line 88. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/SystemAnalysisUSBSectionView.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: macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift:85 — macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in AnalysisLogic.usbDiscoveryNotice at line 85. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.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: macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.swift macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.swift:120 — macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in MacOSCatalogService.fetchDownloadManifest at line 120. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.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: macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift:9 — macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in AnalysisLogic.confirmUSBTargetForHandoff 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.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: macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImageCreator.swift macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImageCreator.swift:4 — macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImageCreator.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in MontereyDownloadFlowModel.runDiskImageCreation at line 4. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImageCreator.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: macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:5 — macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in MacOSDownloaderWindowShellView.downloadSummaryView at line 5. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.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: macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift:12 — macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in USBDiscoveryVolumeCollector.collect at line 12. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Shared/Services/USBDiscoveryVolumeCollector.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: macUSB/Features/Finish/FinishUSBEjectLogic.swift macUSB/Features/Finish/FinishUSBEjectLogic.swift:65 — macUSB/Features/Finish/FinishUSBEjectLogic.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in FinishUSBEjectLogic.performEject at line 65. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Features/Finish/FinishUSBEjectLogic.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: macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift:17 — macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in USBDiscoveryRegistryProbe.media at line 17. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 20:56:13 +01:00' --until='2026-10-25 20:56:13 +01:00' --full-history --no-merges -- macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D3 · God Classes · MethodTooLong · ×19
  • MethodTooLong: UniversalInstallationView.body macUSB/Features/Installation/UniversalInstallationView.swift:188 — MethodTooLong — body runs 362 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 262 over it, 3.62× 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: UniversalInstallationView.startCreationProcessWithHelper macUSB/Features/Installation/CreatorHelperLogic.swift:32 — MethodTooLong — startCreationProcessWithHelper runs 309 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× 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: macUSBApp.body macUSB/App/macUSBApp.swift:71 — MethodTooLong — body runs 273 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 173 over it, 2.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AnalysisLogic.classifyLinuxDistribution macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:54 — MethodTooLong — classifyLinuxDistribution runs 200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× 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: FinishUSBView.body macUSB/Features/Finish/FinishUSBView.swift:175 — MethodTooLong — body runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AnalysisLogic.startAnalysis macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift:36 — MethodTooLong — startAnalysis runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× 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: USBTargetDiscoveryService.scan macUSB/Shared/Services/USBTargetDiscoveryService.swift:6 — MethodTooLong — scan runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× 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: HelperWorkflowExecutor.buildStages macUSBHelper/Workflow/HelperWorkflowStages.swift:191 — MethodTooLong — buildStages runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× 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: AnalysisLogic.applyMacosCompatibilityForMountedInstaller macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5 — MethodTooLong — applyMacosCompatibilityForMountedInstaller runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DownloaderAssemblyExecutor.runInstallerBasedOldestDiskImageAssemblyAndLocateApp macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:5 — MethodTooLong — runInstallerBasedOldestDiskImageAssemblyAndLocateApp runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× 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: HelperWorkflowExecutor.prepareWorkflowContext macUSBHelper/Workflow/HelperWorkflowStages.swift:26 — MethodTooLong — prepareWorkflowContext runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MontereyDownloadFlowModel.runDiskImageCreation macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImageCreator.swift:4 — MethodTooLong — runDiskImageCreation runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MontereyDownloadFlowModel.runWorkflow macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift:4 — MethodTooLong — runWorkflow runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SystemAnalysisView.detectedOrUnsupportedView macUSB/Features/Analysis/SystemAnalysisView.swift:366 — MethodTooLong — detectedOrUnsupportedView 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: SystemAnalysisUSBSectionView.body macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:88 — MethodTooLong — body runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AnalysisLogic.applyMacosCompatibilityForAppInstaller macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:183 — MethodTooLong — applyMacosCompatibilityForAppInstaller runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MacOSDownloaderWindowShellView.downloadSummaryView macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:5 — MethodTooLong — downloadSummaryView runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× 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: MontereyDownloadFlowModel.runLegacyAssemblyWithoutRoot macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:10 — MethodTooLong — runLegacyAssemblyWithoutRoot runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UniversalInstallationView.prepareHelperWorkflowRequest macUSB/Features/Installation/CreatorHelperLogic.swift:430 — MethodTooLong — prepareHelperWorkflowRequest runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×11
  • Duplicated block (5 lines × 2) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:44 — macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:44-48 | macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:51-55 — 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 `macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:501 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:501-505 | macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryDistributionParser.swift:34-38 — 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) macUSB/Features/Analysis/RawLinuxImage/RawLinuxImageSelectionCoordinator.swift:23 — macUSB/Features/Analysis/RawLinuxImage/RawLinuxImageSelectionCoordinator.swift:23-27 | macUSB/Shared/Services/AppTerminationCoordinator.swift:63-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 (5 lines × 2) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:218 — macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:218-222 | macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:232-236 — 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 `macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:218` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:47 — macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:47-51 | macUSB/Shared/Services/UpdateChecker.swift:44-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 `macUSB/Features/Welcome/WelcomeStartupUpdateChecker.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 (5 lines × 2) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:56 — macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:56-60 | macUSB/Shared/Services/UpdateChecker.swift:53-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.
  • Duplicated block (5 lines × 2) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootArtifact.swift:243 — macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootArtifact.swift:243-247 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootLayoutValidator.swift:62-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. 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) macUSB/Features/Finish/FinishUSBView.swift:783 — macUSB/Features/Finish/FinishUSBView.swift:783-787 | macUSB/Features/Installation/UniversalInstallationView.swift:672-676 — 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) macUSB/Shared/Services/Helper/HelperIPC.swift:309 — macUSB/Shared/Services/Helper/HelperIPC.swift:309-313 | macUSBHelper/IPC/HelperIPC.swift:236-240 — before extracting anything, compare `macUSB/Shared/Services/Helper/HelperIPC.swift` and `macUSBHelper/IPC/HelperIPC.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) macUSB/Shared/Services/Helper/HelperIPC.swift:315 — macUSB/Shared/Services/Helper/HelperIPC.swift:315-319 | macUSBHelper/IPC/HelperIPC.swift:242-246 — before extracting anything, compare `macUSB/Shared/Services/Helper/HelperIPC.swift` and `macUSBHelper/IPC/HelperIPC.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) macUSBHelper/DownloaderAssembly/DownloaderAssemblyExecutor.swift:14 — macUSBHelper/DownloaderAssembly/DownloaderAssemblyExecutor.swift:14-22 | macUSBHelper/Workflow/HelperWorkflowExecutor.swift:39-43 — 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 `request` to `DownloaderAssemblyRequestPayload` in one and `HelperWorkflowRequestPayload` 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×9
  • Swallowed exception (caught, then discarded) macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:63 — `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) macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:183 — `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) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:198 — `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) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:434 — `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) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:355 — `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) macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift:77 — `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) macUSB/Features/Installation/CreatorHelperLogic.swift:914 — `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) macUSB/Features/Installation/CreatorHelperLogic.swift:1082 — `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) macUSB/Features/Downloader/Logic/Download/MacOSDownloadRetry.swift:109 — `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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×8
  • Duplicated block (9 lines × 2) macUSB/Features/Analysis/AnalysisLogic.swift:445 — macUSB/Features/Analysis/AnalysisLogic.swift:445-453 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:366-374 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Analysis/AnalysisLogic.swift:445` 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) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:138 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:138-146 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:193-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 `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:138` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:180 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:180-188 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:217-229 — 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 `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.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. 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) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:253 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:253-261 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:322-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:348 — macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:348-356 | macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:368-376 — 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 `macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:348` 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) macUSB/Features/Installation/UniversalInstallationView.swift:412 — macUSB/Features/Installation/UniversalInstallationView.swift:412-420 | macUSB/Features/Installation/UniversalInstallationView.swift:523-531 — 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 `macUSB/Features/Installation/UniversalInstallationView.swift:412` 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) macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift:29 — macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift:29-37 | macUSB/Shared/Services/USBDriveLogic.swift:71-79 — 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 (9 lines × 2) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:17 — macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:17-25 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:54-62 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · TooManyMethods · ×7
  • TooManyMethods: AnalysisLogic macUSB/Features/Analysis/AnalysisLogic.swift:6 — TooManyMethods — 150 methods, declared across 30 files: Analysis/AnalysisLogic.swift (25), Logic/AnalysisLogicUsbDrives.swift (14), Linux/AnalysisLogicLinuxLifecycle.swift (12), Linux/AnalysisLogicLinuxMetadata.swift (12), +26 more file(s). The bar is 30 methods; this is 120 over it, 5.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: HelperWorkflowExecutor macUSBHelper/Workflow/HelperWorkflowExecutor.swift:5 — TooManyMethods — 130 methods, declared across 22 files: Windows/HelperWorkflowWindowsSourceLogic.swift (15), Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift (14), Windows/HelperWorkflowWindowsStages.swift (13), Workflow/HelperWorkflowFileOperations.swift (9), +18 more file(s). The bar is 30 methods; this is 100 over it, 4.33× 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: MontereyDownloadFlowModel macUSB/Features/Downloader/Logic/Download/MacOSDownloadState.swift:126 — TooManyMethods — 95 methods, declared across 16 files: Logic/MacOSVerificationLogic.swift (30), Assembly/MacOSAssemblyLegacyFlow.swift (14), Download/MacOSDownloadOrchestrator.swift (9), Assembly/MacOSAssemblyOrchestrator.swift (6), +12 more file(s). The bar is 30 methods; this is 65 over it, 3.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: UniversalInstallationView macUSB/Features/Installation/UniversalInstallationView.swift:4 — TooManyMethods — 88 methods, declared across 16 files: Installation/CreatorHelperLogic.swift (29), Installation/CreatorLogic.swift (17), macOS/CreatorMacOSRosettaLogic.swift (10), Installation/CreatorOperationActivity.swift (4), +12 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: HelperServiceManager macUSB/Shared/Services/Helper/HelperServiceManager.swift:6 — TooManyMethods — 75 methods, declared across 8 files: HelperService/HelperServiceDiagnostics.swift (17), HelperService/HelperServiceRepairUI.swift (15), HelperService/HelperServiceEnsureReadyFlow.swift (12), HelperService/HelperServiceRepairFlow.swift (12), +4 more file(s). The bar is 30 methods; this is 45 over it, 2.50× 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: MacOSDownloaderWindowShellView macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:5 — TooManyMethods — 58 methods, declared across 6 files: UI/MacOSDownloaderListView.swift (15), UI/MacOSDownloaderWindowShellView.swift (13), UI/MacOSDownloaderProcessView.swift (10), UI/MacOSDownloaderPrerequisiteAlerts.swift (9), +2 more file(s). The bar is 30 methods; this is 28 over it, 1.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: MacOSCatalogService macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryConstants.swift:3 — TooManyMethods — 48 methods, declared across 7 files: Discovery/MacOSDiscoverySizeProbe.swift (16), Discovery/MacOSDiscoveryCatalogParser.swift (13), Discovery/MacOSDiscoveryFiltering.swift (7), Discovery/MacOSDiscoveryLocalInstallers.swift (6), +3 more file(s). The bar is 30 methods; this is 18 over it, 1.60× 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.
D3 · God Classes · FileTooLong · ×6
  • FileTooLong: Installation/CreatorHelperLogic.swift macUSB/Features/Installation/CreatorHelperLogic.swift — FileTooLong — 831 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 331 over it, 1.66× 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: Finish/FinishUSBView.swift macUSB/Features/Finish/FinishUSBView.swift — FileTooLong — 602 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: FinishUSBView (5-778). The bar is 500 significant lines; this is 102 over it, 1.20× 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: DownloaderAssembly/DownloaderAssemblyProcess.swift macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift — FileTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 91 over it, 1.18× 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: Logic/MacOSVerificationLogic.swift macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift — FileTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 85 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Analysis/SystemAnalysisView.swift macUSB/Features/Analysis/SystemAnalysisView.swift — FileTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: SystemAnalysisView (16-772). The bar is 500 significant lines; this is 71 over it, 1.14× 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: Installation/UniversalInstallationView.swift macUSB/Features/Installation/UniversalInstallationView.swift — FileTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: UniversalInstallationView (4-666). The bar is 500 significant lines; this is 29 over it, 1.06× 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×6
  • Duplicated block (15 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:160 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:160-174 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:175-189 — 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 `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:72 — macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:72-86 | macUSB/Features/Analysis/SystemAnalysisView.swift:50-64 — 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 (15 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift:232 — macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift:232-246 | macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift:249-263 — 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 (15 lines × 2) macUSB/Features/Installation/CreatorHelperLogic.swift:464 — macUSB/Features/Installation/CreatorHelperLogic.swift:464-478 | macUSB/Features/Installation/CreatorHelperLogic.swift:495-509 — 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 `macUSB/Features/Installation/CreatorHelperLogic.swift:464` 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 × 2) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:15 — macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:15-29 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:16-30 — before extracting anything, compare `macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift` and `macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:15` 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) macUSB/Shared/Services/USBDriveLogic.swift:167 — macUSB/Shared/Services/USBDriveLogic.swift:167-181 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:14-28 — before extracting anything, compare `macUSB/Shared/Services/USBDriveLogic.swift` and `macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Shared/Services/USBDriveLogic.swift:167` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • Duplicated block (7 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:60 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:60-67 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:344-350 — 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 `macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:60` 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 × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:189 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:189-195 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:199-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:189` 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) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:37 — macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:37-43 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:40-46 — before extracting anything, compare `macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift` and `macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:37` 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 × 2) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:846 — macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:846-852 | macUSBHelper/Workflow/Linux/HelperWorkflowLinuxVerification.swift:122-128 — 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) macUSB/Features/Installation/CreatorHelperLogic.swift:564 — macUSB/Features/Installation/CreatorHelperLogic.swift:564-570 | macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:180-186 — 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) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:172 — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:172-178 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:200-206 — before extracting anything, compare `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift` and `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 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.
D35 · Change Coupling · Change coupling · ×5
  • Change coupling: MacOSCleanupLogic.swift ↔ MacOSDownloaderProcessView.swift macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:1 — `macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift` and `macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `821949fd` Add disk image output workflow; `9dcb08f0` Improve downloader localization coverage and disk-space messaging; `2d9f4e02` Refine downloader state messaging and discovery UI behavior — run `git show` on any of them.
  • Change coupling: MacOSCleanupLogic.swift ↔ MacOSDownloaderWindowShellView.swift macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:1 — `macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift` and `macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `c327767d` Align downloader text presentation; `9dcb08f0` Improve downloader localization coverage and disk-space messaging; `2d9f4e02` Refine downloader state messaging and discovery UI behavior — run `git show` on any of them.
  • Change coupling: AnalysisLogicUsbDrives.swift ↔ SystemAnalysisView.swift macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift:1 — `macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift` and `macUSB/Features/Analysis/SystemAnalysisView.swift` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `77ba029d` Bound USB discovery and balance IOKit references; `e5f96cba` Apply capacity rules to installer flows; `7f8f3a32` Use physical USB targets as the default picker source — run `git show` on any of them.
  • Change coupling: SystemAnalysisView.swift ↔ USBDriveLogic.swift macUSB/Features/Analysis/SystemAnalysisView.swift:1 — `macUSB/Features/Analysis/SystemAnalysisView.swift` and `macUSB/Shared/Services/USBDriveLogic.swift` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `77ba029d` Bound USB discovery and balance IOKit references; `466580d3` Make macOS Option target switching immediate; `24157cf6` Use physical targets for macOS USB preparation — run `git show` on any of them.
  • Change coupling: macUSBApp.swift ↔ WelcomeView.swift macUSB/App/macUSBApp.swift:1 — `macUSB/App/macUSBApp.swift` and `macUSB/Features/Welcome/WelcomeView.swift` change together 53% of the time (10 of the 19 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 10 shared commits counted here, the most recent 3 are `320be0c9` Confirm and guard automatic welcome screen navigation; `6fffa694` Add optional automatic welcome screen navigation; `282a2c7a` Lock language changes after workflow start — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:239 — macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:239-257 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:262-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) macUSB/Features/Installation/UniversalInstallationView.swift:501 — macUSB/Features/Installation/UniversalInstallationView.swift:501-519 | macUSB/Features/Installation/UniversalInstallationView.swift:536-554 — 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 `macUSB/Features/Installation/UniversalInstallationView.swift:501` 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 (19 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:15 — macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:15-33 | macUSB/Shared/Services/Helper/PrivilegedOperationClientRosetta.swift:20-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:15` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Result<Set<String>, Error>) -> Void` in one and `@escaping (Result<RosettaInstallationResultPayload, Error>) -> Void` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `macUSB/Shared/Services/Helper/PrivilegedOperationClientRosetta.swift:19` calls `finish` and `macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:14` 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 (19 lines × 2) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:648 — macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:648-666 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:728-746 — 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 `macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:728` 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 (19 lines × 2) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:123 — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:123-141 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:141-159 — before extracting anything, compare `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift` and `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 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 `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:123` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:126 — macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:126-137 | macUSB/Features/Analysis/SystemAnalysisView.swift:332-343 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:126` 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) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:45 — macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:45-56 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:103-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 `macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.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 (12 lines × 2) macUSB/Features/Installation/CreationProgressView.swift:125 — macUSB/Features/Installation/CreationProgressView.swift:125-136 | macUSB/Features/Installation/UniversalInstallationView.swift:199-210 — 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 `macUSB/Features/Installation/CreationProgressView.swift:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift:292 — macUSB/Shared/Services/USBDriveLogic.swift:292-303 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:144-155 — before extracting anything, compare `macUSB/Shared/Services/USBDriveLogic.swift` and `macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Shared/Services/USBDriveLogic.swift:292` 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 (12 lines × 2) macUSBHelper/Service/PrivilegedHelperService.swift:18 — macUSBHelper/Service/PrivilegedHelperService.swift:18-29 | macUSBHelper/Service/PrivilegedHelperService.swift:92-103 — 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 `macUSBHelper/Service/PrivilegedHelperService.swift:18` 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:5 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:5-15 | macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:185-195 — 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 `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:5` 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) macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:101 — macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:101-111 | macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:117-127 — 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 `macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:101` 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) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:352 — macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:352-362 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:366-376 — 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 `macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:352` 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) macUSB/Features/Installation/UniversalInstallationView.swift:469 — macUSB/Features/Installation/UniversalInstallationView.swift:469-479 | macUSB/Features/Installation/UniversalInstallationView.swift:491-501 — 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 `macUSB/Features/Installation/UniversalInstallationView.swift:469` 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, `macUSB/Features/Installation/UniversalInstallationView.swift:480` calls `ProgressView`, `controlSize` and `macUSB/Features/Installation/UniversalInstallationView.swift:502` 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) macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:101 — macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:101-111 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:191-201 — 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 `macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:101` 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.
D3 · God Classes · ClassTooLong · ×4
  • ClassTooLong: FinishUSBView macUSB/Features/Finish/FinishUSBView.swift:5 — ClassTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 188 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: SystemAnalysisView macUSB/Features/Analysis/SystemAnalysisView.swift:16 — ClassTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 156 over it, 1.39× 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: UniversalInstallationView macUSB/Features/Installation/UniversalInstallationView.swift:4 — ClassTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded), 88 methods. The bar is 400 significant lines; this is 116 over it, 1.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: PrivilegedOperationClient macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:3 — ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 23 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (4 members, 50+ identical tokens) macUSB/Features/Analysis/AnalysisLogic.swift:381 — macUSB/Features/Analysis/AnalysisLogic.swift:381-430 | macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:6-36 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:327-351 | macUSB/Shared/Services/InstallerSourceImageUnmountRegistry.swift:64-172 — 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) macUSB/Features/Analysis/AnalysisLogic.swift:432 — macUSB/Features/Analysis/AnalysisLogic.swift:432-480 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:353-418 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:141-188 | macUSB/Shared/Services/InstallerSourceImageUnmountRegistry.swift:204-278 — 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) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:41 — macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:41-56 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:58-71 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:73-97 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:99-114 — 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) macUSB/Features/Installation/CreatorHelperLogic.swift:903 — macUSB/Features/Installation/CreatorHelperLogic.swift:903-932 | macUSB/Features/Installation/CreatorHelperLogic.swift:1066-1123 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:52-74 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:173-200 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:48 — macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:48-64 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:49-65 — before extracting anything, compare `macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift` and `macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.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 (17 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:45 — macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:45-61 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:167-183 — 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 `macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:45` 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 (17 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:65 — macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:65-81 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:184-200 — 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 `macUSB/Shared/Services/Helper/PrivilegedOperationClient.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:64` calls `unlock` and `macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:183` 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 (17 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:88 — macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:88-104 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:203-219 — 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 `macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:224 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:224-236 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicRawLinuxImageLifecycle.swift:37-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
  • Duplicated block (13 lines × 2) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift:41 — macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift:41-53 | macUSB/Features/Finish/FinishUSBView.swift:56-68 — 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 `macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift:41` 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) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:192 — macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:192-204 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:284-296 — 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 `macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:192` 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 (13 lines × 2) macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:269 — macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:269-281 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:416-428 — 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 `macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:269` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift:236 — macUSB/Shared/Services/USBDriveLogic.swift:236-251 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:116-132 — before extracting anything, compare `macUSB/Shared/Services/USBDriveLogic.swift` and `macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Shared/Services/USBDriveLogic.swift:236` 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 (16–17 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift:259 — macUSB/Shared/Services/USBDriveLogic.swift:259-274 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:81-97 — before extracting anything, compare `macUSB/Shared/Services/USBDriveLogic.swift` and `macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Shared/Services/USBDriveLogic.swift:259` 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 (16–17 lines × 2) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:160 — macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:160-175 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:339-355 — 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 `macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) macUSB/Features/Installation/CreatorHelperLogic.swift:248 — macUSB/Features/Installation/CreatorHelperLogic.swift:248-263 | macUSB/Features/Installation/CreatorHelperLogic.swift:275-290 — 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 `macUSB/Features/Installation/CreatorHelperLogic.swift:248` 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) macUSB/Features/Installation/CreatorHelperLogic.swift:1076 — macUSB/Features/Installation/CreatorHelperLogic.swift:1076-1091 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:57-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16 lines × 2) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift:91 — macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift:91-106 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift:127-142 — 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 `macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×3
  • Duplicated block (8 lines × 2) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:222 — macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:222-229 | macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:238-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:321 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:321-328 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:341-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:242 — macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:242-249 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:385-392 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×2
  • Duplicated block (47 lines × 2) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:61 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:61-107 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:216-262 — 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 (47 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:79 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:79-125 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:128-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. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:79` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:39 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:39-69 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:154-184 — 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 `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:39` 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 (31 lines × 2) macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:72 — macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:72-102 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:418-448 — 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 `macUSBHelper/Workflow/HelperWorkflowFileOperations.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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) macUSB/Shared/Services/Helper/HelperIPC.swift:30 — macUSB/Shared/Services/Helper/HelperIPC.swift:30-54 | macUSBHelper/IPC/HelperIPC.swift:30-54 — before extracting anything, compare `macUSB/Shared/Services/Helper/HelperIPC.swift` and `macUSBHelper/IPC/HelperIPC.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 114 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 × 2) macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift:32 — macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift:32-56 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:400-424 — 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, `macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift:58` calls `runWhichExecutable` and `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:426` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) macUSB/Features/Installation/CreationProgressView.swift:365 — macUSB/Features/Installation/CreationProgressView.swift:365-388 | macUSB/Features/Installation/CreationProgressView.swift:395-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Installation/CreationProgressView.swift:365` 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 (24 lines × 2) macUSBHelper/Workflow/HelperWorkflowStages.swift:229 — macUSBHelper/Workflow/HelperWorkflowStages.swift:229-252 | macUSBHelper/Workflow/HelperWorkflowStages.swift:255-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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) macUSB/Features/Installation/Windows/CreationProgressWindowsMapping.swift:37 — macUSB/Features/Installation/Windows/CreationProgressWindowsMapping.swift:37-57 | macUSB/Features/Installation/Windows/CreationProgressWindowsMapping.swift:60-80 — 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 (21 lines × 2) macUSB/Shared/UI/LiquidGlassCompatibility.swift:36 — macUSB/Shared/UI/LiquidGlassCompatibility.swift:36-56 | macUSB/Shared/UI/LiquidGlassCompatibility.swift:59-79 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:47 — macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:47-60 | macUSB/Shared/Services/Helper/PrivilegedOperationClientRosetta.swift:41-55 — 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 `macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.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. 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 (14 lines × 2) macUSB/Shared/Services/Helper/HelperIPC.swift:70 — macUSB/Shared/Services/Helper/HelperIPC.swift:70-83 | macUSBHelper/IPC/HelperIPC.swift:70-83 — before extracting anything, compare `macUSB/Shared/Services/Helper/HelperIPC.swift` and `macUSBHelper/IPC/HelperIPC.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:401 — macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:401-412 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:417-429 — 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–13 lines × 2) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:124 — macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:124-135 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:311-323 — 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, `macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:307` calls `removeItem` and `macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:122` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×2
  • Duplicated block (12 lines × 3) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:160 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:160-171 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:175-186 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:190-201 — 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 `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 3) macUSB/Features/Finish/FinishUSBView.swift:57 — macUSB/Features/Finish/FinishUSBView.swift:57-68 | macUSB/Shared/Services/Helper/HelperIPC.swift:127-138 | macUSBHelper/IPC/HelperIPC.swift:127-138 — before extracting anything, compare `macUSB/Shared/Services/Helper/HelperIPC.swift` and `macUSBHelper/IPC/HelperIPC.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 114 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 `macUSB/Features/Finish/FinishUSBView.swift:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift:26 — macUSB/Shared/Services/USBDriveLogic.swift:26-35 | macUSB/Shared/Services/USBDriveLogic.swift:58-68 — 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 `macUSB/Shared/Services/USBDriveLogic.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10–11 lines × 2) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:24 — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:24-33 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:19-29 — before extracting anything, compare `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift` and `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 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 `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) macUSB/Features/Analysis/AnalysisLogic.swift:399 — macUSB/Features/Analysis/AnalysisLogic.swift:399-408 | macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:10-19 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:328-337 | macUSB/Shared/Services/InstallerSourceImageUnmountRegistry.swift:124-133 — 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 `macUSB/Features/Analysis/AnalysisLogic.swift:399` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:159 — macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:159-168 | macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:231-240 | macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:256-265 | macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:305-314 — 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 `macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping EnsureCompletion` in one and `@escaping (Bool, String?) -> Void` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:23 — macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:23-31 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:262-269 — 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 `macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:23` 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–9 lines × 2) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsTargetResolution.swift:138 — macUSBHelper/Workflow/Windows/HelperWorkflowWindowsTargetResolution.swift:138-146 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsTargetResolution.swift:170-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) macUSB/Features/Analysis/AnalysisLogic.swift:459 — macUSB/Features/Analysis/AnalysisLogic.swift:459-465 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:380-386 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:168-174 — 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 `macUSB/Features/Analysis/AnalysisLogic.swift:459` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:19 — macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:19-25 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:56-62 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsWimSplitProgressParsing.swift:8-14 — 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 `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:19` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:95 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:95-100 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:121-126 — 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 `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:95` 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, `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:101` calls `contains` and `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:127` 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) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:176 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:176-181 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:329-334 — 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 `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:176` 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.
D1 · Cyclomatic Complexity · AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cyclomatic 84) · ×1
  • AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cyclomatic 84) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5 — AnalysisLogic.applyMacosCompatibilityForMountedInstaller has cyclomatic complexity 84 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · USBTargetDiscoveryService.scan (cyclomatic 80) · ×1
  • USBTargetDiscoveryService.scan (cyclomatic 80) macUSB/Shared/Services/USBTargetDiscoveryService.swift:6 — USBTargetDiscoveryService.scan has cyclomatic complexity 80 (threshold 15). Of this number, 73 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.applyMacosCompatibilityForAppInstaller (cyclomatic 78) · ×1
  • AnalysisLogic.applyMacosCompatibilityForAppInstaller (cyclomatic 78) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:183 — AnalysisLogic.applyMacosCompatibilityForAppInstaller has cyclomatic complexity 78 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AnalysisLogic.classifyLinuxDistribution (cyclomatic 67) · ×1
  • AnalysisLogic.classifyLinuxDistribution (cyclomatic 67) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:54 — AnalysisLogic.classifyLinuxDistribution has cyclomatic complexity 67 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SystemAnalysisView.detectedOrUnsupportedView (cyclomatic 50) · ×1
  • SystemAnalysisView.detectedOrUnsupportedView (cyclomatic 50) macUSB/Features/Analysis/SystemAnalysisView.swift:366 — SystemAnalysisView.detectedOrUnsupportedView has cyclomatic complexity 50 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UniversalInstallationView.body (cyclomatic 48) · ×1
  • UniversalInstallationView.body (cyclomatic 48) macUSB/Features/Installation/UniversalInstallationView.swift:188 — UniversalInstallationView.body has cyclomatic complexity 48 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UniversalInstallationView.startCreationProcessWithHelper (cyclomatic 48) · ×1
  • UniversalInstallationView.startCreationProcessWithHelper (cyclomatic 48) macUSB/Features/Installation/CreatorHelperLogic.swift:32 — UniversalInstallationView.startCreationProcessWithHelper has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.classifyWindowsServerFamily (cyclomatic 40) · ×1
  • AnalysisLogic.classifyWindowsServerFamily (cyclomatic 40) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:126 — AnalysisLogic.classifyWindowsServerFamily has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.confirmUSBTargetForHandoff (cyclomatic 38) · ×1
  • AnalysisLogic.confirmUSBTargetForHandoff (cyclomatic 38) macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift:9 — AnalysisLogic.confirmUSBTargetForHandoff has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · USBDiscoveryProcessRunner.runReport (cyclomatic 38) · ×1
  • USBDiscoveryProcessRunner.runReport (cyclomatic 38) macUSB/Shared/Services/USBDiscoveryProcessRunner.swift:118 — USBDiscoveryProcessRunner.runReport has cyclomatic complexity 38 (threshold 15). Of this number, 36 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.startAnalysis (cyclomatic 32) · ×1
  • AnalysisLogic.startAnalysis (cyclomatic 32) macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift:36 — AnalysisLogic.startAnalysis has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FinishUSBView.body (cyclomatic 31) · ×1
  • FinishUSBView.body (cyclomatic 31) macUSB/Features/Finish/FinishUSBView.swift:175 — FinishUSBView.body has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · USBDiscoveryVolumeCollector.collect (cyclomatic 30) · ×1
  • USBDiscoveryVolumeCollector.collect (cyclomatic 30) macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift:12 — USBDiscoveryVolumeCollector.collect has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · macUSBApp.body (cyclomatic 29) · ×1
  • macUSBApp.body (cyclomatic 29) macUSB/App/macUSBApp.swift:71 — macUSBApp.body has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AnalysisLogic.classifyWindowsFamily (cyclomatic 26) · ×1
  • AnalysisLogic.classifyWindowsFamily (cyclomatic 26) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:62 — AnalysisLogic.classifyWindowsFamily has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AnalysisLogic.mountAndReadInfo (cyclomatic 26) · ×1
  • AnalysisLogic.mountAndReadInfo (cyclomatic 26) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:190 — AnalysisLogic.mountAndReadInfo has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MontereyDownloadFlowModel.runWorkflow (cyclomatic 26) · ×1
  • MontereyDownloadFlowModel.runWorkflow (cyclomatic 26) macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift:4 — MontereyDownloadFlowModel.runWorkflow has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.prepareWorkflowContext (cyclomatic 23) · ×1
  • HelperWorkflowExecutor.prepareWorkflowContext (cyclomatic 23) macUSBHelper/Workflow/HelperWorkflowStages.swift:26 — HelperWorkflowExecutor.prepareWorkflowContext has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MontereyDownloadFlowModel.runDiskImageCreation (cyclomatic 23) · ×1
  • MontereyDownloadFlowModel.runDiskImageCreation (cyclomatic 23) macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImageCreator.swift:4 — MontereyDownloadFlowModel.runDiskImageCreation has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.runStage (cyclomatic 21) · ×1
  • HelperWorkflowExecutor.runStage (cyclomatic 21) macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:5 — HelperWorkflowExecutor.runStage has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AnalysisLogic.usbDiscoveryNotice (cyclomatic 21) · ×1
  • AnalysisLogic.usbDiscoveryNotice (cyclomatic 21) macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift:85 — AnalysisLogic.usbDiscoveryNotice has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AnalysisLogic.readWindowsMetadata (cyclomatic 21) · ×1
  • AnalysisLogic.readWindowsMetadata (cyclomatic 21) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsMetadata.swift:4 — AnalysisLogic.readWindowsMetadata has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MacOSDownloaderWindowShellView.downloadSummaryView (cyclomatic 21) · ×1
  • MacOSDownloaderWindowShellView.downloadSummaryView (cyclomatic 21) macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:5 — MacOSDownloaderWindowShellView.downloadSummaryView has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HelperWorkflowWindowsMacUSBootArtifactLoader.validateManifest (cyclomatic 21) · ×1
  • HelperWorkflowWindowsMacUSBootArtifactLoader.validateManifest (cyclomatic 21) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootArtifact.swift:149 — HelperWorkflowWindowsMacUSBootArtifactLoader.validateManifest has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.buildStages (cyclomatic 20) · ×1
  • HelperWorkflowExecutor.buildStages (cyclomatic 20) macUSBHelper/Workflow/HelperWorkflowStages.swift:191 — HelperWorkflowExecutor.buildStages has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.checkCapacity (cyclomatic 20) · ×1
  • AnalysisLogic.checkCapacity (cyclomatic 20) macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift:218 — AnalysisLogic.checkCapacity has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AnalysisLogic.formatMarketingVersion (cyclomatic 20) · ×1
  • AnalysisLogic.formatMarketingVersion (cyclomatic 20) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSInstallerMetadata.swift:10 — AnalysisLogic.formatMarketingVersion has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SystemAnalysisView.updateMenuState (cyclomatic 20) · ×1
  • SystemAnalysisView.updateMenuState (cyclomatic 20) macUSB/Features/Analysis/SystemAnalysisView.swift:66 — SystemAnalysisView.updateMenuState has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MacOSCatalogService.fetchDownloadManifest (cyclomatic 20) · ×1
  • MacOSCatalogService.fetchDownloadManifest (cyclomatic 20) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.swift:120 — MacOSCatalogService.fetchDownloadManifest has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.parseWindowsLegacyRsyncFilePathLine (cyclomatic 19) · ×1
  • HelperWorkflowExecutor.parseWindowsLegacyRsyncFilePathLine (cyclomatic 19) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:93 — HelperWorkflowExecutor.parseWindowsLegacyRsyncFilePathLine has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SystemAnalysisUSBSectionView.body (cyclomatic 19) · ×1
  • SystemAnalysisUSBSectionView.body (cyclomatic 19) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:88 — SystemAnalysisUSBSectionView.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.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.run (cyclomatic 18) · ×1
  • HelperWorkflowExecutor.run (cyclomatic 18) macUSBHelper/Workflow/HelperWorkflowExecutor.swift:63 — HelperWorkflowExecutor.run has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.buildWindowsAutounattendXMLData (cyclomatic 18) · ×1
  • HelperWorkflowExecutor.buildWindowsAutounattendXMLData (cyclomatic 18) macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:91 — HelperWorkflowExecutor.buildWindowsAutounattendXMLData has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.normalizeLinuxArchitecture (cyclomatic 18) · ×1
  • AnalysisLogic.normalizeLinuxArchitecture (cyclomatic 18) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchitecture.swift:10 — AnalysisLogic.normalizeLinuxArchitecture has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · USBDriveLogic.detectUSBSpeed (cyclomatic 18) · ×1
  • USBDriveLogic.detectUSBSpeed (cyclomatic 18) macUSB/Shared/Services/USBDriveLogic.swift:56 — USBDriveLogic.detectUSBSpeed has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.validatedWindowsTargetVolume (cyclomatic 17) · ×1
  • HelperWorkflowExecutor.validatedWindowsTargetVolume (cyclomatic 17) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsTargetResolution.swift:160 — HelperWorkflowExecutor.validatedWindowsTargetVolume has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AnalysisLogic.readLinuxMetadata (cyclomatic 17) · ×1
  • AnalysisLogic.readLinuxMetadata (cyclomatic 17) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxMetadata.swift:45 — AnalysisLogic.readLinuxMetadata has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FinishUSBEjectLogic.performEject (cyclomatic 17) · ×1
  • FinishUSBEjectLogic.performEject (cyclomatic 17) macUSB/Features/Finish/FinishUSBEjectLogic.swift:65 — FinishUSBEjectLogic.performEject has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WelcomeStartupUpdateChecker.check (cyclomatic 17) · ×1
  • WelcomeStartupUpdateChecker.check (cyclomatic 17) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:13 — WelcomeStartupUpdateChecker.check has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · USBDiscoveryRegistryProbe.media (cyclomatic 17) · ×1
  • USBDiscoveryRegistryProbe.media (cyclomatic 17) macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift:17 — USBDiscoveryRegistryProbe.media has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperWorkflowWindowsMacUSBootLayoutValidator.validate (cyclomatic 17) · ×1
  • HelperWorkflowWindowsMacUSBootLayoutValidator.validate (cyclomatic 17) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootLayoutValidator.swift:7 — HelperWorkflowWindowsMacUSBootLayoutValidator.validate has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.parseRsyncProgressTokenToBytes (cyclomatic 16) · ×1
  • HelperWorkflowExecutor.parseRsyncProgressTokenToBytes (cyclomatic 16) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:126 — HelperWorkflowExecutor.parseRsyncProgressTokenToBytes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · HelperWorkflowExecutor.windowsTargetPartitionStates (cyclomatic 16) · ×1
  • HelperWorkflowExecutor.windowsTargetPartitionStates (cyclomatic 16) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsTargetResolution.swift:126 — HelperWorkflowExecutor.windowsTargetPartitionStates has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AnalysisLogic.selectedDriveForInstallation (cyclomatic 16) · ×1
  • AnalysisLogic.selectedDriveForInstallation (cyclomatic 16) macUSB/Features/Analysis/AnalysisLogic.swift:112 — AnalysisLogic.selectedDriveForInstallation has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AnalysisLogic.indexLinuxArchive (cyclomatic 16) · ×1
  • AnalysisLogic.indexLinuxArchive (cyclomatic 16) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:4 — AnalysisLogic.indexLinuxArchive has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.linuxAttachSessionForImagePath (cyclomatic 16) · ×1
  • AnalysisLogic.linuxAttachSessionForImagePath (cyclomatic 16) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:353 — AnalysisLogic.linuxAttachSessionForImagePath has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisLogic.extractWindowsServicePack (cyclomatic 16) · ×1
  • AnalysisLogic.extractWindowsServicePack (cyclomatic 16) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:218 — AnalysisLogic.extractWindowsServicePack has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MontereyDownloadFlowModel.verifyIntegrityDataChunklistIfAvailable (cyclomatic 16) · ×1
  • MontereyDownloadFlowModel.verifyIntegrityDataChunklistIfAvailable (cyclomatic 16) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:518 — MontereyDownloadFlowModel.verifyIntegrityDataChunklistIfAvailable has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · USBTargetDiscoveryService.scan (cognitive 118) · ×1
  • USBTargetDiscoveryService.scan (cognitive 118) macUSB/Shared/Services/USBTargetDiscoveryService.swift:6 — USBTargetDiscoveryService.scan has cognitive complexity 118 (threshold 15). Drivers by points: if/else 27 (57 pts), boolean chains 28, ternaries 10 (20 pts), loops 5 (7 pts), match/switch 3 (4 pts), error handling 1 (2 pts) (nesting depth added 44). Of this number, 105 points are the body's own statements and 13 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cognitive 92) · ×1
  • AnalysisLogic.applyMacosCompatibilityForMountedInstaller (cognitive 92) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5 — AnalysisLogic.applyMacosCompatibilityForMountedInstaller has cognitive complexity 92 (threshold 15). Drivers by points: boolean chains 56, if/else 23 (27 pts), ternaries 9 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · UniversalInstallationView.startCreationProcessWithHelper (cognitive 91) · ×1
  • UniversalInstallationView.startCreationProcessWithHelper (cognitive 91) macUSB/Features/Installation/CreatorHelperLogic.swift:32 — UniversalInstallationView.startCreationProcessWithHelper has cognitive complexity 91 (threshold 15). Drivers by points: if/else 35 (63 pts), ternaries 5 (17 pts), boolean chains 9, error handling 2 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.applyMacosCompatibilityForAppInstaller (cognitive 80) · ×1
  • AnalysisLogic.applyMacosCompatibilityForAppInstaller (cognitive 80) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:183 — AnalysisLogic.applyMacosCompatibilityForAppInstaller has cognitive complexity 80 (threshold 15). Drivers by points: boolean chains 56, if/else 12 (13 pts), ternaries 10 (11 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AnalysisLogic.startAnalysis (cognitive 78) · ×1
  • AnalysisLogic.startAnalysis (cognitive 78) macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift:36 — AnalysisLogic.startAnalysis has cognitive complexity 78 (threshold 15). Drivers by points: if/else 28 (71 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnalysisLogic.classifyLinuxDistribution (cognitive 77) · ×1
  • AnalysisLogic.classifyLinuxDistribution (cognitive 77) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:54 — AnalysisLogic.classifyLinuxDistribution has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 39, ternaries 11 (22 pts), if/else 16 (nesting depth added 11). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · USBDiscoveryProcessRunner.runReport (cognitive 63) · ×1
  • USBDiscoveryProcessRunner.runReport (cognitive 63) macUSB/Shared/Services/USBDiscoveryProcessRunner.swift:118 — USBDiscoveryProcessRunner.runReport has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 5 (14 pts), boolean chains 11, loops 2 (3 pts), error handling 1 (nesting depth added 26). Of this number, 61 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemAnalysisView.detectedOrUnsupportedView (cognitive 60) · ×1
  • SystemAnalysisView.detectedOrUnsupportedView (cognitive 60) macUSB/Features/Analysis/SystemAnalysisView.swift:366 — SystemAnalysisView.detectedOrUnsupportedView has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 17 (23 pts), boolean chains 19, if/else 15 (18 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · UniversalInstallationView.body (cognitive 60) · ×1
  • UniversalInstallationView.body (cognitive 60) macUSB/Features/Installation/UniversalInstallationView.swift:188 — UniversalInstallationView.body has cognitive complexity 60 (threshold 15). Drivers by points: if/else 33 (40 pts), boolean chains 13, ternaries 4 (7 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AnalysisLogic.mountAndReadInfo (cognitive 59) · ×1
  • AnalysisLogic.mountAndReadInfo (cognitive 59) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:190 — AnalysisLogic.mountAndReadInfo has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (47 pts), loops 2 (6 pts), boolean chains 5, error handling 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · macUSBApp.body (cognitive 53) · ×1
  • macUSBApp.body (cognitive 53) macUSB/App/macUSBApp.swift:71 — macUSBApp.body has cognitive complexity 53 (threshold 15). Drivers by points: if/else 47 (51 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AnalysisLogic.confirmUSBTargetForHandoff (cognitive 50) · ×1
  • AnalysisLogic.confirmUSBTargetForHandoff (cognitive 50) macUSB/Features/Analysis/Logic/AnalysisLogicUSBAdmission.swift:9 — AnalysisLogic.confirmUSBTargetForHandoff has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 14, ternaries 4 (10 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FinishUSBView.body (cognitive 50) · ×1
  • FinishUSBView.body (cognitive 50) macUSB/Features/Finish/FinishUSBView.swift:175 — FinishUSBView.body has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (32 pts), ternaries 5 (10 pts), boolean chains 8 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.classifyWindowsServerFamily (cognitive 47) · ×1
  • AnalysisLogic.classifyWindowsServerFamily (cognitive 47) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:126 — AnalysisLogic.classifyWindowsServerFamily has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 22 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · USBDiscoveryVolumeCollector.collect (cognitive 45) · ×1
  • USBDiscoveryVolumeCollector.collect (cognitive 45) macUSB/Shared/Services/USBDiscoveryVolumeCollector.swift:12 — USBDiscoveryVolumeCollector.collect has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 11, ternaries 3 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · USBDriveLogic.detectUSBSpeed (cognitive 45) · ×1
  • USBDriveLogic.detectUSBSpeed (cognitive 45) macUSB/Shared/Services/USBDriveLogic.swift:56 — USBDriveLogic.detectUSBSpeed has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (41 pts), boolean chains 3, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MontereyDownloadFlowModel.runWorkflow (cognitive 45) · ×1
  • MontereyDownloadFlowModel.runWorkflow (cognitive 45) macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift:4 — MontereyDownloadFlowModel.runWorkflow has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 8 (15 pts), boolean chains 4, match/switch 1 (2 pts), ternaries 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MontereyDownloadFlowModel.runDiskImageCreation (cognitive 37) · ×1
  • MontereyDownloadFlowModel.runDiskImageCreation (cognitive 37) macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImageCreator.swift:4 — MontereyDownloadFlowModel.runDiskImageCreation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, error handling 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.run (cognitive 34) · ×1
  • HelperWorkflowExecutor.run (cognitive 34) macUSBHelper/Workflow/HelperWorkflowExecutor.swift:63 — HelperWorkflowExecutor.run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 3 (6 pts), error handling 4, loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemAnalysisUSBSectionView.body (cognitive 34) · ×1
  • SystemAnalysisUSBSectionView.body (cognitive 34) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:88 — SystemAnalysisUSBSectionView.body has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.prepareWorkflowContext (cognitive 28) · ×1
  • HelperWorkflowExecutor.prepareWorkflowContext (cognitive 28) macUSBHelper/Workflow/HelperWorkflowStages.swift:26 — HelperWorkflowExecutor.prepareWorkflowContext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 7, ternaries 1 (2 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.
D2 · Cognitive Complexity · AnalysisLogic.classifyWindowsFamily (cognitive 27) · ×1
  • AnalysisLogic.classifyWindowsFamily (cognitive 27) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:62 — AnalysisLogic.classifyWindowsFamily has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 9 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AppLogging.startSession (cognitive 27) · ×1
  • AppLogging.startSession (cognitive 27) macUSB/Shared/Services/Logging.swift:54 — AppLogging.startSession has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.extractAPFSPhysicalStoreWholeDisk (cognitive 26) · ×1
  • HelperWorkflowExecutor.extractAPFSPhysicalStoreWholeDisk (cognitive 26) macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:98 — HelperWorkflowExecutor.extractAPFSPhysicalStoreWholeDisk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.buildStages (cognitive 26) · ×1
  • HelperWorkflowExecutor.buildStages (cognitive 26) macUSBHelper/Workflow/HelperWorkflowStages.swift:191 — HelperWorkflowExecutor.buildStages has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.normalizeLinuxArchitecture (cognitive 26) · ×1
  • AnalysisLogic.normalizeLinuxArchitecture (cognitive 26) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchitecture.swift:10 — AnalysisLogic.normalizeLinuxArchitecture has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · USBDriveLogic.extractAPFSPhysicalStoreWholeDisk (cognitive 26) · ×1
  • USBDriveLogic.extractAPFSPhysicalStoreWholeDisk (cognitive 26) macUSB/Shared/Services/USBDriveLogic.swift:218 — USBDriveLogic.extractAPFSPhysicalStoreWholeDisk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.runStage (cognitive 25) · ×1
  • HelperWorkflowExecutor.runStage (cognitive 25) macUSBHelper/Workflow/HelperWorkflowFileOperations.swift:5 — HelperWorkflowExecutor.runStage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AnalysisLogic.linuxAttachSessionForImagePath (cognitive 25) · ×1
  • AnalysisLogic.linuxAttachSessionForImagePath (cognitive 25) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:353 — AnalysisLogic.linuxAttachSessionForImagePath has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WelcomeStartupUpdateChecker.check (cognitive 24) · ×1
  • WelcomeStartupUpdateChecker.check (cognitive 24) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:13 — WelcomeStartupUpdateChecker.check has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 10, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.runWindowsPrepareTargetStage (cognitive 23) · ×1
  • HelperWorkflowExecutor.runWindowsPrepareTargetStage (cognitive 23) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:13 — HelperWorkflowExecutor.runWindowsPrepareTargetStage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.indexLinuxArchive (cognitive 23) · ×1
  • AnalysisLogic.indexLinuxArchive (cognitive 23) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:4 — AnalysisLogic.indexLinuxArchive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstallerSourceImageUnmountRegistry.collectDetachTargetsForTrackedPaths (cognitive 23) · ×1
  • InstallerSourceImageUnmountRegistry.collectDetachTargetsForTrackedPaths (cognitive 23) macUSB/Shared/Services/InstallerSourceImageUnmountRegistry.swift:204 — InstallerSourceImageUnmountRegistry.collectDetachTargetsForTrackedPaths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacOSDownloaderWindowShellView.downloadSummaryView (cognitive 23) · ×1
  • MacOSDownloaderWindowShellView.downloadSummaryView (cognitive 23) macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift:5 — MacOSDownloaderWindowShellView.downloadSummaryView has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 6 (7 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MacOSCatalogService.fetchDownloadManifest (cognitive 22) · ×1
  • MacOSCatalogService.fetchDownloadManifest (cognitive 22) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryCatalogParser.swift:120 — MacOSCatalogService.fetchDownloadManifest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HelperWorkflowExecutor.resolvePartitionTargetWholeDisk (cognitive 21) · ×1
  • HelperWorkflowExecutor.resolvePartitionTargetWholeDisk (cognitive 21) macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:4 — HelperWorkflowExecutor.resolvePartitionTargetWholeDisk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.extractWindowsServicePack (cognitive 21) · ×1
  • AnalysisLogic.extractWindowsServicePack (cognitive 21) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:218 — AnalysisLogic.extractWindowsServicePack has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · USBDiscoveryRegistryProbe.media (cognitive 21) · ×1
  • USBDiscoveryRegistryProbe.media (cognitive 21) macUSB/Shared/Services/USBDiscoveryRegistryProbe.swift:17 — USBDiscoveryRegistryProbe.media has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, match/switch 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · USBDriveLogic.resolveFormattingWholeDiskBSDName (cognitive 21) · ×1
  • USBDriveLogic.resolveFormattingWholeDiskBSDName (cognitive 21) macUSB/Shared/Services/USBDriveLogic.swift:161 — USBDriveLogic.resolveFormattingWholeDiskBSDName has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MontereyDownloadFlowModel.runFileVerification (cognitive 21) · ×1
  • MontereyDownloadFlowModel.runFileVerification (cognitive 21) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:23 — MontereyDownloadFlowModel.runFileVerification has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.buildWindowsAutounattendXMLData (cognitive 20) · ×1
  • HelperWorkflowExecutor.buildWindowsAutounattendXMLData (cognitive 20) macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:91 — HelperWorkflowExecutor.buildWindowsAutounattendXMLData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.selectedDriveForInstallation (cognitive 20) · ×1
  • AnalysisLogic.selectedDriveForInstallation (cognitive 20) macUSB/Features/Analysis/AnalysisLogic.swift:112 — AnalysisLogic.selectedDriveForInstallation has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (10 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AnalysisLogic.usbDiscoveryNotice (cognitive 20) · ×1
  • AnalysisLogic.usbDiscoveryNotice (cognitive 20) macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift:85 — AnalysisLogic.usbDiscoveryNotice has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 13, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AnalysisLogic.checkCapacity (cognitive 20) · ×1
  • AnalysisLogic.checkCapacity (cognitive 20) macUSB/Features/Analysis/Logic/AnalysisLogicUsbDrives.swift:218 — AnalysisLogic.checkCapacity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 1 (2 pts), 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.
D2 · Cognitive Complexity · AnalysisLogic.readWindowsMetadata (cognitive 20) · ×1
  • AnalysisLogic.readWindowsMetadata (cognitive 20) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsMetadata.swift:4 — AnalysisLogic.readWindowsMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 6, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UniversalInstallationView.calculateTransferStageTotals (cognitive 20) · ×1
  • UniversalInstallationView.calculateTransferStageTotals (cognitive 20) macUSB/Features/Installation/CreatorHelperLogic.swift:833 — UniversalInstallationView.calculateTransferStageTotals has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InstallerSourceImageUnmountRegistry.detachTrackedImages (cognitive 20) · ×1
  • InstallerSourceImageUnmountRegistry.detachTrackedImages (cognitive 20) macUSB/Shared/Services/InstallerSourceImageUnmountRegistry.swift:64 — InstallerSourceImageUnmountRegistry.detachTrackedImages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowWindowsMacUSBootArtifactLoader.validateManifest (cognitive 20) · ×1
  • HelperWorkflowWindowsMacUSBootArtifactLoader.validateManifest (cognitive 20) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootArtifact.swift:149 — HelperWorkflowWindowsMacUSBootArtifactLoader.validateManifest has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 19, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MontereyDownloadFlowModel.verifyIntegrityDataChunklistIfAvailable (cognitive 20) · ×1
  • MontereyDownloadFlowModel.verifyIntegrityDataChunklistIfAvailable (cognitive 20) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:518 — MontereyDownloadFlowModel.verifyIntegrityDataChunklistIfAvailable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 5, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.formatMarketingVersion (cognitive 19) · ×1
  • AnalysisLogic.formatMarketingVersion (cognitive 19) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSInstallerMetadata.swift:10 — AnalysisLogic.formatMarketingVersion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SystemAnalysisView.updateMenuState (cognitive 19) · ×1
  • SystemAnalysisView.updateMenuState (cognitive 19) macUSB/Features/Analysis/SystemAnalysisView.swift:66 — SystemAnalysisView.updateMenuState has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 19. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FinishUSBView.finishEjectSection (cognitive 19) · ×1
  • FinishUSBView.finishEjectSection (cognitive 19) macUSB/Features/Finish/FinishUSBView.swift:456 — FinishUSBView.finishEjectSection has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FinishUSBView.performCleanupWithDelay (cognitive 19) · ×1
  • FinishUSBView.performCleanupWithDelay (cognitive 19) macUSB/Features/Finish/FinishUSBView.swift:580 — FinishUSBView.performCleanupWithDelay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 1 (2 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CreationProgressView.stateForStage (cognitive 19) · ×1
  • CreationProgressView.stateForStage (cognitive 19) macUSB/Features/Installation/CreationProgressView.swift:325 — CreationProgressView.stateForStage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloaderAssemblyExecutor.run (cognitive 18) · ×1
  • DownloaderAssemblyExecutor.run (cognitive 18) macUSBHelper/DownloaderAssembly/DownloaderAssemblyExecutor.swift:38 — DownloaderAssemblyExecutor.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.parseWindowsLegacyRsyncFilePathLine (cognitive 18) · ×1
  • HelperWorkflowExecutor.parseWindowsLegacyRsyncFilePathLine (cognitive 18) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:93 — HelperWorkflowExecutor.parseWindowsLegacyRsyncFilePathLine has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 14, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FinishUSBEjectLogic.performEject (cognitive 18) · ×1
  • FinishUSBEjectLogic.performEject (cognitive 18) macUSB/Features/Finish/FinishUSBEjectLogic.swift:65 — FinishUSBEjectLogic.performEject has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, ternaries 5 (6 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CreatorWindowsAutounattendSourceInspection.availableLanguageTags (cognitive 18) · ×1
  • CreatorWindowsAutounattendSourceInspection.availableLanguageTags (cognitive 18) macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendSourceInspection.swift:4 — CreatorWindowsAutounattendSourceInspection.availableLanguageTags has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.runLinuxUnmountTargetStage (cognitive 17) · ×1
  • HelperWorkflowExecutor.runLinuxUnmountTargetStage (cognitive 17) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:12 — HelperWorkflowExecutor.runLinuxUnmountTargetStage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.detachMountedImageAfterAnalysisTimeout (cognitive 17) · ×1
  • AnalysisLogic.detachMountedImageAfterAnalysisTimeout (cognitive 17) macUSB/Features/Analysis/AnalysisLogic.swift:381 — AnalysisLogic.detachMountedImageAfterAnalysisTimeout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.handleDrop (cognitive 17) · ×1
  • AnalysisLogic.handleDrop (cognitive 17) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:38 — AnalysisLogic.handleDrop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisLogic.readLinuxMetadata (cognitive 17) · ×1
  • AnalysisLogic.readLinuxMetadata (cognitive 17) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxMetadata.swift:45 — AnalysisLogic.readLinuxMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AnalysisLogic.forceTigerMultiDVDSelection (cognitive 17) · ×1
  • AnalysisLogic.forceTigerMultiDVDSelection (cognitive 17) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSLifecycle.swift:5 — AnalysisLogic.forceTigerMultiDVDSelection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowWindowsMacUSBootLayoutValidator.validate (cognitive 17) · ×1
  • HelperWorkflowWindowsMacUSBootLayoutValidator.validate (cognitive 17) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootLayoutValidator.swift:7 — HelperWorkflowWindowsMacUSBootLayoutValidator.validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MacOSCatalogService.enrichedWithInstallerSizes (cognitive 17) · ×1
  • MacOSCatalogService.enrichedWithInstallerSizes (cognitive 17) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoverySizeProbe.swift:4 — MacOSCatalogService.enrichedWithInstallerSizes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacOSLocalInstallerProcessRunner.run (cognitive 17) · ×1
  • MacOSLocalInstallerProcessRunner.run (cognitive 17) macUSB/Features/Downloader/Logic/Discovery/MacOSLocalInstallerProcessRunner.swift:78 — MacOSLocalInstallerProcessRunner.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperWorkflowExecutor.validatedWindowsTargetVolume (cognitive 16) · ×1
  • HelperWorkflowExecutor.validatedWindowsTargetVolume (cognitive 16) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsTargetResolution.swift:160 — HelperWorkflowExecutor.validatedWindowsTargetVolume has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AnalysisLogic.readLinuxArchiveTextFile (cognitive 16) · ×1
  • AnalysisLogic.readLinuxArchiveTextFile (cognitive 16) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:116 — AnalysisLogic.readLinuxArchiveTextFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacOSLocalInstallerMetadataReader.firstIdentity (cognitive 16) · ×1
  • MacOSLocalInstallerMetadataReader.firstIdentity (cognitive 16) macUSB/Features/Downloader/Logic/Discovery/MacOSLocalInstallerMetadataReader.swift:258 — MacOSLocalInstallerMetadataReader.firstIdentity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacOSDiskImagePreflight.prepare (cognitive 16) · ×1
  • MacOSDiskImagePreflight.prepare (cognitive 16) macUSB/Features/Downloader/Logic/DiskImage/MacOSDiskImagePreflight.swift:12 — MacOSDiskImagePreflight.prepare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MontereyDownloadFlowModel.parseIntegrityChunkTable (cognitive 16) · ×1
  • MontereyDownloadFlowModel.parseIntegrityChunkTable (cognitive 16) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:689 — MontereyDownloadFlowModel.parseIntegrityChunkTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MontereyDownloadFlowModel.resolveLegacyAssemblyFiles (cognitive 16) · ×1
  • MontereyDownloadFlowModel.resolveLegacyAssemblyFiles (cognitive 16) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:583 — MontereyDownloadFlowModel.resolveLegacyAssemblyFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1 (nesting depth added 2). Of this number, 9 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MontereyDownloadFlowModel.runConnectionCheck (cognitive 16) · ×1
  • MontereyDownloadFlowModel.runConnectionCheck (cognitive 16) macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift:193 — MontereyDownloadFlowModel.runConnectionCheck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: MacOSDownloadOrchestrator.swift → MacOSDownloaderProcessView.swift, MacOSDownloaderSummaryView.swift, MacOSDownloaderWindowShellView.swift macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift — `macUSB/Features/Downloader/Logic/Download/MacOSDownloadOrchestrator.swift` changes together with 3 other files — `macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift`, `macUSB/Features/Downloader/UI/MacOSDownloaderSummaryView.swift`, `macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.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.
D4 · Code Duplication · Near-duplicate member pair (117 shared lines) · ×1
  • Near-duplicate member pair (117 shared lines) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:5-181 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:183-334 — These two members are variants of one another: 117 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 · Near-duplicate member pair (91 shared lines) · ×1
  • Near-duplicate member pair (91 shared lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:77 — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:77-170 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:95-188 — These two members are variants of one another: 91 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 · Near-duplicate member pair (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:5 — macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:5-175 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:241-355 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×1
  • Edited copy of a member (14 corresponding lines) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:13 — macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:13-76 | macUSB/Shared/Services/UpdateChecker.swift:43-59 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:88 — macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:88-245 | macUSB/Features/Analysis/SystemAnalysisView.swift:328-346 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift:30 — macUSB/Shared/Services/Windows/WindowsToolchainProbeService.swift:30-59 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:398-451 — 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 (13 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (13 members, 50+ identical tokens) macUSB/Features/Installation/CreatorLogic.swift:38 — macUSB/Features/Installation/CreatorLogic.swift:38-68 | macUSB/Features/Installation/CreatorLogic.swift:124-163 | macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:36-64 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:39-65 | macUSB/Features/Installation/macOS/CreatorMacOSRosettaLogic.swift:63-85 | macUSB/Features/Welcome/WelcomeAutoSkipPreferences.swift:11-51 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:126-156 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:68-89 | macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:130-161 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:6-55 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:139-167 | macUSB/Shared/Services/NotificationPermissionManager.swift:63-86 | macUSB/Shared/Services/NotificationPermissionManager.swift:88-109 — These 13 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 13 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 13 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) macUSB/App/macUSBApp.swift:502 — macUSB/App/macUSBApp.swift:502-510 | macUSB/Features/Welcome/WelcomeAutoSkipPreferences.swift:11-51 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:126-156 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:158-171 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:68-89 | macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:87-114 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:116-138 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:139-167 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:177-204 | macUSB/Shared/Services/NotificationPermissionManager.swift:63-86 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift:30 — macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift:30-54 | macUSB/Features/Finish/FinishUSBView.swift:37-84 | macUSB/Shared/Services/Helper/HelperIPC.swift:30-54 | macUSB/Shared/Services/Helper/HelperIPC.swift:107-147 | macUSBHelper/IPC/HelperIPC.swift:30-54 | macUSBHelper/IPC/HelperIPC.swift:107-147 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (64–66 lines × 2) · ×1
  • Duplicated block (64–66 lines × 2) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:109 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:109-174 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:264-327 — 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 `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:109` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:78 — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:78-121 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:96-139 — before extracting anything, compare `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift` and `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 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 `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) macUSB/Shared/Services/Helper/HelperIPC.swift:107 — macUSB/Shared/Services/Helper/HelperIPC.swift:107-147 | macUSBHelper/IPC/HelperIPC.swift:107-147 — before extracting anything, compare `macUSB/Shared/Services/Helper/HelperIPC.swift` and `macUSBHelper/IPC/HelperIPC.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:143 — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:143-170 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:161-188 — before extracting anything, compare `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift` and `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 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 `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:67 — macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:67-93 | macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:125-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:9 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:9-34 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:121-146 — 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 `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:9` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) macUSB/Features/Installation/CreationProgressView.swift:478 — macUSB/Features/Installation/CreationProgressView.swift:478-500 | macUSB/Features/Installation/CreatorHelperLogic.swift:1032-1054 — 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:22 — macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:22-40 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:42-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 `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:22` 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, `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:41` calls `logDetectedMacOSError` and `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:22` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) macUSB/Shared/Services/USBDriveLogic.swift:185 — macUSB/Shared/Services/USBDriveLogic.swift:185-202 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:33-51 — before extracting anything, compare `macUSB/Shared/Services/USBDriveLogic.swift` and `macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Shared/Services/USBDriveLogic.swift:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:84 — macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:84-100 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:272-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) macUSB/Features/Installation/CreatorHelperLogic.swift:908 — macUSB/Features/Installation/CreatorHelperLogic.swift:908-923 | macUSB/Features/Installation/CreatorHelperLogic.swift:1076-1091 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:177-192 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyProgress.swift:12 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyProgress.swift:12-25 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyProgress.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 `macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyProgress.swift:12` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:146 — macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:146-160 | macUSB/Features/Finish/FinishUSBView.swift:717-732 — 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 `macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:193 — macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:193-207 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:429-443 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:350-364 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:30 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:30-44 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:164-176 — 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 `macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (10–14 lines × 3) · ×1
  • Duplicated block (10–14 lines × 3) macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:162 — macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:162-175 | macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:234-243 | macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:259-271 — 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 `macUSB/Shared/Services/Helper/HelperService/HelperServiceEnsureReadyFlow.swift:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping EnsureCompletion` in one and `@escaping (Bool, String?) -> Void` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) macUSB/Shared/Services/Helper/HelperIPC.swift:42 — macUSB/Shared/Services/Helper/HelperIPC.swift:42-53 | macUSB/Shared/Services/Helper/HelperIPC.swift:127-138 | macUSBHelper/IPC/HelperIPC.swift:42-53 | macUSBHelper/IPC/HelperIPC.swift:127-138 — before extracting anything, compare `macUSB/Shared/Services/Helper/HelperIPC.swift` and `macUSBHelper/IPC/HelperIPC.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 114 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 `macUSB/Shared/Services/Helper/HelperIPC.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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) macUSB/Features/Analysis/AnalysisLogic.swift:433 — macUSB/Features/Analysis/AnalysisLogic.swift:433-443 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:354-364 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:142-152 | macUSB/Shared/Services/InstallerSourceImageUnmountRegistry.swift:206-216 — 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 `macUSB/Features/Analysis/AnalysisLogic.swift:433` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–11 lines × 3) · ×1
  • Duplicated block (8–11 lines × 3) macUSB/Shared/Services/Helper/HelperConnectionSecurityPolicy.swift:59 — macUSB/Shared/Services/Helper/HelperConnectionSecurityPolicy.swift:59-69 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:146-154 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:561-568 — 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 `macUSB/Shared/Services/Helper/HelperConnectionSecurityPolicy.swift:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:72 — macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:72-82 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:191-201 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:283-293 — 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 `macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:42 — macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:42-51 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:59-68 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:100-109 — 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 `macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:42` 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsValidationLogic.swift:19 — macUSBHelper/Workflow/Windows/HelperWorkflowWindowsValidationLogic.swift:19-27 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsValidationLogic.swift:29-37 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsValidationLogic.swift:39-48 — 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 `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsValidationLogic.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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×1
  • Duplicated block (10 lines × 2) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:74 — macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:74-83 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:372-381 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:368` calls `waitUntilExit`, `readDataToEndOfFile` and `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:72` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) macUSB/Features/Installation/UniversalInstallationView.swift:300 — macUSB/Features/Installation/UniversalInstallationView.swift:300-308 | macUSB/Features/Installation/UniversalInstallationView.swift:321-329 | macUSB/Features/Installation/UniversalInstallationView.swift:466-474 | macUSB/Features/Installation/UniversalInstallationView.swift:488-496 — 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 `macUSB/Features/Installation/UniversalInstallationView.swift:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:34 — macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:34-42 | macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:44-52 | macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:54-60 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:42 — macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:42-49 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:59-66 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:74-83 | macUSB/Features/Downloader/UI/MacOSDownloaderPrerequisiteAlerts.swift:100-107 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) macUSB/Features/Analysis/AnalysisLogic.swift:447 — macUSB/Features/Analysis/AnalysisLogic.swift:447-454 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift:368-375 | macUSB/Shared/Services/InstallerSourceImageUnmountRegistry.swift:223-230 — 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 `macUSB/Features/Analysis/AnalysisLogic.swift:447` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:80 — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:80-87 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:98-105 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootDiskOperations.swift:97-103 — before extracting anything, compare `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift` and `macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 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 `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:80` 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, `macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootDiskOperations.swift:104` calls `Pipe` and `macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:88` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) macUSB/Features/Finish/FinishUSBView.swift:500 — macUSB/Features/Finish/FinishUSBView.swift:500-507 | macUSB/Features/Installation/UniversalInstallationView.swift:522-528 — 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 `macUSB/Features/Finish/FinishUSBView.swift:500` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) macUSB/Features/Finish/FinishUSBView.swift:481 — macUSB/Features/Finish/FinishUSBView.swift:481-487 | macUSB/Features/Installation/UniversalInstallationView.swift:299-305 | macUSB/Features/Installation/UniversalInstallationView.swift:320-326 | macUSB/Features/Installation/UniversalInstallationView.swift:465-471 | macUSB/Features/Installation/UniversalInstallationView.swift:487-493 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Finish/FinishUSBView.swift:481` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 15) · ×1
  • Duplicated block (6 lines × 15) macUSB/App/macUSBApp.swift:160 — macUSB/App/macUSBApp.swift:160-165 | macUSB/App/macUSBApp.swift:167-172 | macUSB/App/macUSBApp.swift:174-179 | macUSB/App/macUSBApp.swift:181-186 | macUSB/App/macUSBApp.swift:188-193 | macUSB/App/macUSBApp.swift:195-200 | macUSB/App/macUSBApp.swift:202-207 | macUSB/App/macUSBApp.swift:209-214 | macUSB/App/macUSBApp.swift:216-221 | macUSB/App/macUSBApp.swift:223-228 | macUSB/App/macUSBApp.swift:230-235 | macUSB/App/macUSBApp.swift:237-242 | macUSB/App/macUSBApp.swift:244-249 | macUSB/App/macUSBApp.swift:251-256 | macUSB/App/macUSBApp.swift:258-263 — all 15 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `macUSB/App/macUSBApp.swift:158` calls `Divider` and `macUSB/App/macUSBApp.swift:165` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) macUSB/Features/Analysis/SystemAnalysisView.swift:130 — macUSB/Features/Analysis/SystemAnalysisView.swift:130-135 | macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:8-13 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:222-231 — 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 `macUSB/Features/Analysis/SystemAnalysisView.swift:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:550 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:550-555 | macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:200-204 — 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 `macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 11) · ×1
  • Duplicated block (5 lines × 11) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:70 — macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:70-79 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:239-248 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:262-271 | macUSB/Features/Installation/CreatorLogic.swift:39-43 | macUSB/Features/Installation/CreatorLogic.swift:133-137 | macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendAlertLogic.swift:52-56 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:43-47 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:60-64 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:101-105 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:29-33 | macUSB/Shared/Services/NotificationPermissionManager.swift:89-93 — there are 11 copies across 8 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 11 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:70` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendAlertLogic.swift:50` calls `log` and `macUSB/Features/Installation/CreatorLogic.swift:131` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 10) · ×1
  • Duplicated block (5 lines × 10) macUSB/App/macUSBApp.swift:503 — macUSB/App/macUSBApp.swift:503-507 | macUSB/Features/Welcome/WelcomeAutoSkipPreferences.swift:20-24 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:127-131 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:159-163 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:69-73 | macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:90-94 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:117-121 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:140-144 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:180-184 | macUSB/Shared/Services/NotificationPermissionManager.swift:64-68 — there are 10 copies across 7 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 10 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:147` calls `addButton`, `String` and `macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:135` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) macUSB/App/ContentView.swift:176 — macUSB/App/ContentView.swift:176-180 | macUSB/App/macUSBApp.swift:98-102 | macUSB/App/macUSBApp.swift:125-129 | macUSB/Features/Installation/macOS/CreatorMacOSRosettaLogic.swift:64-68 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `macUSB/App/macUSBApp.swift:104` calls `addButton`, `String` and `macUSB/App/ContentView.swift:183` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:550 — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:550-554 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyProcessUtils.swift:119-123 | macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:200-204 — 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 `macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (2–5 lines × 11) · ×1
  • Duplicated block (2–5 lines × 11) macUSB/Features/Installation/CreatorLogic.swift:44 — macUSB/Features/Installation/CreatorLogic.swift:44-48 | macUSB/Features/Installation/CreatorLogic.swift:138-139 | macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:47-51 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:48-52 | macUSB/Features/Installation/macOS/CreatorMacOSRosettaLogic.swift:69-70 | macUSB/Features/Welcome/WelcomeAutoSkipPreferences.swift:25-26 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:132-133 | macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:145-146 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:34-35 | macUSB/Shared/Services/NotificationPermissionManager.swift:69-70 | macUSB/Shared/Services/NotificationPermissionManager.swift:94-95 — before extracting anything, compare `macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift` and `macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `macUSB/Features/Installation/CreatorLogic.swift:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–5 lines × 5) · ×1
  • Duplicated block (4–5 lines × 5) macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:132 — macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:132-135 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:75-79 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:147-151 | macUSB/Shared/Services/NotificationPermissionManager.swift:69-72 | macUSB/Shared/Services/NotificationPermissionManager.swift:94-97 — 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 `macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:132` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:74` calls `addButton`, `String` and `macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:131` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: MenuState (LCOM4 4) macUSB/Shared/Services/MenuState.swift:4 — MenuState'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.
P1 · CI/CD gates · No CI pipeline · ×1
  • No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
Minor — 12 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×6
  • Duplicated predicate macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:200 — `CharacterSet.letters.contains(scalar) || CharacterSet.decimalDigits.contains(scalar) || scalar == " "` appears character-identically in 2 files — macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift, macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendValidation.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 macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift:62 — `ext == "dmg" || ext == "iso" || ext == "cdr"` appears character-identically in 2 files — macUSB/Features/Analysis/Logic/AnalysisLogicAnalysisFlow.swift, macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSLifecycle.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 macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:200 — `item.name.caseInsensitiveCompare("InstallAssistant.pkg") == .orderedSame || item.url.lastPathComponent.caseInsensitiveCompare("InstallAssist…` appears character-identically in 2 files — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift, macUSB/Features/Downloader/Logic/MacOSVerificationLogic.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 macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift:190 — `item.name.caseInsensitiveCompare("InstallAssistantAuto.pkg") == .orderedSame || item.url.lastPathComponent.caseInsensitiveCompare("InstallAs…` appears character-identically in 3 files — macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyOrchestrator.swift, macUSB/Features/Downloader/Logic/Download/MacOSDownloadNamingPolicy.swift, macUSB/Features/Downloader/Logic/MacOSVerificationLogic.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 macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:182 — `lowered.contains("at least one volume could not be unmounted") || lowered.contains("unmount was dissented by pid") || lowered.contains("reso…` appears character-identically in 2 files — macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift, macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.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 macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:113 — `skipHardwareRequirements || useMacLanguageAndRegion || preventDeviceEncryption || disableDataCollection || skipWirelessSetup || skipMicrosof…` appears character-identically in 2 files — macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift, macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendConfiguration.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.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (34286 LoC, 276 module-visible types across 39 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.
D9 · Test Distribution · No tests found · ×1
  • No tests found — No test suite could be collected — no discoverable tests to count. If this repository does test, wiring the suite to a framework a runner can collect (XCTest or Swift Testing) is what makes it countable here; a pipeline step that invokes a runner is not evidence on its own, because a runner over an empty suite passes. Tests written as plain executables or shell/PowerShell harnesses are not collectible this way and are not scored here.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — 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) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a9216fb97c6a464983a8fb9053f333ba/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a9216fb97c6a464983a8fb9053f333ba/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .0artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)—none (no readable dependency manifest): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 29 file(s) — `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift`, `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxLifecycle.swift`, `macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxMetadata.swift`, `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift`, `macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSInstallerMetadata.swift`, … (+24 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (no readable dependency manifest)—none (no readable dependency manifest): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).0—

Run 01a184ca-2381-72dd-9fe1-6ece05fdb674 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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