Public report of Kruszoneq/macUSB, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 22:46 UTC · Survey ID cd_e665854ed8454c3d84fa451ff2637591
Kruszoneq/macUSB
Measured 14 November 2026, 22:45 UTC, at code version 777ed53
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Up 3 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 critical377 serious10 minor
34 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 22:45 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
33of 33 dimensions measured by tools.
384of 388 findings point to an exact file and line, so you can open each one in the code. The other 4 concern the repository as a whole, such as missing documentation.
33dimensions across 6 lenses, read from 34,286 lines of product code in 1 project.
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 53 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 24 points. Raising Production Readiness to 70 would lift the score to about 73.
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 €33,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 26 to 70, the lowest score rated Strong, the score would rise from 53 to about 73.
Code composition: what the lines of code are
Product code 100%
New since the last survey: 77 findings
These 77 critical or serious findings weren't in the previous survey, on 28 October 2026.
Code Duplication · Near-duplicate member pair (91 shared lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift
Code Duplication · Near-duplicate member pair (42 shared lines) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift
Code Duplication · Edited copy of a member (152 corresponding lines) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift
Code Duplication · Edited copy of a member (91 corresponding lines) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift
Code Duplication · Edited copy of a member (87 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
Code Duplication · Edited copy of a member (77 corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift
Code Duplication · Edited copy of a member (42 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift
Code Duplication · Edited copy of a member (61 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift
Code Duplication · Edited copy of a member (53 corresponding lines) macUSBHelper/Service/PrivilegedHelperService.swift
Code Duplication · Edited copy of a member (38 corresponding lines) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift
Code Duplication · Edited copy of a member (41 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift
Code Duplication · Edited copy of a member (28 corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift
Code Duplication · Edited copy of a member (27 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift
Code Duplication · Edited copy of a member (26 corresponding lines) macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift
Code Duplication · Edited copy of a member (31 corresponding lines) macUSB/Features/Installation/CreatorLogic.swift
Code Duplication · Edited copy of a member (34 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift
Code Duplication · Edited copy of a member (34 corresponding lines) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift
Code Duplication · Edited copy of a member (28 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift
Code Duplication · Edited copies of one member (6 members, 22+ corresponding lines) macUSB/Features/Installation/macOS/CreatorMacOSRosettaLogic.swift
Code Duplication · Edited copy of a member (23 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift
Code Duplication · Edited copy of a member (20 corresponding lines) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift
Code Duplication · Edited copy of a member (29 corresponding lines) macUSB/Features/Installation/CreationProgressView.swift
Code Duplication · Edited copy of a member (18 corresponding lines) macUSB/Features/Analysis/SystemAnalysisView.swift
Code Duplication · Edited copy of a member (24 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyFileUtils.swift
Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) macUSB/Shared/Services/Helper/HelperConnectionSecurityPolicy.swift
Code Duplication · Edited copy of a member (25 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
Code Duplication · Edited copy of a member (25 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift
Code Duplication · Edited copy of a member (18 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift
Code Duplication · Edited copy of a member (13 corresponding lines) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoverySizeProbe.swift
Code Duplication · Edited copy of a member (18 corresponding lines) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift
Code Duplication · Edited copy of a member (15 corresponding lines) macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift
Code Duplication · Edited copy of a member (22 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift
Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift
Code Duplication · Edited copy of a member (18 corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderListView.swift
Code Duplication · Edited copy of a member (21 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift
Code Duplication · Edited copy of a member (15 corresponding lines) macUSB/Features/Installation/CreationProgressView.swift
Code Duplication · Edited copy of a member (18 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift
Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift
Code Duplication · Edited copy of a member (19 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
Code Duplication · Edited copy of a member (7 corresponding lines) macUSB/Shared/Services/Logging.swift
Code Duplication · Edited copy of a member (9 corresponding lines) macUSB/App/macUSBApp.swift
Code Duplication · Edited copy of a member (11 corresponding lines) macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift
Code Duplication · Edited copy of a member (20 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift
Code Duplication · Edited copy of a member (16 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift
Code Duplication · Edited copy of a member (13 corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift
Code Duplication · Edited copy of a member (15 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift
Code Duplication · Edited copy of a member (18 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift
Code Duplication · Edited copies of one member (5 members, 9+ corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift
Code Duplication · Edited copy of a member (13 corresponding lines) macUSB/Shared/UI/LiquidGlassCompatibility.swift
Code Duplication · Edited copy of a member (13 corresponding lines) macUSBHelper/DownloaderAssembly/DownloaderAssemblyExecutor.swift
Code Duplication · Edited copy of a member (4 corresponding lines) macUSB/Features/Analysis/AnalysisLogic.swift
Code Duplication · Edited copy of a member (7 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift
Code Duplication · Edited copy of a member (7 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift
Code Duplication · Edited copy of a member (11 corresponding lines) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsBootMarkers.swift
Code Duplication · Edited copy of a member (18 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift
Code Duplication · Edited copy of a member (5 corresponding lines) macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift
Code Duplication · Edited copy of a member (9 corresponding lines) macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift
Code Duplication · Edited copy of a member (5 corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceBootstrap.swift
Code Duplication · Edited copy of a member (9 corresponding lines) macUSBHelper/Service/PrivilegedHelperService.swift
Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSInstallerValidation.swift
Code Duplication · Edited copy of a member (13 corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift
Code Duplication · Edited copy of a member (10 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift
Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) macUSB/Features/Installation/CreationProgressView.swift
Code Duplication · Edited copy of a member (6 corresponding lines) macUSB/Features/Installation/CreatorHelperLogic.swift
Code Duplication · Edited copy of a member (4 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift
Code Duplication · Edited copy of a member (5 corresponding lines) macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift
Code Duplication · Edited copy of a member (3 corresponding lines) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 35 findings
These 35 critical or serious findings were in the previous survey, on 28 October 2026, and are gone from this one.
Code Duplication · Near-duplicate member pair (117 shared lines) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift
Code Duplication · Near-duplicate member pair (91 shared lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift
Code Duplication · Near-duplicate member pair (54 shared lines) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.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
€11,000 to €55,000, for 184 to 583 hours of work, about 0.2 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 53. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 34,286 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No automated tests finding(s) in Code Coverage.
Raises the score by about 24 points · High effort · Code Coverage
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with project.pbxproj.
Raises the score by about 4 points · Low effort · ADR Quality
3
Resolve the 1 `bundleId` spells `Id` where 35 names in the project spell it `ID` finding(s) in Naming Consistency — start with macUSBApp.swift.
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 €33,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 24 points for high 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 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 12% 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 100.8 to 604.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
At a glance — Code Health · 67% · Adequate · gated by D2 ·
Top priorities: Resolve the 1 No automated tests finding(s) in Code Coverage; Add a CI workflow that builds and runs the test suite on every push/PR; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with project.pbxproj.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No automated tests finding(s) in Code Coverage.
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.
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.
Resolve the 19 MethodTooLong finding(s) in God Classes — start with CreatorHelperLogic.swift (2), HelperWorkflowStages.swift (2), AnalysisLogicMacOSCompatibility.swift (2).
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 — 377
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 — 10
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 34
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 33 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 33 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 384 of 388 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover 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.
D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (34286 LoC, 276 module-visible types across 39 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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. We then boot 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded and 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and 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
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
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 our 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.
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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
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.
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.
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.
+ 43 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 68 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
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).
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).
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).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D4 · Code Duplication4.1 / 10Weak✓ Tool-verified
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
109 duplicated block group(s) detected. 14.6 % of the production lines (5,022 of 34,286) are in a reported copy. A further 74 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
Edited copy of a member (18 corresponding lines) · ×7macUSB/Features/Analysis/SystemAnalysisView.swift:106
+ 101 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 Edited copy of a member (18 corresponding lines) finding(s) in Code Duplication — start with SystemAnalysisView.swift, HelperWorkflowWindowsCopyProgressParsing.swift, MacOSVerificationLogic.swift. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 7 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with AnalysisLogic.swift, AnalysisLogicMacOSImageMounting.swift, MacOSVerificationLogic.swift. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 6 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with HelperIPC.swift (2), AnalysisLogicLinuxClassification.swift, RawLinuxImageSelectionCoordinator.swift. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with MenuState.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D8 · Code Coverage0.0 / 10Critical✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, 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.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: 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.
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.
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.
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.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with project.pbxproj. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
1 naming inconsistencies among 36 declarations measured against a convention their peers follow.
`bundleId` spells `Id` where 35 names in the project spell it `ID`macUSB/App/macUSBApp.swift:512
What to do
Resolve the 1 `bundleId` spells `Id` where 35 names in the project spell it `ID` finding(s) in Naming Consistency — start with macUSBApp.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
0 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
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.
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.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 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).
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.
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.
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.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
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.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Do you agree with this assessment?
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.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
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.
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)
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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 — 78 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — 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.
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+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript 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
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. 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.
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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. 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.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
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
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not 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.
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.
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.
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.
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.
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.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×7
Edited copy of a member (18 corresponding lines) macUSB/Features/Analysis/SystemAnalysisView.swift:106— macUSB/Features/Analysis/SystemAnalysisView.swift:106-123 | macUSB/Features/Analysis/SystemAnalysisView.swift:125-149 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:16— macUSBHelper/Workflow/Windows/HelperWorkflowWindowsCopyProgressParsing.swift:16-33 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsWimSplitProgressParsing.swift:4-21 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:339— macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:339-356 | macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:358-376 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderListView.swift:454— macUSB/Features/Downloader/UI/MacOSDownloaderListView.swift:454-480 | macUSB/Features/Downloader/UI/MacOSDownloaderListView.swift:482-499 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:456— macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:456-473 | macUSB/Features/Downloader/Logic/MacOSVerificationLogic.swift:497-516 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:45— macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:45-62 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootMountGuard.swift:40-58 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:66— macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:66-83 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:67-84 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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/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/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.
Duplicated block (9 lines × 2) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:221— macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:221-229 | macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsClassification.swift:237-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.
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.
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/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 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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.
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· Edited copy of a member (13 corresponding lines) · ×5
Edited copy of a member (13 corresponding lines) macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoverySizeProbe.swift:290— macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoverySizeProbe.swift:290-302 | macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoverySizeProbe.swift:304-317 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:422— macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:422-434 | macUSB/Features/Finish/FinishUSBView.swift:765-777 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) macUSB/Shared/UI/LiquidGlassCompatibility.swift:176— macUSB/Shared/UI/LiquidGlassCompatibility.swift:176-189 | macUSB/Shared/UI/LiquidGlassCompatibility.swift:195-207 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) macUSBHelper/DownloaderAssembly/DownloaderAssemblyExecutor.swift:24— macUSBHelper/DownloaderAssembly/DownloaderAssemblyExecutor.swift:24-36 | macUSBHelper/Workflow/HelperWorkflowExecutor.swift:45-61 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:116— macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:116-128 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:205-217 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (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.
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.
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.
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.
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/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.
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/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) 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.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×3
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.
Edited copy of a member (25 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:634— macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:634-658 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:683-709 — 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.
Edited copy of a member (25 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:290— macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:290-318 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:320-344 — 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· Edited copy of a member (15 corresponding lines) · ×3
Edited copy of a member (15 corresponding lines) macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:161— macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:161-180 | macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:192-206 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) macUSB/Features/Installation/CreationProgressView.swift:57— macUSB/Features/Installation/CreationProgressView.swift:57-71 | macUSB/Features/Installation/UniversalInstallationView.swift:165-186 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:400— macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:400-414 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:416-434 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×3
Edited copy of a member (7 corresponding lines) macUSB/Shared/Services/Logging.swift:209— macUSB/Shared/Services/Logging.swift:209-215 | macUSB/Shared/Services/Logging.swift:217-223 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:6— macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:6-12 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:6-13 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:231— macUSBHelper/Workflow/Windows/HelperWorkflowWindowsSourceLogic.swift:231-237 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:338-344 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) macUSB/App/macUSBApp.swift:502— macUSB/App/macUSBApp.swift:502-510 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:158-171 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:151— macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:151-159 | macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendGenerator.swift:182-190 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) macUSBHelper/Service/PrivilegedHelperService.swift:81— macUSBHelper/Service/PrivilegedHelperService.swift:81-89 | macUSBHelper/Service/PrivilegedHelperService.swift:145-157 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:189— macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:189-193 | macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendValidation.swift:56-60 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceBootstrap.swift:160— macUSB/Shared/Services/Helper/HelperService/HelperServiceBootstrap.swift:160-165 | macUSB/Shared/Services/Logging.swift:337-341 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:199— macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:199-203 | macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendValidation.swift:73-77 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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.
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.
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/Features/Welcome/WelcomeStartupUpdateChecker.swift:47— macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:47-60 | macUSB/Shared/Services/UpdateChecker.swift:44-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `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 (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 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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/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.
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/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.
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.
Duplicated block (10 lines × 2) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:252— macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:252-261 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSImageMounting.swift:321-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 (10 lines × 2) macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:213— macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:213-222 | macUSB/Features/Analysis/SystemAnalysisUSBSectionView.swift:227-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.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×2
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.
Edited copy of a member (16 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:68— macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:68-83 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootMountGuard.swift:60-75 — 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 (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:87— macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:87-114 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:177-204 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:269— macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:269-296 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:595-628 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift:218— macUSB/Shared/Services/USBDriveLogic.swift:218-251 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:98-132 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift:76— macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift:76-111 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootRawDevice.swift:113-146 — These two members are one piece of code written twice and then edited apart: 34 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 (20 corresponding lines) · ×2
Edited copy of a member (20 corresponding lines) macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:647— macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:647-666 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:720-746 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:19— macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:19-43 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootMountGuard.swift:19-38 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×2
Edited copy of a member (11 corresponding lines) macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:61— macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendConfiguration.swift:61-72 | macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendConfiguration.swift:34-44 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsBootMarkers.swift:122— macUSB/Features/Analysis/Logic/Windows/AnalysisLogicWindowsBootMarkers.swift:122-132 | macUSB/Features/Installation/Windows/Autounattend/CreatorWindowsAutounattendSourceInspection.swift:86-98 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) macUSB/Features/Analysis/AnalysisLogic.swift:219— macUSB/Features/Analysis/AnalysisLogic.swift:219-222 | macUSB/Features/Analysis/AnalysisLogic.swift:224-227 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:333— macUSBHelper/Workflow/Windows/HelperWorkflowWindowsStages.swift:333-336 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsTargetResolution.swift:207-210 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (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.
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 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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.
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.
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.
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.
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.
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.
Duplicated block (6 lines × 2) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:43— macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:43-48 | macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:50-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:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootArtifact.swift:242— macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootArtifact.swift:242-247 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootLayoutValidator.swift:61-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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Near-duplicate member pair (42 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: 42 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 (152 corresponding lines) · ×1
Edited copy of a member (152 corresponding 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 one piece of code written twice and then edited apart: 152 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 (91 corresponding lines) · ×1
Edited copy of a member (91 corresponding lines) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:4— macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:4-114 | macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxArchiveReader.swift:116-206 — These two members are one piece of code written twice and then edited apart: 91 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 (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:34— macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:34-138 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:160-246 — These two members are one piece of code written twice and then edited apart: 87 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 (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift:132— macUSB/Features/Downloader/UI/MacOSDownloaderProcessView.swift:132-219 | macUSB/Features/Installation/CreationProgressView.swift:224-300 — These two members are one piece of code written twice and then edited apart: 77 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 (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift:161— macUSB/Shared/Services/USBDriveLogic.swift:161-202 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:4-51 — These two members are one piece of code written twice and then edited apart: 42 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:6— macUSB/Shared/Services/Helper/PrivilegedOperationClientCapabilities.swift:6-67 | macUSB/Shared/Services/Helper/PrivilegedOperationClientRosetta.swift:4-64 — These two members are one piece of code written twice and then edited apart: 61 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 (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) macUSBHelper/Service/PrivilegedHelperService.swift:17— macUSBHelper/Service/PrivilegedHelperService.swift:17-79 | macUSBHelper/Service/PrivilegedHelperService.swift:91-143 — These two members are one piece of code written twice and then edited apart: 53 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 (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:62— macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:62-99 | macUSB/Features/Analysis/Logic/AnalysisLogicFileSelection.swift:114-160 — These two members are one piece of code written twice and then edited apart: 38 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:530— macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyLegacyFlow.swift:530-570 | macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyProcessUtils.swift:99-141 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:36— macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:36-64 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:39-65 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:135— macUSB/Features/Downloader/Logic/MacOSCleanupLogic.swift:135-160 | macUSB/Features/Finish/FinishUSBView.swift:701-733 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) macUSB/Features/Installation/CreatorLogic.swift:38— macUSB/Features/Installation/CreatorLogic.swift:38-68 | macUSB/Features/Installation/CreatorLogic.swift:124-163 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 22+ corresponding lines) · ×1
Edited copies of one member (6 members, 22+ corresponding lines) macUSB/Features/Installation/macOS/CreatorMacOSRosettaLogic.swift:63— macUSB/Features/Installation/macOS/CreatorMacOSRosettaLogic.swift:63-85 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:126-156 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:68-89 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:139-167 | macUSB/Shared/Services/NotificationPermissionManager.swift:63-86 | macUSB/Shared/Services/NotificationPermissionManager.swift:88-109 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift:276— macUSB/Shared/Services/USBDriveLogic.swift:276-303 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:133-155 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) macUSB/Features/Installation/CreationProgressView.swift:360— macUSB/Features/Installation/CreationProgressView.swift:360-388 | macUSB/Features/Installation/CreationProgressView.swift:390-418 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyFileUtils.swift:4— macUSB/Features/Downloader/Logic/Assembly/MacOSAssemblyFileUtils.swift:4-31 | macUSBHelper/DownloaderAssembly/DownloaderAssemblyProcess.swift:674-697 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) macUSB/Shared/Services/Helper/HelperConnectionSecurityPolicy.swift:55— macUSB/Shared/Services/Helper/HelperConnectionSecurityPolicy.swift:55-72 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:142-156 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:553-571 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) macUSB/Shared/Services/USBDriveLogic.swift:253— macUSB/Shared/Services/USBDriveLogic.swift:253-274 | macUSBHelper/Workflow/HelperWorkflowDiskResolution.swift:75-97 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×1
Edited copies of one member (4 members, 14+ corresponding lines) macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:5— macUSB/Features/Downloader/UI/MacOSDownloaderDiskImageAlerts.swift:5-25 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:198-211 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:238-259 | macUSB/Features/Downloader/UI/MacOSDownloaderWindowShellView.swift:261-282 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:14— macUSB/Features/Installation/Linux/CreatorLinuxUnmountRecoveryLogic.swift:14-34 | macUSB/Features/Installation/Windows/CreatorWindowsUnmountRecoveryLogic.swift:15-37 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:500— macUSB/Features/Analysis/Logic/Linux/AnalysisLogicLinuxClassification.swift:500-513 | macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryDistributionParser.swift:33-45 | macUSBHelper/Workflow/Linux/HelperWorkflowLinuxProgressParsing.swift:19-32 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:140— macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:140-158 | macUSB/Shared/Services/Helper/PrivilegedOperationClient.swift:248-266 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 9+ corresponding lines) · ×1
Edited copies of one member (5 members, 9+ corresponding lines) macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:59— macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:59-67 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:90-99 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:100-108 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:168-176 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:168-176 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSInstallerValidation.swift:140— macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSInstallerValidation.swift:140-146 | macUSB/Features/Installation/CreatorHelperLogic.swift:564-570 | macUSBHelper/Workflow/Linux/HelperWorkflowLinuxUnmountLogic.swift:180-186 | macUSBHelper/Workflow/Windows/HelperWorkflowWindowsUnmountLogic.swift:208-214 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:104— macUSBHelper/Workflow/Linux/HelperWorkflowLinuxMountGuard.swift:104-116 | macUSBHelper/Workflow/Windows/MacUSBoot/HelperWorkflowWindowsMacUSBootMountGuard.swift:78-87 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) macUSB/Features/Installation/CreationProgressView.swift:420— macUSB/Features/Installation/CreationProgressView.swift:420-434 | macUSB/Features/Installation/CreationProgressView.swift:436-450 | macUSB/Features/Installation/CreatorHelperLogic.swift:820-831 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) macUSB/Features/Installation/CreatorHelperLogic.swift:1125— macUSB/Features/Installation/CreatorHelperLogic.swift:1125-1130 | macUSB/Shared/Services/USBDriveLogic.swift:8-13 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:78— macUSB/Features/Welcome/WelcomeStartupUpdateChecker.swift:78-80 | macUSBHelper/Workflow/Windows/Autounattend/HelperWorkflowWindowsAutounattendValidation.swift:79-84 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (119–121 lines × 2) macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:61— macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:61-181 | macUSB/Features/Analysis/Logic/macOS/AnalysisLogicMacOSCompatibility.swift:216-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:61` 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 (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.
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.
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 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 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 (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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Duplicated block (6 lines × 10) macUSB/App/macUSBApp.swift:503— macUSB/App/macUSBApp.swift:503-508 | macUSB/Features/Welcome/WelcomeAutoSkipPreferences.swift:20-25 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:127-132 | macUSB/Shared/Services/FullDiskAccessPermissionManager.swift:159-164 | macUSB/Shared/Services/Helper/HelperService/HelperServiceDiagnostics.swift:69-74 | macUSB/Shared/Services/Helper/HelperService/HelperServiceRepairUI.swift:90-95 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:117-122 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:140-145 | macUSB/Shared/Services/Helper/HelperService/HelperServiceStatusUI.swift:180-185 | macUSB/Shared/Services/NotificationPermissionManager.swift:64-69 — 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/FullDiskAccessPermissionManager.swift:167` calls `beginSheetModal` and `macUSB/App/macUSBApp.swift:509` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) 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.
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.
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.
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.
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.
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.
No ADRs found macUSB.xcodeproj/project.pbxproj:1— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `macUSB.xcodeproj/project.pbxproj` makes this repository a deployable product (line 1).
D21 · Naming Consistency· `bundleId` spells `Id` where 35 names in the project spell it `ID` · ×1
`bundleId` spells `Id` where 35 names in the project spell it `ID` macUSB/App/macUSBApp.swift:512— 35 of 36 names in project repository spell the token `ID` (35 of 36; unit: names in project repository containing `ID`). Peers: AnalysisLogic.selectedDriveSelectionID (macUSB/Features/Analysis/AnalysisLogic.swift:64); AnalysisLogic.activeImageAnalysisRunID (macUSB/Features/Analysis/AnalysisLogic.swift:178); AnalysisLogic.handleImageAnalysisTimeout(runID) (macUSB/Features/Analysis/AnalysisLogic.swift:363); AnalysisUSBHeldPresentation.selectionID (macUSB/Features/Analysis/AnalysisUSBDiscoveryPresentation.swift:15); MacOSInstallerEntry.catalogProductID (macUSB/Features/Downloader/Logic/Discovery/MacOSDiscoveryModels.swift:25). Rename to `bundleID`. [rule N6]
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
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.
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).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 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.
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.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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 01a1dc3c-fcff-7710-8b7c-13d95b8dab09 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 1 · Warnings: 377 · Recommendations: 10 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 22:45 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.