Public report of duongductrong/Snapzy, published 28 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 28 October 2026, 22:57 UTC · Survey ID cd_a29881a6f93f4b75b8237c05db3254d8
duongductrong/Snapzy
Measured 28 October 2026, 22:53 UTC, at code version 77d3d3f
No regression since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 161,374 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 1.5 person-years · Weakest lens: Production Readiness, 46
Findings by how serious they are
19 critical928 serious47 minor
16 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 22:53 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
66of 66 dimensions measured by tools.
974of 994 findings point to an exact file and line, so you can open each one in the code. The other 20 concern the repository as a whole, such as missing documentation.
66dimensions across 7 lenses, read from 161,374 lines of product code in 6 projects.
duongductrong/Snapzy falls short of our standard for production because two passwords or keys sit in the current code and we found no automated security scanning of the code, its secrets or its dependencies. It scores 58 out of 100 and is rated Adequate, and 17 of its 19 critical findings are security problems.
Production Readiness, at 46, is the weakest lens and counts most in the score. The best first step is replacing the two exposed passwords or keys and switching the old ones off, worth about 10 points. Adding automated security scanning comes next, worth about 8 points. Raising Production Readiness to 70 would lift the score to about 66.
Ten pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three settings leave the servers or containers unsafe, and two passwords or keys are open to anyone who can read the repository. Pinning each tool to an exact version, correcting the unsafe settings and replacing each exposed password or key would close these risks. Limiting each secret to its own step would fix the two secrets exposed to more of the pipeline than needed. The two pieces of business logic tied to the database or web code need separating from the database and web code.
The product code is 161,374 lines, about €210,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 30 findings
These 30 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one.
€71,000 to €350,000, for 1,176 to 3,732 hours of work, about 1.5 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 58. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 161,374 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.
Raises the score by about 10 points · Low effort · Secret Scanning
2
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`.
Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
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 €210,000 to build again, about 1.5 person-years of work. Its weakest lens is Production Readiness, at 46 (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 2 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 10 points for low effort, because it clears the 2 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
7 modules, with 6 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
Uses a module listed above itPart of a loopThe module itself
4→5 repository uses Packages~SnapzyCLIKit~SnapzyCLIProtocolpart of a loop✕
Connections
40 pairs of types, where a type in repository uses a type in Packages~SnapzyCLIKit~SnapzyCLIProtocol. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository uses Packages~SnapzyCLIKit~SnapzyCLIProtocol, so a change to Packages~SnapzyCLIKit~SnapzyCLIProtocol can break repository, while a change to repository can't break Packages~SnapzyCLIKit~SnapzyCLIProtocol.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
40 pairs of types, where a type in Packages~SnapzyCLIKit~SnapzyCLIProtocol uses a type in repository. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Packages~SnapzyCLIKit~SnapzyCLIProtocol uses repository, so a change to repository can break Packages~SnapzyCLIKit~SnapzyCLIProtocol, while a change to Packages~SnapzyCLIKit~SnapzyCLIProtocol can't break repository.
Position
Below the diagonal: Packages~SnapzyCLIKit~SnapzyCLIProtocol uses a module listed above it, which is the healthy direction.
Packages~SnapzyCLIKit~SnapzyCLIClient uses repository, so a change to repository can break Packages~SnapzyCLIKit~SnapzyCLIClient, while a change to Packages~SnapzyCLIKit~SnapzyCLIClient can't break repository.
Position
Below the diagonal: Packages~SnapzyCLIKit~SnapzyCLIClient uses a module listed above it, which is the healthy direction.
Packages~SnapzyCLIKit~SnapzyCLIClient uses Packages~SnapzyCLIKit~SnapzyCLIProtocol, so a change to Packages~SnapzyCLIKit~SnapzyCLIProtocol can break Packages~SnapzyCLIKit~SnapzyCLIClient, while a change to Packages~SnapzyCLIKit~SnapzyCLIClient can't break Packages~SnapzyCLIKit~SnapzyCLIProtocol.
Position
Below the diagonal: Packages~SnapzyCLIKit~SnapzyCLIClient uses a module listed above it, which is the healthy direction.
Packages~SnapzyCLIKit~SnapzyCLICore uses repository, so a change to repository can break Packages~SnapzyCLIKit~SnapzyCLICore, while a change to Packages~SnapzyCLIKit~SnapzyCLICore can't break repository.
Position
Below the diagonal: Packages~SnapzyCLIKit~SnapzyCLICore uses a module listed above it, which is the healthy direction.
Packages~SnapzyCLIKit~SnapzyCLICore uses Packages~SnapzyCLIKit~SnapzyCLIProtocol, so a change to Packages~SnapzyCLIKit~SnapzyCLIProtocol can break Packages~SnapzyCLIKit~SnapzyCLICore, while a change to Packages~SnapzyCLIKit~SnapzyCLICore can't break Packages~SnapzyCLIKit~SnapzyCLIProtocol.
Position
Below the diagonal: Packages~SnapzyCLIKit~SnapzyCLICore uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 62% · Adequate · gated by X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
12
High / Critical
A03:2025 — Software Supply Chain Failures
10
Medium
A02:2025 — Security Misconfiguration
3
High / Critical
A07:2025 — Authentication Failures
2
High / Critical
Roadmap
First, resolve the two leaked secrets in the Swift codebase and integrate a SAST step into CI to prevent future security regressions from merging. Next, systematically adopt nil-checking tools for Ruby files and eliminate unsafe nil assertions to improve type safety. Finally, enhance deployment reliability by adding health checks to the compose service and ensuring image tags remain immutable for straightforward rollbacks.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Raise allocation-aware density on the hot paths — currently 40 use(s) across 181,729 production line(s) (~0.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
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 — 19
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 — 928
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 47
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 66 of 66 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 66 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, 974 of 994 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in Packages/SnapzyCLIKit produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.swift) and this repository declares a SwiftPM test suite (SnapzyCLIKit), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
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 (34 contributor(s) across 1355 commit(s) sampled, automation and bot accounts excluded). One of them holds 92% of the history; the other 33 hold 0.2% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Packages/SnapzyCLIKit/Sources/SnapzyCLIClient/AppLauncher.swift`, `Packages/SnapzyCLIKit/Sources/SnapzyCLICore/Output/OutputRenderer.swift`, `Snapzy/Features/Annotate/AnnotateState.swift`, `Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift`, `Snapzy/Features/Annotate/Components/AnnotateDropZoneView.swift`, … (+102 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — aws-s3 Error context canceled cloudflare-r2 Error context canceled Error response from daemon: pull access denied for minio/mc, repository does not exist or may require 'docker login': denied: requested access to the resource is denied; the earlier `compose pull` step reported: aws-s3 Error context canceled cloudflare-r2-bootstrap Error context canceled Error response from daemon: pull access denied for minio/minio, repository does not exist or may require 'docker login': denied: requested access to the resource is denied; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
96 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DrawingCanvasNSView.mouseUp at 55. A further 26 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 ShortcutConfig.keyCodeToString at 100 — they are counted neither in the figure above nor in this dimension's score. 14 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Snapzy/Services/Configuration/SnapzyConfigurationShortcutCodec.swift (SnapzyConfigurationShortcutCodec.keyCode at 66), Snapzy/Services/Capture/CaptureOverlayShortcutSettings.swift (CaptureOverlayShortcutSettings.legacyKeyCode at 28), Snapzy/Services/Capture/KeystrokeMonitorService.swift (KeystrokeMonitorService.specialKeyName at 28), Snapzy/App/SnapzyDeepLinkHandler.swift (SnapzyDeepLinkHandler.handle at 27), Snapzy/App/AppStatusBarController.swift (AppStatusBarController.makeMenuItem at 26), and 9 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 91 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 9 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with DrawingCanvasNSView.mouseUp (cyclomatic 55), ScrollingCaptureCoordinator.startAutoScrolling (cyclomatic 51), ScrollingCaptureCoordinator.refreshPreview (cyclomatic 48). — 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 9 together lifts Cyclomatic Complexity from 6.6 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 137 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 4 bodies over 60 down to 60 or less in Cognitive Complexity — start with DrawingCanvasNSView.mouseUp (cognitive 101), ScrollingCaptureCoordinator.refreshPreview (cognitive 85), ScrollingCaptureCoordinator.startAutoScrolling (cognitive 79). — 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 4 together lifts Cognitive Complexity from 6.0 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.3 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 38 FileTooLong finding(s) in God Classes — start with AnnotateState.swift, AreaSelectionWindow.swift, VideoEditorState.swift. — One of this dimension's main actionable groups (38 warning-level).
Resolve the 37 MethodTooLong finding(s) in God Classes — start with CaptureViewModel.swift (5), ScreenCaptureManager.swift (4), ScrollingCaptureStitcher.swift (2). — One of this dimension's main actionable groups (37 warning-level).
Resolve the 33 ClassTooLong finding(s) in God Classes — start with AreaSelectionWindow.swift (2), AnnotateState.swift, CaptureViewModel.swift. — One of this dimension's main actionable groups (33 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
346 duplicated block group(s) detected. A further 15 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 103 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 28 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with S3CloudProvider.swift (3), SnapzyMockAnnotateWindow.swift (2), VideoEditorSpeedTimelineTrack.swift (2). — One of this dimension's main actionable groups (28 warning-level).
Resolve the 25 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with PreferencesQuickAccessPreviewCard.swift (2), MenuBarCustomizationStore.swift, AnnotateState.swift. — One of this dimension's main actionable groups (25 warning-level).
Resolve the 24 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with ScreenCaptureManager.swift (2), SnapzyConfigurationShortcutsImporter.swift (2), KeyboardShortcutManager.swift (2). — One of this dimension's main actionable groups (24 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.7 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
6 production modules (SwiftPM+Xcode), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; a workspace's implicit (product-name) dependency is not visible there; 1 module(s) off the main sequence.
Off the main sequence: SnapzyCLIProtocol
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 18 Low cohesion finding(s) in Cohesion (LCOM4) — start with RecordingRegionOverlayWindow.swift (2), UpdaterManager.swift, SmartElementOverlayView.swift. — One of this dimension's main actionable groups (18 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
2418 test methods: 2418 unit, 0 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.2 / 10Stronggated by 110 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
Resolve the 77 No assertions finding(s) in Test Quality — start with AnnotationDragConstraintTests.swift (16), RecordingVideoCompatibilityLimiterTests.swift (12), RecordingSessionShortcutGatingTests.swift (5). — One of this dimension's main actionable groups (77 warning-level).
Resolve the 33 Skipped test finding(s) in Test Quality — start with OCRRecognitionTests.swift (5), HistoryPanelPositionTests.swift (4), AreaSelectionSessionLifecycleTests.swift (3). — One of this dimension's main actionable groups (33 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
4 outdated direct SwiftPM dependencies, 0 pinning defect(s). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
Outdated: grdb.swift · ×4
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 5 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 3 of them read from the licence file the repository carries at the revision REDACTED pins, and 2 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed REDACTED pins, direct and transitive, and every declared dependency none pins. 1 of them declare no licence that matches a known SPDX licence; that is missing data, not a violation, and none of them is charged.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift (17×55=935); Snapzy/Services/Configuration/SnapzyConfigurationDefaultDocument.swift (18×23=414); Snapzy/Features/Annotate/AnnotateState.swift (13×27=351) Repeated repair below the complexity floor: Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift (4 of 7 changes were fixes); Snapzy/Features/QuickAccess/Managers/QuickAccessPinWindow.swift (3 of 4 changes were fixes); Snapzy/Services/History/CaptureHistoryRetentionService.swift (3 of 4 changes were fixes)
Resolve the 27 Hotspot finding(s) in Churn × Complexity Hotspots — start with AnnotateCanvasDrawingView.swift, SnapzyConfigurationDefaultDocument.swift, AnnotateState.swift. — One of this dimension's main actionable groups (27 warning-level).
Resolve the 4 Repeated repair finding(s) in Churn × Complexity Hotspots — start with InlineAreaAnnotateSession.swift, QuickAccessPinWindow.swift, CaptureHistoryRetentionService.swift. — One of this dimension's main actionable groups (4 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 161374 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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
1 of 2 build units (SwiftPM, Xcode) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: 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).
12 finding(s): 0 critical, 12 high, 0 medium, 0 low. 10 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 24 file(s) — `Snapzy/Features/Annotate/AnnotateState.swift` (line 1636, line 1637, line 1638), `Snapzy/Features/Capture/CaptureViewModel.swift` (line 820, line 1158, line 1159, …), `Snapzy/Features/History/Managers/HistoryFloatingManager.swift` (lines 576–578), `Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift` (line 963), `Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift` (line 1440), … (+19 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 10 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (10 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
3 of 449 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Snapzy/Services/Capture/ActiveWindowResolver.swift. Counted over 449 of the 607 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 12 Change coupling finding(s) in Change Coupling — start with AnnotateAnnotationFactory.swift (2), SnapzyConfigurationExporter.swift, VideoEditorZoomPreviewOverlay.swift. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with ShortcutOverlayModels.swift, SnapzyConfigurationDefaultDocument.swift, AnnotateQuickPropertiesBar.swift. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code — check that business logic isn't leaking into the application/infrastructure layers (a thin domain is the anemic-domain smell).
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.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour — a data-only reference entity whose logic lives in a foreign service is anemic. Rich models enforce their own invariants.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a reference entity protects its own invariants — a class whose identity is a computed content hash but whose hashed fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain entity fused to a persistence ORM on its own declaration (active-record), or reaching a web-framework transport type in its own method, couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
`CloudUploadRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Snapzy/Services/Cloud/CloudUploadRecord.swift:12
`CaptureHistoryRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository). — Snapzy/Services/History/CaptureHistoryRecord.swift:30
What to do
Keep the ORM/table mapping and web-framework types on a boundary adapter; leave the domain entity framework-free (map row↔domain through a repository).
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
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 README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
55/76 types (72%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
What to do
Keep implementation types off the public surface (Swift: leave it `internal` (the default) instead of `public`) so internals can change without breaking consumers.
Do you agree with this assessment?
P2 · Observability5.5 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `Packages/SnapzyCLIKit`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Consider OpenTelemetry tracing/metrics (swift-otel with swift-distributed-tracing) and a health-check endpoint (a /health route on your Vapor/Hummingbird router) for operability.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 57637 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
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
What to do
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 40 use(s) across 181,729 production line(s) (~0.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`run` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Snapzy/Services/CommandLine/CLIToolInstaller.swift:191
`sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Snapzy/Features/QuickAccess/Services/QuickAccessCountdownTimer.swift:24
What to do
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×12) — Snapzy/Services/Wallpaper/SystemWallpaperManager.swift:146, Snapzy/Services/Capture/AreaSelectionWindow.swift:308, Snapzy/Services/Capture/AreaSelectionWindow.swift:1025, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. — Snapzy/Services/Diagnostics/DiagnosticLogger.swift:317
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
What to do
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
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.
Not included — 57 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's Ruby 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; 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 function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. 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
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 18 — an image could not be pulled) — aws-s3 Error context canceled cloudflare-r2 Error context canceled Error response from daemon: pull access denied for minio/mc, repository does not exist or may require 'docker login': denied: requested access to the resource is denied; the earlier `compose pull` step reported: aws-s3 Error context canceled cloudflare-r2-bootstrap Error context canceled Error response from daemon: pull access denied for minio/minio, repository does not exist or may require 'docker login': denied: requested access to the resource is denied; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, Swift not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rb, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 107 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
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
D8 Code Coverage — Coverage not measured — Swift suite
DM1 Aggregate boundaries — not scored for Swift: the sidecar flattens array/collection types (a child COLLECTION = legitimate membership vs a single embedded aggregate is indistinguishable), and aggregate-vs-value-object classification cannot be told apart in source (every struct-holding-struct reads alike) — reported as guidance rather than measured
DM2 Strongly-typed ids — no in-repo typed-id idiom — primitive-obsession recorded as advisory DM8, DM2 not gated
DM3 Integration-event coupling — not scored for Swift: a cross-SwiftPM-target domain leak cannot be told apart in source from a legitimate shared-kernel/contracts module, and most repositories ship a single module — reported as guidance rather than measured
DM7 Repository granularity — not scored for Swift: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, Ruby, Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Domain fused to persistence infrastructure: CloudUploadRecord Snapzy/Services/Cloud/CloudUploadRecord.swift:12— `CloudUploadRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
Domain fused to persistence infrastructure: CaptureHistoryRecord Snapzy/Services/History/CaptureHistoryRecord.swift:30— `CaptureHistoryRecord` is a domain concept fused to persistence ON ITS OWN DECLARATION (the GRDB `PersistableRecord`/`FetchableRecord` conformance), with no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain type. Keep the ORM/table mapping on a boundary adapter and the domain entity framework-free (or map row↔domain through a repository).
No assertions: testThemeManager_preferredAppearanceMutation_publishesObjectWillChange SnapzyTests/Services/WindowSurfacePaletteTests.swift:71— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testPrimaryAnnotationColorAppliesAcrossToolDefaults SnapzyTests/Features/Annotate/AnnotateCoreTests.swift:3854— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testPrimaryAnnotationColorPersistsAcrossAnnotateStateInstances SnapzyTests/Features/Annotate/AnnotateCoreTests.swift:3871— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRectangleMakesPositiveDragSquare SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:9— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRectanglePreservesNegativeQuadrant SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:15— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRectangleVerticalDownUsesPositiveHorizontalDirection SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:21— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOvalMakesSquareBounds SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:27— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOvalHorizontalLeftUsesNegativeVerticalDirection SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:33— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testFilledRectangleMakesSquareBounds SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:39— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testZeroLengthRectangleDragRemainsAtStart SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:45— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRectangleStopsAtRightBoundaryWithoutChangingAxisDirections SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:51— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testFilledRectangleStopsAtLeftBoundary SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:62— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOvalStopsAtTopBoundary SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:73— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testOvalStopsAtBottomBoundary SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:84— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testZeroLengthLineDragRemainsAtStart SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:113— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLineTrimsDiagonalAtRightBoundary SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:119— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testStraightArrowTrimsDiagonalAtTopBoundary SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:139— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCurvedArrowDoesNotChange SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:151— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testShiftNotHeldDoesNotChangeEndPoint SnapzyTests/Features/Annotate/AnnotationDragConstraintTests.swift:163— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testHorizontalEdgesAreFlippedToBottomLeftOrigin SnapzyTests/Features/Annotate/CropContentAnalyzerTests.swift:71— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRetinaPointMappingHalvesEdgePositions SnapzyTests/Features/Annotate/CropContentAnalyzerTests.swift:100— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testDownscaledAnalysisKeepsBorderPositions SnapzyTests/Features/Annotate/CropContentAnalyzerTests.swift:107— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLocalArrowMonitorRoutesShiftAppDispatchedPanelArrow SnapzyTests/Features/History/HistoryFloatingPinTests.swift:95— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testStartStopCleanupTimer_noCrash SnapzyTests/Features/Recording/RecordingAnnotationStateTests.swift:97— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testSetOnFirstVideoFrame_doesNotCrash SnapzyTests/Features/Recording/RecordingSessionTests.swift:57— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
FileTooLong: Annotate/AnnotateState.swift Snapzy/Features/Annotate/AnnotateState.swift— FileTooLong — 4034 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AnnotateState (16-5997). The bar is 500 significant lines; this is 3534 over it, 8.07× 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: Capture/AreaSelectionWindow.swift Snapzy/Services/Capture/AreaSelectionWindow.swift— FileTooLong — 3011 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2511 over it, 6.02× 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: VideoEditor/VideoEditorState.swift Snapzy/Features/VideoEditor/VideoEditorState.swift— FileTooLong — 2233 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: VideoEditorState (312-3466). The bar is 500 significant lines; this is 1733 over it, 4.47× 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: Capture/CaptureViewModel.swift Snapzy/Features/Capture/CaptureViewModel.swift— FileTooLong — 2082 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ScreenCaptureViewModel (39-3022). The bar is 500 significant lines; this is 1582 over it, 4.16× 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: Annotate/InlineAreaAnnotateWindow.swift Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift— FileTooLong — 2047 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1547 over it, 4.09× 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: Capture/ScreenCaptureManager.swift Snapzy/Services/Capture/ScreenCaptureManager.swift— FileTooLong — 1997 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: ScreenCaptureManager (130-2881). The bar is 500 significant lines; this is 1497 over it, 3.99× 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: Components/AnnotateCanvasDrawingView.swift Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift— FileTooLong — 1912 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: DrawingCanvasNSView (281-2998). The bar is 500 significant lines; this is 1412 over it, 3.82× 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: ScrollingCapture/ScrollingCaptureCoordinator.swift Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift— FileTooLong — 1675 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ScrollingCaptureCoordinator (17-2217). The bar is 500 significant lines; this is 1175 over it, 3.35× 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: ScrollingCapture/ScrollingCaptureStitcher.swift Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift— FileTooLong — 1661 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1161 over it, 3.32× 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: Capture/ScreenRecordingManager.swift Snapzy/Services/Capture/ScreenRecordingManager.swift— FileTooLong — 1600 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: ScreenRecordingManager (684-2286). The bar is 500 significant lines; this is 1100 over it, 3.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: Shortcuts/KeyboardShortcutManager.swift Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift— FileTooLong — 1403 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: KeyboardShortcutManager (592-1997). The bar is 500 significant lines; this is 903 over it, 2.81× 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: Models/AnnotateAnnotationItem.swift Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift— FileTooLong — 1317 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 817 over it, 2.63× 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: Components/AnnotateQuickPropertiesBar.swift Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift— FileTooLong — 1295 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 795 over it, 2.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Components/PreferencesShortcutsSettingsView.swift Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift— FileTooLong — 1158 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: ShortcutsSettingsView (12-1182). The bar is 500 significant lines; this is 658 over it, 2.32× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: QuickAccess/QuickAccessManager.swift Snapzy/Features/QuickAccess/QuickAccessManager.swift— FileTooLong — 1067 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: QuickAccessManager (35-1666). The bar is 500 significant lines; this is 567 over it, 2.13× 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: Recording/RecordingCoordinator.swift Snapzy/Features/Recording/RecordingCoordinator.swift— FileTooLong — 990 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: RecordingCoordinator (13-1488). The bar is 500 significant lines; this is 490 over it, 1.98× 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: Components/PreferencesCloudSettingsView.swift Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift— FileTooLong — 980 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 480 over it, 1.96× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: App/AppStatusBarController.swift Snapzy/App/AppStatusBarController.swift— FileTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: AppStatusBarController (15-1438). The bar is 500 significant lines; this is 465 over it, 1.93× 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: Managers/AnnotateWindowController.swift Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift— FileTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: AnnotateWindowController (39-1469). The bar is 500 significant lines; this is 408 over it, 1.82× 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: Services/AnnotateExporter.swift Snapzy/Features/Annotate/Services/AnnotateExporter.swift— FileTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: AnnotateExporter (16-1050). The bar is 500 significant lines; this is 299 over it, 1.60× 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: REDACTED REDACTED— FileTooLong — 750 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CloudManager (20-1066). The bar is 500 significant lines; this is 250 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Services/AnnotateBlurEffectRenderer.swift Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift— FileTooLong — 745 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 245 over it, 1.49× 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: Components/PreferencesCloudUploadHistoryView.swift Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift— FileTooLong — 737 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 237 over it, 1.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Managers/RecordingRegionOverlayWindow.swift Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift— FileTooLong — 685 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: RecordingRegionOverlayView (190-1092). The bar is 500 significant lines; this is 185 over it, 1.37× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Components/PreferencesCapturePreview.swift Snapzy/Features/Preferences/Components/PreferencesCapturePreview.swift— FileTooLong — 662 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: CaptureSettingsPreview (20-758). The bar is 500 significant lines; this is 162 over it, 1.32× 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.
MethodTooLong: CaptureSettingsView.body Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift:129— MethodTooLong — body runs 422 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 322 over it, 4.22× 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: ScrollingCaptureStitcher.append Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:473— MethodTooLong — append runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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: CloudCredentialFormView.body Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:856— MethodTooLong — body runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× 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: AnnotateQuickPropertiesBar.activePropertiesContent Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:179— MethodTooLong — activePropertiesContent runs 245 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ScrollingCaptureCoordinator.refreshPreview Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:791— MethodTooLong — refreshPreview runs 233 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AppStatusBarController.makeMenuItem Snapzy/App/AppStatusBarController.swift:619— MethodTooLong — makeMenuItem runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ScreenRecordingManager.prepareRecording Snapzy/Services/Capture/ScreenRecordingManager.swift:797— MethodTooLong — prepareRecording runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.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: VideoEditorExporter.exportWithZooms Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:206— MethodTooLong — exportWithZooms runs 214 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 114 over it, 2.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: ScreenCaptureViewModel.startFrozenAreaSelection Snapzy/Features/Capture/CaptureViewModel.swift:1086— MethodTooLong — startFrozenAreaSelection runs 191 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 91 over it, 1.91× 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: ScreenCaptureViewModel.captureOCR Snapzy/Features/Capture/CaptureViewModel.swift:2409— MethodTooLong — captureOCR runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× 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: AnnotateExporter.renderFlatFinalImage Snapzy/Features/Annotate/Services/AnnotateExporter.swift:403— MethodTooLong — renderFlatFinalImage runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× 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: ScrollingCaptureCoordinator.startAutoScrolling Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:265— MethodTooLong — startAutoScrolling runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× 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: ScrollingCaptureStitcher.bestMatch Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1269— MethodTooLong — bestMatch runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× 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: ScreenCaptureViewModel.captureObjectCutout Snapzy/Features/Capture/CaptureViewModel.swift:2739— MethodTooLong — captureObjectCutout runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: AreaSelectionController.startSelectionSession Snapzy/Services/Capture/AreaSelectionWindow.swift:562— MethodTooLong — startSelectionSession runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: InlineAreaPropertiesBar.body Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:1857— MethodTooLong — body runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DrawingCanvasNSView.mouseUp Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1617— MethodTooLong — mouseUp runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ScreenCaptureViewModel.startAreaCapture Snapzy/Features/Capture/CaptureViewModel.swift:702— MethodTooLong — startAreaCapture runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ScrollingCaptureAccuracyBenchmark.corpus scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:24— MethodTooLong — corpus 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: ShortcutsView.body Snapzy/Features/Onboarding/Components/OnboardingShortcutsView.swift:22— MethodTooLong — body runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: KeyboardShortcutManager.registerShortcuts Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1573— MethodTooLong — registerShortcuts runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DrawingCanvasNSView.mouseDragged Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1271— MethodTooLong — mouseDragged runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× 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: AnnotateCanvasView.canvasContent Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:224— MethodTooLong — canvasContent runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HistorySettingsView.body Snapzy/Features/Preferences/Components/PreferencesHistorySettingsView.swift:18— MethodTooLong — body runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× 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: FrozenAreaCaptureSession.cropCompositeImage Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:228— MethodTooLong — cropCompositeImage runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
ClassTooLong: AnnotateState Snapzy/Features/Annotate/AnnotateState.swift:15— ClassTooLong — 3927 significant lines (blank, comment-only and punctuation-only lines excluded), 234 methods. The bar is 400 significant lines; this is 3527 over it, 9.82× 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: ScreenCaptureViewModel Snapzy/Features/Capture/CaptureViewModel.swift:38— ClassTooLong — 2064 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 1664 over it, 5.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VideoEditorState Snapzy/Features/VideoEditor/VideoEditorState.swift:311— ClassTooLong — 2028 significant lines (blank, comment-only and punctuation-only lines excluded), 126 methods. The bar is 400 significant lines; this is 1628 over it, 5.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ScreenCaptureManager Snapzy/Services/Capture/ScreenCaptureManager.swift:129— ClassTooLong — 1909 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 1509 over it, 4.77× 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: DrawingCanvasNSView Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:281— ClassTooLong — 1764 significant lines (blank, comment-only and punctuation-only lines excluded), 91 methods. The bar is 400 significant lines; this is 1364 over it, 4.41× 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: ScrollingCaptureCoordinator Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:16— ClassTooLong — 1635 significant lines (blank, comment-only and punctuation-only lines excluded), 85 methods. The bar is 400 significant lines; this is 1235 over it, 4.09× 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: AreaSelectionController Snapzy/Services/Capture/AreaSelectionWindow.swift:57— ClassTooLong — 1389 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 400 significant lines; this is 989 over it, 3.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: AreaSelectionOverlayView Snapzy/Services/Capture/AreaSelectionWindow.swift:2751— ClassTooLong — 1290 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 400 significant lines; this is 890 over it, 3.23× 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: ScreenRecordingManager Snapzy/Services/Capture/ScreenRecordingManager.swift:683— ClassTooLong — 1113 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 713 over it, 2.78× 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: QuickAccessManager Snapzy/Features/QuickAccess/QuickAccessManager.swift:34— ClassTooLong — 1050 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 650 over it, 2.63× 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: RecordingCoordinator Snapzy/Features/Recording/RecordingCoordinator.swift:12— ClassTooLong — 973 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 573 over it, 2.43× 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: AppStatusBarController Snapzy/App/AppStatusBarController.swift:14— ClassTooLong — 959 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 559 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: KeyboardShortcutManager Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:591— ClassTooLong — 955 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 555 over it, 2.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: ShortcutsSettingsView Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:12— ClassTooLong — 891 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 491 over it, 2.23× 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: AnnotateWindowController Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:38— ClassTooLong — 887 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 487 over it, 2.22× 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: CloudManager REDACTED:19— ClassTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 342 over it, 1.86× 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: AnnotateExporter Snapzy/Features/Annotate/Services/AnnotateExporter.swift:15— ClassTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 314 over it, 1.79× 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: HistoryFloatingContentView Snapzy/Features/History/Components/HistoryFloatingContentView.swift:11— ClassTooLong — 649 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 249 over it, 1.62× 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: VideoEditorExporter Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:12— ClassTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 246 over it, 1.62× 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: CaptureSettingsView Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift:45— ClassTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 191 over it, 1.48× 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: RecordingRegionOverlayView Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:190— ClassTooLong — 581 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 181 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VideoEditorWindowController Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:29— ClassTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 153 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OCRService Snapzy/Services/Media/OCRService.swift:31— ClassTooLong — 499 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 99 over it, 1.25× 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: InlineAreaAnnotateSession Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift:55— ClassTooLong — 489 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 89 over it, 1.22× 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: AreaSelectionMagnifier Snapzy/Services/Capture/AreaSelectionMagnifier.swift:4— ClassTooLong — 485 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 85 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (8 lines × 2) Snapzy/Features/Annotate/AnnotateState.swift:807— Snapzy/Features/Annotate/AnnotateState.swift:807-816 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:928-935 — 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 `Snapzy/Features/Annotate/AnnotateState.swift:807` 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 (8 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:19— Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:19-26 | Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:455-462 — 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 `Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:166— Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:166-173 | Snapzy/Features/Recording/Services/RecordingAnnotationFactory.swift:55-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Features/Onboarding/Components/OnboardingVSDesignSystem.swift:169— Snapzy/Features/Onboarding/Components/OnboardingVSDesignSystem.swift:169-176 | Snapzy/Features/Onboarding/Components/OnboardingVSDesignSystem.swift:205-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/Components/OnboardingVSDesignSystem.swift:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:51— Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:51-58 | Snapzy/Shared/Extensions/View+CornerRadius.swift:35-42 — before extracting anything, compare `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift` and `Snapzy/Shared/Extensions/View+CornerRadius.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:92— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:92-99 | Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:117-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `3` in one and `3.5` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:120— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:120-127 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:198-205 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:120` 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, `Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:196` calls `foregroundStyle` and `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:119` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessCard.swift:114— Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessCard.swift:114-121 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessCard.swift:159-166 — both copies are in the same file, so extract the 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessCard.swift:114` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:295— Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:295-302 | Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:307-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Snapzy/Features/Preferences/Components/PreferencesAboutFeatureCard.swift:42— Snapzy/Features/Preferences/Components/PreferencesAboutFeatureCard.swift:42-49 | Snapzy/Features/Preferences/Components/PreferencesAboutLinkCard.swift:42-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. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Preferences/Components/PreferencesAboutFeatureCard.swift:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Preferences/Components/PreferencesAboutLinkCard.swift:51` calls `buttonStyle` and `Snapzy/Features/Preferences/Components/PreferencesAboutFeatureCard.swift:50` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewSlotViews.swift:69— Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewSlotViews.swift:69-76 | Snapzy/Features/Preferences/Components/PreferencesQuickAccessSwipeZoneView.swift:24-31 — 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 `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewSlotViews.swift:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewSlotViews.swift:77` calls `opacity`, `help` and `Snapzy/Features/Preferences/Components/PreferencesQuickAccessSwipeZoneView.swift:32` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:814— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:814-821 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:669-676 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:814` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:951— Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:951-958 | Snapzy/Services/Capture/CaptureOutputNaming.swift:131-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:951` 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 (8 lines × 2) Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:352— Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:352-359 | Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:387-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Snapzy/Features/VideoEditor/VideoEditorState.swift:1512— Snapzy/Features/VideoEditor/VideoEditorState.swift:1512-1519 | Snapzy/Features/VideoEditor/VideoEditorState.swift:1541-1548 — both copies are in the same file, so extract the 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 `Snapzy/Features/VideoEditor/VideoEditorState.swift:1512` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) REDACTED:477— REDACTED:477-484 | REDACTED:985-992 — both copies are in the same file, so extract the 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 `REDACTED:477` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) REDACTED:495— REDACTED:495-502 | REDACTED:1003-1010 — both copies are in the same file, so extract the 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 `REDACTED:495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:296— Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:296-303 | Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:359-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:357` calls `setValue` and `Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:295` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Snapzy/Services/Cloud/S3CloudProvider.swift:330— Snapzy/Services/Cloud/S3CloudProvider.swift:330-337 | Snapzy/Services/Cloud/S3CloudProvider.swift:364-371 — both copies are in the same file, so extract the 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 `Snapzy/Services/Cloud/S3CloudProvider.swift:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Services/Cloud/S3CloudProvider.swift:403— Snapzy/Services/Cloud/S3CloudProvider.swift:403-410 | Snapzy/Services/Cloud/S3MultipartUploader.swift:310-317 — 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 `Snapzy/Services/Cloud/S3CloudProvider.swift:403` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Snapzy/Services/Media/ForegroundCutoutService.swift:79— Snapzy/Services/Media/ForegroundCutoutService.swift:79-86 | Snapzy/Services/Media/ForegroundCutoutService.swift:121-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/Media/ForegroundCutoutService.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 (8 lines × 2) Snapzy/Services/Media/OCRService.swift:581— Snapzy/Services/Media/OCRService.swift:581-588 | Snapzy/Services/Media/QRCodeService.swift:91-98 — 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 `Snapzy/Services/Media/OCRService.swift:581` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) tools/localization/CatalogTool.swift:399— tools/localization/CatalogTool.swift:399-406 | tools/localization/CatalogTool.swift:409-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:32— Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:32-39 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:29-36 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) Snapzy/Features/Recording/Components/RecordingToolbarCameraToggleButton.swift:126— Snapzy/Features/Recording/Components/RecordingToolbarCameraToggleButton.swift:126-133 | Snapzy/Features/Recording/Components/RecordingToolbarMicToggleButton.swift:90-97 — 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.
Hotspot: Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1617— Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in DrawingCanvasNSView.mouseUp at line 1617. 6 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.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: Snapzy/Services/Configuration/SnapzyConfigurationDefaultDocument.swift Snapzy/Services/Configuration/SnapzyConfigurationDefaultDocument.swift:280— Snapzy/Services/Configuration/SnapzyConfigurationDefaultDocument.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in SnapzyConfigurationDefaultDocument.globalShortcut at line 280. 3 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Configuration/SnapzyConfigurationDefaultDocument.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: Snapzy/Features/Annotate/AnnotateState.swift Snapzy/Features/Annotate/AnnotateState.swift:3939— Snapzy/Features/Annotate/AnnotateState.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in AnnotateState.updateAnnotationProperties at line 3939. 3 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/AnnotateState.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: Snapzy/Features/Capture/CaptureViewModel.swift Snapzy/Features/Capture/CaptureViewModel.swift:349— Snapzy/Features/Capture/CaptureViewModel.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ScreenCaptureViewModel.shortcutTriggered at line 349. 2 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Capture/CaptureViewModel.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: Snapzy/Services/Capture/AreaSelectionWindow.swift Snapzy/Services/Capture/AreaSelectionWindow.swift:562— Snapzy/Services/Capture/AreaSelectionWindow.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in AreaSelectionController.startSelectionSession at line 562. 7 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Capture/AreaSelectionWindow.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: Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift:354— Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in SnapzyConfigurationImporter.collectQuickAccess at line 354. 2 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Configuration/SnapzyConfigurationImporter.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: Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1253— Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in KeyboardShortcutManager.loadShortcuts at line 1253. 1 of those changes was a fix/bug commit, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Shortcuts/KeyboardShortcutManager.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: Snapzy/App/AppStatusBarController.swift Snapzy/App/AppStatusBarController.swift:619— Snapzy/App/AppStatusBarController.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in AppStatusBarController.makeMenuItem at line 619. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/App/AppStatusBarController.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: Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift:129— Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in CaptureSettingsView.body at line 129. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.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: Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:1005— Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ShortcutsSettingsView.handleGlobalShortcutChange at line 1005. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.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: Snapzy/App/SnapzyDeepLinkHandler.swift Snapzy/App/SnapzyDeepLinkHandler.swift:19— Snapzy/App/SnapzyDeepLinkHandler.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in SnapzyDeepLinkHandler.handle at line 19. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/App/SnapzyDeepLinkHandler.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: Snapzy/Services/Capture/ScreenCaptureManager.swift Snapzy/Services/Capture/ScreenCaptureManager.swift:2122— Snapzy/Services/Capture/ScreenCaptureManager.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in ScreenCaptureManager.captureWindowImage at line 2122. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Capture/ScreenCaptureManager.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: Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:265— Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in ScrollingCaptureCoordinator.startAutoScrolling at line 265. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.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: Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:179— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in AnnotateQuickPropertiesBar.activePropertiesContent at line 179. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.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: Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:234— Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in InlineAreaAnnotateRootView.body at line 234. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/InlineAreaAnnotateWindow.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: Snapzy/Features/Recording/RecordingCoordinator.swift Snapzy/Features/Recording/RecordingCoordinator.swift:708— Snapzy/Features/Recording/RecordingCoordinator.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in RecordingCoordinator.startRecording at line 708. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Recording/RecordingCoordinator.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: Snapzy/Services/Configuration/SnapzyConfigurationShortcutCodec.swift Snapzy/Services/Configuration/SnapzyConfigurationShortcutCodec.swift:57— Snapzy/Services/Configuration/SnapzyConfigurationShortcutCodec.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in SnapzyConfigurationShortcutCodec.keyCode at line 57. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Configuration/SnapzyConfigurationShortcutCodec.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: Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:224— Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in AnnotateCanvasView.canvasContent at line 224. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/Components/AnnotateCanvasView.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: Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift:147— Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in GlobalShortcutKind.configKey at line 147. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.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: Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:377— Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in KeyboardShortcutManager.setShortcut at line 377. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.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: Snapzy/Features/Recording/RecordingSession.swift Snapzy/Features/Recording/RecordingSession.swift:170— Snapzy/Features/Recording/RecordingSession.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in RecordingSession.appendVideoSample at line 170. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Recording/RecordingSession.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: Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:131— Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in AnnotationRenderer.drawCurrentStroke at line 131. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.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: Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:56— Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in AnnotationFactory.createAnnotation at line 56. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.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: Snapzy/Features/Annotate/Services/AnnotateExporter.swift Snapzy/Features/Annotate/Services/AnnotateExporter.swift:403— Snapzy/Features/Annotate/Services/AnnotateExporter.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in AnnotateExporter.renderFlatFinalImage at line 403. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/Services/AnnotateExporter.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: Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:473— Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in ScrollingCaptureStitcher.append at line 473. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (7 lines × 2) Snapzy/App/MenuBarCustomizationStore.swift:67— Snapzy/App/MenuBarCustomizationStore.swift:67-73 | Snapzy/Features/QuickAccess/Models/QuickAccessActionConfigurationStore.swift:82-88 — 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) Snapzy/Features/Annotate/AnnotateState.swift:3406— Snapzy/Features/Annotate/AnnotateState.swift:3406-3412 | Snapzy/Features/Annotate/AnnotateState.swift:3422-3428 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/AnnotateState.swift:3406` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) Snapzy/Features/Annotate/Components/AnnotateCropOverlayView.swift:116— Snapzy/Features/Annotate/Components/AnnotateCropOverlayView.swift:116-122 | Snapzy/Features/Annotate/Components/AnnotateCutOutOverlayView.swift:112-118 — 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 (7 lines × 2) Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:103— Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:103-113 | Snapzy/Features/Recording/Services/RecordingAnnotationFactory.swift:38-44 — 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 `Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:103` 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 × 2) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:56— Snapzy/Features/Annotate/Services/AnnotateExporter.swift:56-62 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:79-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:63` calls `play` and `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:86` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) Snapzy/Features/History/Components/HistoryCardView.swift:135— Snapzy/Features/History/Components/HistoryCardView.swift:135-141 | Snapzy/Features/History/Components/HistoryItemView.swift:36-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/History/Components/HistoryCardView.swift:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Snapzy/Features/History/HistoryWindowController.swift:60— Snapzy/Features/History/HistoryWindowController.swift:60-66 | Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:174-180 — 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 `Snapzy/Features/History/HistoryWindowController.swift:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:178— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:178-184 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:78-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:178` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:15— Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:15-21 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:47-53 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.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 (7 lines × 2) Snapzy/Features/Preferences/Components/PreferencesAboutSettingsView.swift:177— Snapzy/Features/Preferences/Components/PreferencesAboutSettingsView.swift:177-183 | Snapzy/Features/Preferences/Components/PreferencesUpdateChannelSection.swift:20-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:154— Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:154-160 | Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:170-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 `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:154` 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, `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:177` calls `opacity`, `allowsHitTesting` and `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:161` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:231— Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:231-237 | Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:248-254 — both copies are in the same file, so extract the 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 `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:231` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:255` calls `padding` and `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewCard.swift:238` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) Snapzy/Services/Capture/RecordingMetadata.swift:236— Snapzy/Services/Capture/RecordingMetadata.swift:236-242 | Snapzy/Services/Capture/RecordingMetadata.swift:649-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Snapzy/Services/Capture/ScreenRecordingManager.swift:396— Snapzy/Services/Capture/ScreenRecordingManager.swift:396-402 | Snapzy/Services/Capture/ScreenRecordingManager.swift:405-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStickyEdges.swift:98— Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStickyEdges.swift:98-104 | Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStickyEdges.swift:167-173 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStickyEdges.swift:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) Snapzy/Services/History/CaptureHistoryRetentionService.swift:69— Snapzy/Services/History/CaptureHistoryRetentionService.swift:69-75 | Snapzy/Services/History/CaptureHistoryStore.swift:494-500 — 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 (7 lines × 2) Packages/SnapzyCLIKit/Sources/SnapzyCLIProtocol/Models/CaptureRequest.swift:24— Packages/SnapzyCLIKit/Sources/SnapzyCLIProtocol/Models/CaptureRequest.swift:24-30 | Snapzy/Features/Capture/CaptureViewModel.swift:27-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:687— Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:687-693 | Snapzy/Features/Preferences/Components/PreferencesSidebarView.swift:513-519 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:102— Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:102-108 | Snapzy/Features/VideoEditor/Managers/VideoEditorWindow.swift:64-70 — 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) Snapzy/Features/Capture/OCRLinkPromptManager.swift:144— Snapzy/Features/Capture/OCRLinkPromptManager.swift:144-150 | Snapzy/Services/Diagnostics/AppToastManager.swift:407-413 — 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) Snapzy/Features/Onboarding/DesignSystem/SnapzyGlassSurface.swift:39— Snapzy/Features/Onboarding/DesignSystem/SnapzyGlassSurface.swift:39-45 | Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassVibrancy.swift:16-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:732— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:732-738 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:628-634 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) Snapzy/Features/Annotate/Services/AnnotateMockupExporter.swift:82— Snapzy/Features/Annotate/Services/AnnotateMockupExporter.swift:82-88 | Snapzy/Services/Clipboard/ClipboardHelper.swift:363-369 — 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) Snapzy/Features/VideoEditor/Models/VideoEditorSpeedSegment.swift:98— Snapzy/Features/VideoEditor/Models/VideoEditorSpeedSegment.swift:98-104 | Snapzy/Features/VideoEditor/Models/VideoEditorZoomSegment.swift:141-147 — 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 (7 lines × 2) Snapzy/Services/Capture/ColorPicker/ColorPickerOverlayWindow.swift:153— Snapzy/Services/Capture/ColorPicker/ColorPickerOverlayWindow.swift:153-159 | Snapzy/Services/Capture/SmartElement/SmartElementOverlayView.swift:100-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
TooManyMethods: AnnotateState Snapzy/Features/Annotate/AnnotateState.swift:15— TooManyMethods — 234 methods. The bar is 30 methods; this is 204 over it, 7.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VideoEditorState Snapzy/Features/VideoEditor/VideoEditorState.swift:311— TooManyMethods — 126 methods. The bar is 30 methods; this is 96 over it, 4.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AreaSelectionController Snapzy/Services/Capture/AreaSelectionWindow.swift:57— TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DrawingCanvasNSView Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:281— TooManyMethods — 91 methods. The bar is 30 methods; this is 61 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AreaSelectionOverlayView Snapzy/Services/Capture/AreaSelectionWindow.swift:2751— TooManyMethods — 89 methods. The bar is 30 methods; this is 59 over it, 2.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScrollingCaptureCoordinator Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:16— TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AppStatusBarController Snapzy/App/AppStatusBarController.swift:14— TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScreenCaptureManager Snapzy/Services/Capture/ScreenCaptureManager.swift:129— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: QuickAccessManager Snapzy/Features/QuickAccess/QuickAccessManager.swift:34— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RecordingCoordinator Snapzy/Features/Recording/RecordingCoordinator.swift:12— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AnnotateWindowController Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:38— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScreenCaptureViewModel Snapzy/Features/Capture/CaptureViewModel.swift:38— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: KeyboardShortcutManager Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:591— TooManyMethods — 55 methods, declared across 2 files: Shortcuts/KeyboardShortcutManager.swift (54), Configuration/SnapzyConfigurationShortcutsImporter.swift (1). The bar is 30 methods; this is 25 over it, 1.83× 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: InlineAreaAnnotateSession Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift:55— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScreenRecordingManager Snapzy/Services/Capture/ScreenRecordingManager.swift:683— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScrollingCaptureStitcher Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:73— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CloudManager REDACTED:19— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RecordingRegionOverlayView Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:190— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: View Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:882— TooManyMethods — 36 methods, declared across 17 files: Extensions/NSWindow+WindowSpacing.swift (10), LiquidGlass/LiquidGlassControlChrome.swift (3), Extensions/View+CornerRadius.swift (3), Styles/DesignTokens.swift (3), +13 more file(s). The bar is 30 methods; this is 6 over it, 1.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AnnotateExporter Snapzy/Features/Annotate/Services/AnnotateExporter.swift:15— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VideoEditorWindowController Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:29— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OCRService Snapzy/Services/Media/OCRService.swift:31— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AnnotateShortcutManager Snapzy/Features/Annotate/Services/AnnotateShortcutManager.swift:23— TooManyMethods — 32 methods, declared across 2 files: Services/AnnotateShortcutManager.swift (31), Configuration/SnapzyConfigurationShortcutsImporter.swift (1). The bar is 30 methods; this is 2 over it, 1.07× 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: SnapzyConfigurationService Snapzy/Services/Configuration/SnapzyConfigurationService.swift:10— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (5 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1300— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1300-1304 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2704-2708 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:49— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:49-53 | Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:73-77 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:121— Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:121-125 | Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:136-141 — both copies are in the same file, so extract the 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `3` in one and `6` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) Snapzy/Services/Capture/ScreenCaptureManager.swift:1729— Snapzy/Services/Capture/ScreenCaptureManager.swift:1729-1733 | Snapzy/Services/Capture/ScreenCaptureManager.swift:1744-1748 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/ScreenCaptureManager.swift:1729` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Snapzy/Services/Capture/ScreenCaptureManager.swift:2059— Snapzy/Services/Capture/ScreenCaptureManager.swift:2059-2063 | Snapzy/Services/Capture/ScreenRecordingManager.swift:1834-1839 — 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 `Snapzy/Services/Capture/ScreenCaptureManager.swift:2059` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:53— Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:53-57 | Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:207-211 — both copies are in the same file, so extract the 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 `Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:162— Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:162-166 | Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:283-287 — both copies are in the same file, so extract the 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 `Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:162` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) tools/localization/CatalogTool.swift:350— tools/localization/CatalogTool.swift:350-354 | tools/localization/CatalogTool.swift:383-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tools/localization/CatalogTool.swift:350` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Snapzy/Features/Annotate/AnnotateManager.swift:341— Snapzy/Features/Annotate/AnnotateManager.swift:341-345 | Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:373-377 — 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) Snapzy/Features/Onboarding/Components/OnboardingPermissionsView.swift:276— Snapzy/Features/Onboarding/Components/OnboardingPermissionsView.swift:276-280 | Snapzy/Features/Preferences/Components/PreferencesPermissionsSettingsView.swift:271-275 — 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) Snapzy/Features/Onboarding/DesignSystem/SnapzyGlassSurface.swift:47— Snapzy/Features/Onboarding/DesignSystem/SnapzyGlassSurface.swift:47-51 | Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassVibrancy.swift:24-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockShortcutsView.swift:167— Snapzy/Features/Onboarding/Mockups/SnapzyMockShortcutsView.swift:167-171 | Snapzy/Features/Preferences/Components/PreferencesAnnotatePreview.swift:245-249 — 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) Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:542— Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:542-546 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift:243-247 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) Snapzy/Services/Cloud/CloudUploadHistoryStore.swift:128— Snapzy/Services/Cloud/CloudUploadHistoryStore.swift:128-132 | Snapzy/Services/History/CaptureHistoryStore.swift:674-678 — 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) Snapzy/Services/Configuration/SnapzyConfigurationService.swift:29— Snapzy/Services/Configuration/SnapzyConfigurationService.swift:29-33 | Snapzy/Services/FileAccess/SandboxFileAccessManager.swift:29-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Snapzy/Features/QuickAccess/Models/QuickAccessPinZoomMode.swift:35— Snapzy/Features/QuickAccess/Models/QuickAccessPinZoomMode.swift:35-39 | Snapzy/Features/QuickAccess/Models/QuickAccessTrackpadSwipeModeStore.swift:29-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:140— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:140-144 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:119-123 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:749— Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:749-753 | Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:788-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Snapzy/Services/Capture/AreaSelectionMagnifier.swift:563— Snapzy/Services/Capture/AreaSelectionMagnifier.swift:563-567 | Snapzy/Services/Capture/AreaSelectionMagnifier.swift:572-576 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/AreaSelectionMagnifier.swift:563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:1305— Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:1305-1309 | Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:1335-1339 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:1305` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:126— Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:126-130 | Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:141-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:180— Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:180-184 | Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:388-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Snapzy/Shared/Components/DisplayCornerFrame.swift:76— Snapzy/Shared/Components/DisplayCornerFrame.swift:76-80 | Snapzy/Shared/Components/DisplayCornerFrame.swift:105-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) scripts/generate_dmg_background.py:328— scripts/generate_dmg_background.py:328-332 | scripts/generate_dmg_background.py:337-341 — both copies are in the same file, so extract the 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) Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:246— Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:246-254 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:1057-1065 — 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 `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:246` 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) Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:246— Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:246-254 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:110-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Snapzy/Features/Recording/Managers/MouseClickHighlightWindow.swift:270— Snapzy/Features/Recording/Managers/MouseClickHighlightWindow.swift:270-278 | Snapzy/Features/Recording/Managers/MouseClickHighlightWindow.swift:288-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Recording/Managers/MouseClickHighlightWindow.swift:279` calls `add` and `Snapzy/Features/Recording/Managers/MouseClickHighlightWindow.swift:298` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:259— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:259-267 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:228-236 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:259` 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) Snapzy/Features/VideoEditor/Services/VideoEditorAutoFocusEngine.swift:308— Snapzy/Features/VideoEditor/Services/VideoEditorAutoFocusEngine.swift:308-316 | Snapzy/Features/VideoEditor/Services/VideoEditorAutoFocusEngine.swift:354-362 — both copies are in the same file, so extract the 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 `Snapzy/Features/VideoEditor/Services/VideoEditorAutoFocusEngine.swift:308` 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) Snapzy/Services/Capture/AXElementSnapshot.swift:119— Snapzy/Services/Capture/AXElementSnapshot.swift:119-127 | Snapzy/Services/Capture/ActiveWindowResolver.swift:92-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Snapzy/Services/Capture/AXElementSnapshot.swift:129— Snapzy/Services/Capture/AXElementSnapshot.swift:129-137 | Snapzy/Services/Capture/ActiveWindowResolver.swift:102-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Snapzy/Services/Capture/AreaSelectionWindow.swift:726— Snapzy/Services/Capture/AreaSelectionWindow.swift:726-735 | Snapzy/Services/Capture/AreaSelectionWindow.swift:1358-1366 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/AreaSelectionWindow.swift:726` 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) Snapzy/Services/Capture/PostCaptureActionHandler.swift:266— Snapzy/Services/Capture/PostCaptureActionHandler.swift:266-274 | Snapzy/Services/Capture/PostCaptureActionHandler.swift:330-338 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/PostCaptureActionHandler.swift:266` 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) Snapzy/Services/Capture/ScreenRecordingManager.swift:1011— Snapzy/Services/Capture/ScreenRecordingManager.swift:1011-1019 | Snapzy/Services/Capture/ScreenRecordingManager.swift:1030-1040 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/ScreenRecordingManager.swift:1011` 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, `Snapzy/Services/Capture/ScreenRecordingManager.swift:1042` calls `deletingPathExtension` and `Snapzy/Services/Capture/ScreenRecordingManager.swift:1021` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Snapzy/Services/Cloud/CloudKeychainStore.swift:254— Snapzy/Services/Cloud/CloudKeychainStore.swift:254-262 | Snapzy/Services/Security/OCRKeychainStore.swift:134-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/Cloud/CloudKeychainStore.swift:254` 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) Snapzy/Services/Cloud/CloudUsageService.swift:470— Snapzy/Services/Cloud/CloudUsageService.swift:470-478 | Snapzy/Services/Cloud/CloudUsageService.swift:506-514 — both copies are in the same file, so extract the 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 `Snapzy/Services/Cloud/CloudUsageService.swift:470` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:319— Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:319-327 | Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:411-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:407` calls `Int64`, `progress`, `Double` and `Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:317` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:126— Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:126-134 | Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:545-553 — both copies are in the same file, so extract the 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 `Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) Snapzy/Services/Cloud/S3CloudProvider.swift:449— Snapzy/Services/Cloud/S3CloudProvider.swift:449-457 | Snapzy/Services/Cloud/S3MultipartUploader.swift:372-380 — 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 (9 lines × 2) Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift:46— Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift:46-54 | Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift:135-143 — both copies are in the same file, so extract the 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 `Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift:46` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:69— Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:69-77 | Snapzy/Features/VideoEditor/Managers/VideoEditorWindow.swift:26-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (9 lines × 2) Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:17— Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:17-25 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:149-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also 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 (9 lines × 2) Snapzy/Features/Recording/Managers/MouseClickHighlightWindow.swift:35— Snapzy/Features/Recording/Managers/MouseClickHighlightWindow.swift:35-43 | Snapzy/Features/Recording/Managers/RecordingAnnotationOverlayWindow.swift:69-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.
Duplicated block (9 lines × 2) Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:244— Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:244-252 | Snapzy/Services/Capture/AreaSelectionWindow.swift:3055-3063 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) Snapzy/Features/VideoEditor/Models/VideoEditorSpeedSegment.swift:107— Snapzy/Features/VideoEditor/Models/VideoEditorSpeedSegment.swift:107-115 | Snapzy/Features/VideoEditor/Models/VideoEditorZoomSegment.swift:150-158 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:528— Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:528-536 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift:227-235 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Low cohesion: UpdaterManager (LCOM4 9) Snapzy/Services/Updates/UpdaterManager.swift:16— UpdaterManager's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SmartElementOverlayView (LCOM4 7) Snapzy/Services/Capture/SmartElement/SmartElementOverlayView.swift:19— SmartElementOverlayView's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AreaSelectionOverlayView (LCOM4 6) Snapzy/Services/Capture/AreaSelectionWindow.swift:2751— AreaSelectionOverlayView's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AnnotateWindowController (LCOM4 6) Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:38— AnnotateWindowController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RecordingRegionOverlayView (LCOM4 6) Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:190— RecordingRegionOverlayView's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VideoEditorWindowController (LCOM4 6) Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:29— VideoEditorWindowController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VideoEditorState (LCOM4 5) Snapzy/Features/VideoEditor/VideoEditorState.swift:311— VideoEditorState's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DesktopIconManager (LCOM4 5) Snapzy/Services/Wallpaper/DesktopIconManager.swift:15— DesktopIconManager's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DragHandleNSView (LCOM4 5) Snapzy/Features/Annotate/Components/AnnotateDragHandleView.swift:38— DragHandleNSView's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RecordingCameraPreviewView (LCOM4 5) Snapzy/Features/Recording/Managers/RecordingCameraOverlayWindow.swift:566— RecordingCameraPreviewView's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VideoEditorWindow (LCOM4 5) Snapzy/Features/VideoEditor/Managers/VideoEditorWindow.swift:18— VideoEditorWindow's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SplashWindow (LCOM4 4) Snapzy/Features/Splash/SplashWindow.swift:14— SplashWindow's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ScreenCaptureManager (LCOM4 4) Snapzy/Services/Capture/ScreenCaptureManager.swift:129— ScreenCaptureManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AppLanguageManager (LCOM4 4) Snapzy/Shared/Localization/AppLanguageManager.swift:33— AppLanguageManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: UndoIsolatedTextView (LCOM4 4) Snapzy/Features/Annotate/Components/AnnotateTextEditOverlay.swift:293— UndoIsolatedTextView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AnnotateWindow (LCOM4 4) Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:62— AnnotateWindow's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: HistoryFloatingPanel (LCOM4 4) Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:13— HistoryFloatingPanel's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RecordingRegionOverlayWindow (LCOM4 4) Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:62— RecordingRegionOverlayWindow'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 block (10 lines × 2) Snapzy/Features/Annotate/Components/AnnotateDragHandleView.swift:123— Snapzy/Features/Annotate/Components/AnnotateDragHandleView.swift:123-132 | Snapzy/Features/QuickAccess/Components/QuickAccessPinDragHandleView.swift:130-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:800— Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:800-809 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:181-190 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:786— Snapzy/Features/Annotate/Services/AnnotateExporter.swift:786-795 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:825-834 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:786` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) Snapzy/Features/CrashReport/ZipArchiveWriter.swift:31— Snapzy/Features/CrashReport/ZipArchiveWriter.swift:31-40 | Snapzy/Features/CrashReport/ZipArchiveWriter.swift:46-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/CrashReport/ZipArchiveWriter.swift:44` calls `appendUInt32LE` and `Snapzy/Features/CrashReport/ZipArchiveWriter.swift:56` 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) Snapzy/Features/Onboarding/Components/OnboardingShortcutsView.swift:509— Snapzy/Features/Onboarding/Components/OnboardingShortcutsView.swift:509-518 | Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:1510-1519 — 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 `Snapzy/Features/Onboarding/Components/OnboardingShortcutsView.swift:509` 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 × 2) Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:61— Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:61-70 | Snapzy/Shared/Extensions/View+CornerRadius.swift:45-54 — before extracting anything, compare `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift` and `Snapzy/Shared/Extensions/View+CornerRadius.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:61` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:73— Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:73-82 | Snapzy/Shared/Extensions/View+CornerRadius.swift:57-66 — before extracting anything, compare `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift` and `Snapzy/Shared/Extensions/View+CornerRadius.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:73` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:85— Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:85-94 | Snapzy/Shared/Extensions/View+CornerRadius.swift:69-78 — before extracting anything, compare `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift` and `Snapzy/Shared/Extensions/View+CornerRadius.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:85` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewSlotViews.swift:113— Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewSlotViews.swift:113-122 | Snapzy/Features/Preferences/Components/PreferencesQuickAccessSwipeZoneView.swift:160-169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Preferences/Components/PreferencesQuickAccessPreviewSlotViews.swift:113` 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) Snapzy/Features/QuickAccess/Components/QuickAccessDraggableView.swift:537— Snapzy/Features/QuickAccess/Components/QuickAccessDraggableView.swift:537-546 | Snapzy/Features/QuickAccess/Components/QuickAccessPinDragHandleView.swift:119-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/QuickAccess/Components/QuickAccessPinDragHandleView.swift:130` calls `convert` and `Snapzy/Features/QuickAccess/Components/QuickAccessDraggableView.swift:548` 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 (10 lines × 2) Snapzy/Features/Recording/RecordingSession.swift:296— Snapzy/Features/Recording/RecordingSession.swift:296-305 | Snapzy/Features/Recording/RecordingSession.swift:341-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:135— Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:135-144 | Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:574-583 — both copies are in the same file, so extract the 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1102— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1102-1111 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2437-2446 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Snapzy/Features/Recording/RecordingCoordinator.swift:278— Snapzy/Features/Recording/RecordingCoordinator.swift:278-287 | Snapzy/Services/Capture/AreaSelectionWindow.swift:1542-1551 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Snapzy/Shared/Components/ShortcutRecorderView.swift:156— Snapzy/Shared/Components/ShortcutRecorderView.swift:156-165 | Snapzy/Shared/Components/SingleKeyRecorderView.swift:155-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:372— Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:372-382 | Snapzy/Features/Annotate/Components/AnnotateToolbarView.swift:196-205 — 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 (10 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorToolbarView.swift:27— Snapzy/Features/VideoEditor/Components/VideoEditorToolbarView.swift:27-36 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoControlsView.swift:148-157 — 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 (6 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1259— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1259-1264 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2663-2668 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Snapzy/Features/Onboarding/SnapzyOnboardingState.swift:196— Snapzy/Features/Onboarding/SnapzyOnboardingState.swift:196-201 | Snapzy/Features/Onboarding/SnapzyOnboardingState.swift:292-297 — both copies are in the same file, so extract the 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 `Snapzy/Features/Onboarding/SnapzyOnboardingState.swift:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Snapzy/Features/Recording/RecordingCoordinator.swift:596— Snapzy/Features/Recording/RecordingCoordinator.swift:596-601 | Snapzy/Features/Recording/RecordingCoordinator.swift:742-747 — both copies are in the same file, so extract the 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 `Snapzy/Features/Recording/RecordingCoordinator.swift:596` 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) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:492— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:492-497 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:454-459 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:676— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:676-681 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:578-583 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:676` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:576` calls `offset` and `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:674` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift:674— Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift:674-679 | Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift:689-694 — both copies are in the same file, so extract the 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 `Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift:674` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassButtonSurface.swift:99— Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassButtonSurface.swift:99-104 | Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassButtonSurface.swift:114-119 — both copies are in the same file, so extract the 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 `Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassButtonSurface.swift:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:98— Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:98-103 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoBackgroundSidebarView.swift:150-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Snapzy/Features/Annotate/Services/AnnotationSessionStore.swift:231— Snapzy/Features/Annotate/Services/AnnotationSessionStore.swift:231-236 | Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:428-436 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Snapzy/Features/History/Components/HistoryFloatingContentView.swift:562— Snapzy/Features/History/Components/HistoryFloatingContentView.swift:562-567 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:779-784 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:157— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:157-162 | Snapzy/Features/Preferences/Components/PreferencesAnnotatePreview.swift:182-187 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockPrerecordToolbar.swift:141— Snapzy/Features/Onboarding/Mockups/SnapzyMockPrerecordToolbar.swift:141-146 | Snapzy/Features/Onboarding/Mockups/SnapzyMockRecordingStatusBar.swift:124-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:91— Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:91-96 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoBackgroundSidebarView.swift:157-162 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Snapzy/Features/Recording/Managers/RecordingCameraOverlayWindow.swift:52— Snapzy/Features/Recording/Managers/RecordingCameraOverlayWindow.swift:52-57 | Snapzy/Features/Recording/Models/RecordingMicrophoneDevice.swift:45-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Snapzy/Features/Annotate/InlineAreaMagnifierHostView.swift:159— Snapzy/Features/Annotate/InlineAreaMagnifierHostView.swift:159-164 | Snapzy/Services/Capture/AreaSelectionWindow.swift:3894-3899 — 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 `Snapzy/Features/Annotate/InlineAreaMagnifierHostView.swift:159` 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 (6 lines × 2) Snapzy/Services/Capture/CaptureOverlayShortcutSettings.swift:69— Snapzy/Services/Capture/CaptureOverlayShortcutSettings.swift:69-74 | Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:155-160 — 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 `Snapzy/Services/Capture/CaptureOverlayShortcutSettings.swift:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:174— Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:174-179 | Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:307-312 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:93— Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:93-104 | Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift:103-114 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 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 `Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:93` 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:776— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:776-787 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2180-2191 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:776` 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1266— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1266-1277 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2670-2681 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1266` 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1555— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1555-1566 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1750-1761 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1555` 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) Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:579— Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:579-590 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoBackgroundSidebarView.swift:257-268 — 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 `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:579` 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) Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:605— Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:605-616 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoBackgroundSidebarView.swift:286-297 — 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 `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:605` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `orientation` to `state.aspectRatioOrientation` in one and `aspectRatioOrientation` 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 lines × 2) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:773— Snapzy/Features/Annotate/Services/AnnotateExporter.swift:773-784 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:812-823 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:773` 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 (12 lines × 2) Snapzy/Features/Preferences/Components/PreferencesMenuBarSettingsView.swift:374— Snapzy/Features/Preferences/Components/PreferencesMenuBarSettingsView.swift:374-385 | Snapzy/Features/Preferences/Components/PreferencesQuickAccessActionCustomizationView.swift:105-116 — 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 `Snapzy/Features/Preferences/Components/PreferencesMenuBarSettingsView.swift:374` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorEmptyStateView.swift:150— Snapzy/Features/VideoEditor/Components/VideoEditorEmptyStateView.swift:150-161 | Snapzy/Features/VideoEditor/Components/VideoEditorEmptyStateView.swift:188-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:153— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:153-164 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:134-147 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Snapzy/Services/Capture/AreaSelectionWindow.swift:4304— Snapzy/Services/Capture/AreaSelectionWindow.swift:4304-4315 | Snapzy/Services/Capture/AreaSelectionWindow.swift:4504-4515 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/AreaSelectionWindow.swift:4304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Services/Capture/AreaSelectionWindow.swift:4303` calls `hideSizeIndicator` and `Snapzy/Services/Capture/AreaSelectionWindow.swift:4503` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) Snapzy/Services/Cloud/CloudUsageService.swift:75— Snapzy/Services/Cloud/CloudUsageService.swift:75-86 | Snapzy/Services/Cloud/CloudUsageService.swift:137-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) Snapzy/Services/History/CaptureHistoryStore.swift:213— Snapzy/Services/History/CaptureHistoryStore.swift:213-227 | Snapzy/Services/History/CaptureHistoryStore.swift:267-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/History/CaptureHistoryStore.swift:213` 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) Snapzy/Services/Shortcuts/ShortcutValidationService.swift:37— Snapzy/Services/Shortcuts/ShortcutValidationService.swift:37-48 | Snapzy/Services/Shortcuts/ShortcutValidationService.swift:152-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/Shortcuts/ShortcutValidationService.swift:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1174— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1174-1185 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2509-2520 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) Snapzy/Services/Capture/CaptureEventTapController.swift:185— Snapzy/Services/Capture/CaptureEventTapController.swift:185-196 | Snapzy/Services/Capture/SmartElementQueryService.swift:125-136 — 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.
Change coupling: SnapzyConfigurationExporter.swift ↔ SnapzyConfigurationImporter.swift Snapzy/Services/Configuration/SnapzyConfigurationExporter.swift:1— `Snapzy/Services/Configuration/SnapzyConfigurationExporter.swift` and `Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift` change together 100% of the time (17 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `9de2b0f2` fix: Unlock magnifier color panel and add magnifier size setting (#665); `d0d9816c` feat: Added configuration for opening Finder after saving optional (#…; `5dd42ee2` fix(config): Sync include_window_shadow with config.toml (#526) (#630) — run `git show` on any of them.
Change coupling: AnnotateAnnotationFactory.swift ↔ AnnotateAnnotationRenderer.swift Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:1— `Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift` and `Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift` change together 75% of the time (12 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `80be6dc0` feat: Added attached arrows to counter annotations (#626); `938f46b7` feat: add text snapping for highlighter in annotate editor (#410); `b299badd` feat: Add double-sided arrow in the mark-up (#368) — run `git show` on any of them.
Change coupling: VideoEditorZoomPreviewOverlay.swift ↔ VideoEditorZoomCompositor.swift Snapzy/Features/VideoEditor/Components/VideoEditorZoomPreviewOverlay.swift:1— `Snapzy/Features/VideoEditor/Components/VideoEditorZoomPreviewOverlay.swift` and `Snapzy/Features/VideoEditor/Services/VideoEditorZoomCompositor.swift` change together 62% of the time (8 of the 13 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 8 shared commits counted here, the most recent 3 are `c4247083` refactor: Refactor and rename video editor components for clarity; `f71b0b8a` refactor: Enhance video export settings and aspect ratio handling in …; `db3f9072` feat: Add zoom transition duration configuration and improve zoom tra… — run `git show` on any of them.
Change coupling: AnnotateDragHandleView.swift ↔ AnnotateWindowController.swift Snapzy/Features/Annotate/Components/AnnotateDragHandleView.swift:1— `Snapzy/Features/Annotate/Components/AnnotateDragHandleView.swift` and `Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift` change together 60% of the time (6 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 6 shared commits counted here, the most recent 3 are `a045a311` feat: Implement default canvas preset functionality and update relate…; `b67bb09f` fix: Enhance drag-to-app functionality with lazy file promise and ren…; `9b16d74b` feat: Add support for opening multiple independent annotate windows a… — run `git show` on any of them.
Change coupling: PreferencesKeys.swift ↔ L10n.swift Snapzy/Features/Preferences/Models/PreferencesKeys.swift:1— `Snapzy/Features/Preferences/Models/PreferencesKeys.swift` and `Snapzy/Shared/Localization/L10n.swift` change together 58% of the time (42 of the 72 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 42 shared commits counted here, the most recent 3 are `9de2b0f2` fix: Unlock magnifier color panel and add magnifier size setting (#665); `d0d9816c` feat: Added configuration for opening Finder after saving optional (#…; `6db65975` Add configurable pinned image zoom modes (#636) — run `git show` on any of them.
Change coupling: RecordingCoordinator.swift ↔ RecordingToolbarView.swift Snapzy/Features/Recording/RecordingCoordinator.swift:1— `Snapzy/Features/Recording/RecordingCoordinator.swift` and `Snapzy/Features/Recording/RecordingToolbarView.swift` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `41222250` feat: Added camera overlay to screen recordings (#560); `d332f1a4` feat: Implement recording output mode selection (video/GIF) in the to…; `ea606bc6` feat: Add screenshot capture functionality to recording toolbar — run `git show` on any of them.
Change coupling: PreferencesQuickAccessSettingsView.swift ↔ QuickAccessCardView.swift Snapzy/Features/Preferences/Components/PreferencesQuickAccessSettingsView.swift:1— `Snapzy/Features/Preferences/Components/PreferencesQuickAccessSettingsView.swift` and `Snapzy/Features/QuickAccess/Components/QuickAccessCardView.swift` change together 50% of the time (9 of the 18 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 `1862794d` feat: Add Sound Effects Toggle to Quick Access (#586); `a45b2ce4` feat: Add quick access settings for hiding cards when windows are ope…; `72e645b3` feat: Implement swipe actions for Quick Access cards with customizabl… — run `git show` on any of them.
Change coupling: AnnotateAnnotationFactory.swift ↔ L10n.swift Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:1— `Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift` and `Snapzy/Shared/Localization/L10n.swift` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `54e6880f` feat: Cut Out tool to remove or add a strip from the middle of an ima…; `80be6dc0` feat: Added attached arrows to counter annotations (#626); `938f46b7` feat: add text snapping for highlighter in annotate editor (#410) — run `git show` on any of them.
Change coupling: QuickAccessCardView.swift ↔ QuickAccessPanelController.swift Snapzy/Features/QuickAccess/Components/QuickAccessCardView.swift:1— `Snapzy/Features/QuickAccess/Components/QuickAccessCardView.swift` and `Snapzy/Features/QuickAccess/Managers/QuickAccessPanelController.swift` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a45b2ce4` feat: Add quick access settings for hiding cards when windows are ope…; `6b037585` feat: Improve QuickAccess animations and card dismissal logic for smo… (at that commit the files were still `Snapzy/Features/QuickAccess/QuickAccessCardView.swift` and `Snapzy/Features/QuickAccess/QuickAccessPanelController.swift`); `94eadfa1` feat: Implement QuickAccess animations, progress indicators, and soun… (at that commit the files were still `ClaudeShot/Features/QuickAccess/QuickAccessCardView.swift` and `ClaudeShot/Features/QuickAccess/QuickAccessPanelController.swift`) — run `git show` on any of them.
Change coupling: VideoEditorVideoControlsView.swift ↔ VideoEditorExporter.swift Snapzy/Features/VideoEditor/Components/VideoEditorVideoControlsView.swift:1— `Snapzy/Features/VideoEditor/Components/VideoEditorVideoControlsView.swift` and `Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `b242b50f` feat: Add speed segment functionality to Video Editor (#316); `f71b0b8a` refactor: Enhance video export settings and aspect ratio handling in …; `556bf830` feat: Implement auto-focus functionality with mouse tracking (#1) — run `git show` on any of them.
Change coupling: AnnotateState.swift ↔ AnnotateBlurCacheManager.swift Snapzy/Features/Annotate/AnnotateState.swift:1— `Snapzy/Features/Annotate/AnnotateState.swift` and `Snapzy/Features/Annotate/Services/AnnotateBlurCacheManager.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `abdf8aeb` refactor: Eliminate canvas lag and color flicker with layer-compositi…; `950ea8a1` feat: Add new blur styles and corresponding tests for hexagonal, crys…; `fe48b6c3` feat: Enhance Quick Properties Bar and Inline Area Properties Bar wit… — run `git show` on any of them.
Change coupling: VideoEditorLeftSidebar.swift ↔ VideoEditorZoomPreviewOverlay.swift Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:1— `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomPreviewOverlay.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `7de8dc5b` refactor: Refactor video editor state management and enhance playback… (at that commit the file was still `Snapzy/Features/VideoEditor/Components/VideoEditorRightSidebar.swift`); `db3f9072` feat: Add zoom transition duration configuration and improve zoom tra… (at that commit the file was still `Snapzy/Features/VideoEditor/Components/VideoEditorRightSidebar.swift`); `556bf830` feat: Implement auto-focus functionality with mouse tracking (#1) (at that commit the file was still `Snapzy/Features/VideoEditor/Components/VideoEditorRightSidebar.swift`) — run `git show` on any of them.
Duplicated block (13 lines × 2) Snapzy/App/SnapzyApp.swift:234— Snapzy/App/SnapzyApp.swift:234-246 | Snapzy/App/SnapzyApp.swift:350-362 — both copies are in the same file, so extract the 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 `Snapzy/App/SnapzyApp.swift:234` 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 `note` to `String? = nil` in one and `String?` 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 (13 lines × 2) Snapzy/Features/Annotate/AnnotateState.swift:136— Snapzy/Features/Annotate/AnnotateState.swift:136-148 | Snapzy/Features/Annotate/Models/PersistedAnnotationSessionConversion.swift:78-90 — 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 `Snapzy/Features/Annotate/AnnotateState.swift:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1279— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1279-1291 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2683-2695 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1279` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1847— Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1847-1859 | Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:270-282 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:247— Snapzy/Features/Capture/CaptureViewModel.swift:247-259 | Snapzy/Services/Capture/AreaSelectionWindow.swift:1468-1480 — 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 `Snapzy/Features/Capture/CaptureViewModel.swift:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:265— Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:265-277 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:127-139 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:265` 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, `Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:264` calls `lineLimit` and `Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:126` 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 (13 lines × 2) Snapzy/Features/QuickAccess/Models/QuickAccessItem.swift:138— Snapzy/Features/QuickAccess/Models/QuickAccessItem.swift:138-150 | Snapzy/Services/History/CaptureHistoryRecord.swift:54-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:425— Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:425-437 | Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:530-542 — both copies are in the same file, so extract the 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 `Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:425` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Snapzy/Services/Capture/ScreenCaptureManager.swift:703— Snapzy/Services/Capture/ScreenCaptureManager.swift:703-715 | Snapzy/Services/Capture/ScreenCaptureManager.swift:1224-1236 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/ScreenCaptureManager.swift:703` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1198— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1198-1210 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2602-2614 — 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 (13 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:296— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:296-308 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:256-269 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:940— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:940-952 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2344-2356 — 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.
Swallowed exception (caught, then discarded) Snapzy/Services/Wallpaper/SystemWallpaperManager.swift:146— `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) Snapzy/Services/Capture/AreaSelectionWindow.swift:308— `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) Snapzy/Services/Capture/AreaSelectionWindow.swift:1025— `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) Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:516— `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) Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:570— `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) Snapzy/Services/Capture/RecordingMetadata.swift:558— `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) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:2319— `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) Snapzy/Features/VideoEditor/VideoEditorState.swift:2897— `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) Snapzy/Features/QuickAccess/Services/QuickAccessThumbnailGenerator.swift:154— `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) Snapzy/Features/Preferences/Components/PinZoomModeComparisonPreview.swift:86— `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) Snapzy/Features/Preferences/Components/PinZoomModeComparisonPreview.swift:98— `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) Snapzy/Features/Annotate/Services/AnnotateTextSnapDetector.swift:61— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (11 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockPrerecordToolbar.swift:111— Snapzy/Features/Onboarding/Mockups/SnapzyMockPrerecordToolbar.swift:111-121 | Snapzy/Features/Onboarding/Mockups/SnapzyMockRecordingStatusBar.swift:98-108 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockPrerecordToolbar.swift:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:927— Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:927-937 | Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:1008-1018 — both copies are in the same file, so extract the 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 `Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:927` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Snapzy/Features/QuickAccess/QuickAccessManager.swift:1106— Snapzy/Features/QuickAccess/QuickAccessManager.swift:1106-1116 | Snapzy/Features/QuickAccess/QuickAccessManager.swift:1167-1178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Snapzy/Features/Recording/Managers/RecordingCameraOverlayWindow.swift:68— Snapzy/Features/Recording/Managers/RecordingCameraOverlayWindow.swift:68-78 | Snapzy/Features/Recording/Models/RecordingMicrophoneDevice.swift:61-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Recording/Managers/RecordingCameraOverlayWindow.swift:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:543— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:543-553 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:514-524 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:543` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:297— Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:297-307 | Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:353-363 — both copies are in the same file, so extract the 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 `Snapzy/Features/VideoEditor/Managers/VideoEditorWindowController.swift:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Snapzy/Services/Clipboard/ClipboardHelper.swift:68— Snapzy/Services/Clipboard/ClipboardHelper.swift:68-78 | Snapzy/Services/Clipboard/ClipboardHelper.swift:110-120 — both copies are in the same file, so extract the 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 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 (11 lines × 2) Snapzy/Services/Cloud/CloudUploadHistoryStore.swift:134— Snapzy/Services/Cloud/CloudUploadHistoryStore.swift:134-144 | Snapzy/Services/History/CaptureHistoryStore.swift:680-690 — 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 `Snapzy/Services/Cloud/CloudUploadHistoryStore.swift:134` 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) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassSurface.swift:165— Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassSurface.swift:165-175 | Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassSurface.swift:195-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassSurface.swift:165` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1030— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1030-1040 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2559-2569 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) Snapzy/Services/Cloud/S3CloudProvider.swift:432— Snapzy/Services/Cloud/S3CloudProvider.swift:432-442 | Snapzy/Services/Cloud/S3MultipartUploader.swift:355-365 — 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1455— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1455-1469 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1663-1677 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1455` 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1582— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1582-1596 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1609-1623 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1582` 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) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1864— Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1864-1878 | Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:287-301 — 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 (15 lines × 2) Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:147— Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:147-161 | Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:173-187 — both copies are in the same file, so extract the 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 `Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:147` 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. 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 (15 lines × 2) Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:486— Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:486-500 | Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:528-542 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:486` 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 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 (15 lines × 2) Snapzy/Services/Capture/ScreenCaptureManager.swift:596— Snapzy/Services/Capture/ScreenCaptureManager.swift:596-610 | Snapzy/Services/Capture/ScreenCaptureManager.swift:1150-1164 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/ScreenCaptureManager.swift:596` 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 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 (15 lines × 2) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1736— Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1736-1750 | Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1786-1800 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1736` 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) REDACTED:68— REDACTED:68-84 | REDACTED:156-170 — both copies are in the same file, so extract the 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 `REDACTED:68` 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) Snapzy/Services/Cloud/CloudKeychainStore.swift:392— Snapzy/Services/Cloud/CloudKeychainStore.swift:392-406 | REDACTED:1051-1065 — 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 (15 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1042— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1042-1056 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2571-2585 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) Snapzy/Features/Annotate/AnnotateManager.swift:238— Snapzy/Features/Annotate/AnnotateManager.swift:238-251 | Snapzy/Features/Annotate/AnnotateManager.swift:263-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Annotate/AnnotateManager.swift:235` calls `log` and `Snapzy/Features/Annotate/AnnotateManager.swift:261` 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 (14 lines × 2) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2665— Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2665-2678 | Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:380-393 — 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 `Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2665` 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:862— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:862-875 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2266-2279 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1689— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1689-1702 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1793-1806 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1689` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:82— Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:82-95 | Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:157-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) Snapzy/Features/History/Components/HistoryFloatingContentView.swift:687— Snapzy/Features/History/Components/HistoryFloatingContentView.swift:687-700 | Snapzy/Features/History/Components/HistoryToolbar.swift:106-119 — 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 `Snapzy/Features/History/Components/HistoryFloatingContentView.swift:687` 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) Snapzy/Services/Capture/WindowSelectionQueryService.swift:222— Snapzy/Services/Capture/WindowSelectionQueryService.swift:222-235 | Snapzy/Services/Capture/WindowSelectionQueryService.swift:288-301 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/WindowSelectionQueryService.swift:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:282— Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:282-295 | Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:343-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) Snapzy/Services/History/CaptureHistoryStore.swift:164— Snapzy/Services/History/CaptureHistoryStore.swift:164-177 | Snapzy/Services/History/CaptureHistoryStore.swift:216-229 — both copies are in the same file, so extract the 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 `Snapzy/Services/History/CaptureHistoryStore.swift:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Services/History/CaptureHistoryStore.swift:178` calls `refreshRecords` and `Snapzy/Services/History/CaptureHistoryStore.swift:230` 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 (18 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:2028— Snapzy/Features/Capture/CaptureViewModel.swift:2028-2045 | Snapzy/Features/Capture/CaptureViewModel.swift:2750-2767 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:2028` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Capture/CaptureViewModel.swift:2749` calls `play` and `Snapzy/Features/Capture/CaptureViewModel.swift:2028` 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 (18 lines × 2) Snapzy/Features/History/Components/HistoryCardView.swift:142— Snapzy/Features/History/Components/HistoryCardView.swift:142-159 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:139-156 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryCardView.swift` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/History/Components/HistoryCardView.swift:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:357— Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:357-374 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:380-397 — both copies are in the same file, so extract the 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:357` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) Snapzy/Features/Recording/RecordingCoordinator.swift:645— Snapzy/Features/Recording/RecordingCoordinator.swift:645-662 | Snapzy/Features/Recording/RecordingCoordinator.swift:786-803 — both copies are in the same file, so extract the 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 `Snapzy/Features/Recording/RecordingCoordinator.swift:645` 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 (18 lines × 2) Snapzy/Features/Recording/RecordingCoordinator.swift:816— Snapzy/Features/Recording/RecordingCoordinator.swift:816-833 | Snapzy/Features/Recording/RecordingCoordinator.swift:959-976 — both copies are in the same file, so extract the 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 `Snapzy/Features/Recording/RecordingCoordinator.swift:816` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Recording/RecordingCoordinator.swift:958` calls `log` and `Snapzy/Features/Recording/RecordingCoordinator.swift:814` 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 (18 lines × 2) Snapzy/Services/Capture/ScreenRecordingManager.swift:1214— Snapzy/Services/Capture/ScreenRecordingManager.swift:1214-1231 | Snapzy/Services/Capture/ScreenRecordingManager.swift:1241-1258 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/ScreenRecordingManager.swift:1214` 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 (18 lines × 2) REDACTED:848— REDACTED:848-865 | REDACTED:918-935 — both copies are in the same file, so extract the 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 `REDACTED:848` 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) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1217— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1217-1233 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2621-2637 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1217` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:1147— Snapzy/Features/Capture/CaptureViewModel.swift:1147-1163 | Snapzy/Features/Capture/CaptureViewModel.swift:1369-1385 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:1147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:1560— Snapzy/Features/Capture/CaptureViewModel.swift:1560-1576 | Snapzy/Features/Capture/CaptureViewModel.swift:1635-1651 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:1560` 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 (17 lines × 2) Snapzy/Features/History/HistoryWindowController.swift:42— Snapzy/Features/History/HistoryWindowController.swift:42-58 | Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:156-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/History/HistoryWindowController.swift:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 lines × 2) Snapzy/Features/Preferences/Components/PreferencesCloudCredentialExportSheet.swift:71— Snapzy/Features/Preferences/Components/PreferencesCloudCredentialExportSheet.swift:71-87 | Snapzy/Features/Preferences/Components/PreferencesCloudCredentialImportSheet.swift:53-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Preferences/Components/PreferencesCloudCredentialExportSheet.swift:71` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) Snapzy/Services/Capture/ScreenCaptureManager.swift:2601— Snapzy/Services/Capture/ScreenCaptureManager.swift:2601-2617 | Snapzy/Services/Capture/ScreenRecordingManager.swift:1857-1873 — 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 (17 lines × 2) scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:26— scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:26-42 | scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:47-63 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:26` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:995— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:995-1010 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2524-2539 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:995` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1235— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1235-1250 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2639-2654 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1235` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:732— Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:732-747 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:113-128 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 121 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 `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:732` 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 (16 lines × 2) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:273— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:273-288 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:423-438 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:273` 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 (16 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:308— Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:308-323 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:64-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. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:308` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `8` in one and `10` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16 lines × 2) Snapzy/Features/Recording/RecordingCoordinator.swift:117— Snapzy/Features/Recording/RecordingCoordinator.swift:117-132 | Snapzy/Services/Capture/ScreenshotLastAreaStore.swift:32-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Recording/RecordingCoordinator.swift:117` 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 lines × 2) Snapzy/Services/Media/OCRService.swift:148— Snapzy/Services/Media/OCRService.swift:148-163 | Snapzy/Services/Media/OCRService.swift:186-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/Media/OCRService.swift:148` 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 (20 lines × 2) Snapzy/App/MenuBarIconRenderer.swift:52— Snapzy/App/MenuBarIconRenderer.swift:52-71 | Snapzy/App/MenuBarIconRenderer.swift:115-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/App/MenuBarIconRenderer.swift:52` 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 (20 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1141— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1141-1160 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2476-2495 — 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 (20 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1306— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1306-1325 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2710-2729 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1306` 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 (20 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:2440— Snapzy/Features/Capture/CaptureViewModel.swift:2440-2459 | Snapzy/Features/Capture/CaptureViewModel.swift:2793-2812 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:2440` 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 (20 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:203— Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:203-222 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:254-273 — both copies are in the same file, so extract the 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 (20 lines × 2) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1769— Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1769-1788 | Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1813-1832 — both copies are in the same file, so extract the 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 `Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1769` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1764` calls `shouldRegisterNow` and `Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1810` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:59— Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:59-63 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:89-93 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:123-127 — 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 `Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.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 (5 lines × 3) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:38— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:38-42 | Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:202-206 | Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:56-60 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:37` calls `background`, `Color` and `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:201` 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 × 3) Snapzy/Features/Onboarding/Mockups/SnapzyMockDesktopCanvas.swift:36— Snapzy/Features/Onboarding/Mockups/SnapzyMockDesktopCanvas.swift:36-40 | Snapzy/Features/Onboarding/Mockups/SnapzyMockDesktopCanvas.swift:45-49 | Snapzy/Features/Onboarding/Mockups/SnapzyMockDesktopCanvas.swift:54-58 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockDesktopCanvas.swift:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:385— Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:385-391 | Snapzy/Services/Capture/ScreenCaptureManager.swift:2602-2606 | Snapzy/Services/Capture/ScreenRecordingManager.swift:1858-1862 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:385` 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 (5 lines × 3) Snapzy/Services/Clipboard/ClipboardHelper.swift:71— Snapzy/Services/Clipboard/ClipboardHelper.swift:71-75 | Snapzy/Services/Clipboard/ClipboardHelper.swift:113-117 | Snapzy/Services/Clipboard/ClipboardHelper.swift:164-168 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:173— Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:173-177 | Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:111-115 | Snapzy/Services/Capture/SmartElement/SmartElementOverlayWindow.swift:67-71 — 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (4 members, 50+ identical tokens) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1450— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1450-1469 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1577-1596 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1604-1623 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1658-1677 — 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) Snapzy/Features/Capture/CaptureViewModel.swift:702— Snapzy/Features/Capture/CaptureViewModel.swift:702-883 | Snapzy/Features/Capture/CaptureViewModel.swift:885-1019 | Snapzy/Features/Capture/CaptureViewModel.swift:2022-2105 | Snapzy/Features/Capture/CaptureViewModel.swift:2739-2942 — 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) Snapzy/Features/History/Managers/HistoryFloatingPanelController.swift:238— Snapzy/Features/History/Managers/HistoryFloatingPanelController.swift:238-265 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:36-70 | Snapzy/Features/Recording/Components/RecordingAnnotationToolbarContentBuilder.swift:28-62 | Snapzy/Features/Recording/RecordingToolbarWindow.swift:513-551 — 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) Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:183— Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:183-212 | Snapzy/Features/Onboarding/Components/OnboardingDiagnosticsOptInView.swift:17-91 | Snapzy/Features/Onboarding/Components/OnboardingSkipConfirmationView.swift:14-73 | Snapzy/Features/Onboarding/Components/OnboardingSponsorView.swift:16-90 — 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) Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:32— Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:32-54 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:15-104 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:23-43 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:199-232 — 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 (9 lines × 3) Snapzy/Features/QuickAccess/QuickAccessManager.swift:1106— Snapzy/Features/QuickAccess/QuickAccessManager.swift:1106-1114 | Snapzy/Features/QuickAccess/QuickAccessManager.swift:1167-1175 | Snapzy/Features/QuickAccess/QuickAccessManager.swift:1198-1206 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) Snapzy/Features/Recording/RecordingCoordinator.swift:643— Snapzy/Features/Recording/RecordingCoordinator.swift:643-651 | Snapzy/Features/Recording/RecordingCoordinator.swift:784-792 | Snapzy/Features/Recording/RecordingCoordinator.swift:932-940 — 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 `Snapzy/Features/Recording/RecordingCoordinator.swift:643` 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, `Snapzy/Features/Recording/RecordingCoordinator.swift:653` calls `isCurrentRecordingStart` and `Snapzy/Features/Recording/RecordingCoordinator.swift:941` 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 (9 lines × 3) Snapzy/Services/Capture/ScreenRecordingManager.swift:1390— Snapzy/Services/Capture/ScreenRecordingManager.swift:1390-1398 | Snapzy/Services/Capture/TempCaptureManager.swift:155-169 | Snapzy/Services/Capture/TempCaptureManager.swift:435-449 — 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 `Snapzy/Services/Capture/ScreenRecordingManager.swift:1390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Snapzy/Services/Diagnostics/AppToastManager.swift:40— Snapzy/Services/Diagnostics/AppToastManager.swift:40-48 | Snapzy/Services/Diagnostics/AppToastManager.swift:50-58 | Snapzy/Services/Diagnostics/AppToastManager.swift:60-68 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:327— Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:327-335 | Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:710-718 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:89-97 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:53— Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:53-58 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:83-88 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:117-122 — 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 `Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:115` calls `padding` and `Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:82` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:66— Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:66-71 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:96-101 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:130-135 — 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 `Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:66` 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, `Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:73` calls `padding` and `Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:137` 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) Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:317— Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:317-322 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:73-78 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:84-89 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:83` calls `italic` and `Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.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 (6 lines × 3) Snapzy/Features/History/Components/HistoryCardView.swift:285— Snapzy/Features/History/Components/HistoryCardView.swift:285-290 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:265-270 | Snapzy/Features/History/Components/HistoryItemView.swift:174-179 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryCardView.swift` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:200— Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:200-205 | Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:482-487 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoBackgroundSidebarView.swift:202-207 — 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.
Repeated repair: Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift:717— Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is InlineAreaAnnotateSession.keyAction at line 717), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: Keep annotations in place after Cut Out and inline selection resize”; “fix: Unlock magnifier color panel and add magnifier size setting (#665)”; “fix: keep non-Retina screenshots at native pixel density (#452)”; “fix: publish selection pointer location to track crosshair and magnifier overlay during drag”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Snapzy/Features/QuickAccess/Managers/QuickAccessPinWindow.swift Snapzy/Features/QuickAccess/Managers/QuickAccessPinWindow.swift:275— Snapzy/Features/QuickAccess/Managers/QuickAccessPinWindow.swift changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is QuickAccessPinWindow.updateMousePassthrough at line 275), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: Keep pinned window drags alive across displays on macOS 27 (#677)”; “fix: stabilize pinned image focal anchoring and restore gesture zoom paths (#640)”; “fix: Restore pinned window dragging on macOS 27 (#584)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Features/QuickAccess/Managers/QuickAccessPinWindow.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Snapzy/Services/History/CaptureHistoryRetentionService.swift Snapzy/Services/History/CaptureHistoryRetentionService.swift:128— Snapzy/Services/History/CaptureHistoryRetentionService.swift changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is CaptureHistoryRetentionService.tempFilePathsForRecordsToDelete at line 128), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: Read history records from the database in the retention sweep”; “fix: Stop retention sweep from deleting every history thumbnail”; “fix: Preserve copied temp files on quick access dismiss and refine history defaults (#439)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/History/CaptureHistoryRetentionService.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Snapzy/Services/Capture/CaptureEventTapController.swift Snapzy/Services/Capture/CaptureEventTapController.swift:322— Snapzy/Services/Capture/CaptureEventTapController.swift changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is CaptureEventTapController.handleTapEvent at line 322), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: Stop live capture session instead of re-enabling a timed-out event tap (#690) (#692)”; “fix: Keep the app beneath focused during live capture so tooltips survive (#672)”; “fix: Invalidate capture event tap on teardown to stop tap leak (#663)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:11:05 +00:00' --until='2026-10-28 08:11:05 +00:00' --full-history --no-merges -- Snapzy/Services/Capture/CaptureEventTapController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (11 lines × 3) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:867— Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:867-877 | Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1849-1859 | Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:272-282 — 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 (11 lines × 3) Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:202— Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:202-212 | Snapzy/Features/Onboarding/Components/OnboardingDiagnosticsOptInView.swift:61-71 | Snapzy/Features/Onboarding/Components/OnboardingSponsorView.swift:59-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:202` 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, `Snapzy/Features/Onboarding/Components/OnboardingSponsorView.swift:70` calls `buttonStyle` and `Snapzy/Features/Onboarding/Components/OnboardingDiagnosticsOptInView.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 (11 lines × 3) Snapzy/Services/Cloud/S3CloudProvider.swift:148— Snapzy/Services/Cloud/S3CloudProvider.swift:148-158 | Snapzy/Services/Cloud/S3CloudProvider.swift:256-266 | Snapzy/Services/Cloud/S3CloudProvider.swift:345-355 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:1293— Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:1293-1303 | Snapzy/Shared/Components/ShortcutRecorderView.swift:167-177 | Snapzy/Shared/Components/SingleKeyRecorderView.swift:166-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) Snapzy/Features/History/Components/HistoryCardView.swift:297— Snapzy/Features/History/Components/HistoryCardView.swift:297-304 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:277-284 | Snapzy/Features/History/Components/HistoryItemView.swift:186-193 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryCardView.swift` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) Snapzy/Features/Preferences/Components/PreferencesCloudCredentialExportSheet.swift:71— Snapzy/Features/Preferences/Components/PreferencesCloudCredentialExportSheet.swift:71-78 | Snapzy/Features/Preferences/Components/PreferencesCloudCredentialImportSheet.swift:53-60 | Snapzy/Features/Preferences/Components/PreferencesCustomOCRModelSheet.swift:97-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Preferences/Components/PreferencesCloudCredentialExportSheet.swift:71` 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 `alignment` to `.leading` in one and `.top` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Preferences/Components/PreferencesCustomOCRModelSheet.swift:105` calls `fixedSize` and `Snapzy/Features/Preferences/Components/PreferencesCloudCredentialExportSheet.swift:79` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:404— Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:404-411 | Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:443-450 | Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:487-494 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:433— Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:433-440 | Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:442-449 | Snapzy/Features/Recording/RecordingCoordinator.swift:1285-1292 — 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.
Change-coupling hub: ShortcutOverlayModels.swift → AppStatusBarController.swift, CaptureViewModel.swift, PreferencesShortcutsSettingsView.swift Snapzy/Features/Shortcuts/ShortcutOverlayModels.swift— `Snapzy/Features/Shortcuts/ShortcutOverlayModels.swift` changes together with 3 other files — `Snapzy/App/AppStatusBarController.swift`, `Snapzy/Features/Capture/CaptureViewModel.swift`, `Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: SnapzyConfigurationDefaultDocument.swift → PreferencesKeys.swift, SnapzyConfigurationExporter.swift, SnapzyConfigurationImporter.swift Snapzy/Services/Configuration/SnapzyConfigurationDefaultDocument.swift— `Snapzy/Services/Configuration/SnapzyConfigurationDefaultDocument.swift` changes together with 3 other files — `Snapzy/Features/Preferences/Models/PreferencesKeys.swift`, `Snapzy/Services/Configuration/SnapzyConfigurationExporter.swift`, `Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: AnnotateQuickPropertiesBar.swift → AnnotateCanvasDrawingView.swift, AnnotateAnnotationFactory.swift, AnnotateAnnotationRenderer.swift Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift— `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift` changes together with 3 other files — `Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift`, `Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift`, `Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:605— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:605-663 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:700-776 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:813-866 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:939-986 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:1012-1064 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Snapzy/Features/History/Components/HistoryCardView.swift:227— Snapzy/Features/History/Components/HistoryCardView.swift:227-237 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:194-204 | Snapzy/Features/History/Components/HistoryToolbar.swift:121-131 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:514-524 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:908-918 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:49— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:49-141 | Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:58-84 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:15-104 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:47-163 | Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:73-124 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (27 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1113— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1113-1139 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2448-2474 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (27 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:310— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:310-336 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:271-297 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:310` 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 (27 lines × 2) Snapzy/Shared/Localization/AppLanguageManager.swift:144— Snapzy/Shared/Localization/AppLanguageManager.swift:144-170 | scripts/swift-tools/ocr/ocr-readme-benchmark.swift:61-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (26 lines × 2) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:295— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:295-320 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:442-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:843— Snapzy/Features/Capture/CaptureViewModel.swift:843-868 | Snapzy/Features/Capture/CaptureViewModel.swift:946-971 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:843` 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 (26 lines × 2) Snapzy/Services/Capture/CaptureOverlayShortcutSettings.swift:254— Snapzy/Services/Capture/CaptureOverlayShortcutSettings.swift:254-279 | Snapzy/Services/Configuration/SnapzyConfigurationShortcutCodec.swift:69-94 — 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 `Snapzy/Services/Capture/CaptureOverlayShortcutSettings.swift:254` 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 (24 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:93— Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:93-116 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:271-294 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:270` calls `cornerRadius` and `Snapzy/Features/Annotate/Components/AnnotateSidebarComponents.swift:92` 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 (24 lines × 2) Snapzy/Features/History/HistoryWindowController.swift:20— Snapzy/Features/History/HistoryWindowController.swift:20-43 | Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:125-148 — 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 `Snapzy/Features/History/HistoryWindowController.swift:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:375— Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:375-398 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:341-364 — 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 (10–11 lines × 2) Snapzy/Services/Capture/ScreenCaptureManager.swift:2036— Snapzy/Services/Capture/ScreenCaptureManager.swift:2036-2046 | Snapzy/Services/Capture/ScreenRecordingManager.swift:1796-1805 — 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 `Snapzy/Services/Capture/ScreenCaptureManager.swift:2036` 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–11 lines × 2) Snapzy/Services/Cloud/CloudUsageService.swift:457— Snapzy/Services/Cloud/CloudUsageService.swift:457-467 | Snapzy/Services/Cloud/CloudUsageService.swift:491-500 — both copies are in the same file, so extract the 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 `Snapzy/Services/Cloud/CloudUsageService.swift:457` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) Snapzy/Services/History/CaptureHistoryStore.swift:64— Snapzy/Services/History/CaptureHistoryStore.swift:64-73 | Snapzy/Services/History/CaptureHistoryStore.swift:78-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Services/History/CaptureHistoryStore.swift:64` 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 (10 lines × 3) Snapzy/Features/History/Components/HistoryFloatingContentView.swift:356— Snapzy/Features/History/Components/HistoryFloatingContentView.swift:356-365 | Snapzy/Features/History/Components/HistoryToolbar.swift:45-54 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:437-446 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryToolbar.swift` and `Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 `Snapzy/Features/History/Components/HistoryFloatingContentView.swift:356` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 3) Snapzy/Services/Cloud/S3MultipartUploader.swift:162— Snapzy/Services/Cloud/S3MultipartUploader.swift:162-171 | Snapzy/Services/Cloud/S3MultipartUploader.swift:239-248 | Snapzy/Services/Cloud/S3MultipartUploader.swift:265-274 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:877— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:877-886 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:888-897 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2281-2290 — 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 (54 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:799— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:799-852 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2203-2256 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:799` 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 (54 lines × 2) Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:306— Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:306-359 | Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:402-455 — both copies are in the same file, so extract the 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 `Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:306` 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 (26–27 lines × 2) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:676— Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:676-701 | Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift:199-225 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 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 `Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:676` 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 (26–27 lines × 2) Snapzy/Features/Annotate/Services/AnnotateMockup3DRenderer.swift:31— Snapzy/Features/Annotate/Services/AnnotateMockup3DRenderer.swift:31-57 | Snapzy/Features/Annotate/Services/AnnotateMockupExporter.swift:107-132 — 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 `Snapzy/Features/Annotate/Services/AnnotateMockup3DRenderer.swift:31` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Annotate/Services/AnnotateMockupExporter.swift:106` calls `frame` and `Snapzy/Features/Annotate/Services/AnnotateMockup3DRenderer.swift:30` 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 (23 lines × 3) Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:106— Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:106-128 | Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:140-162 | Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:215-237 — 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 `Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:106` 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 (23 lines × 3) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:708— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:708-730 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:947-969 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:1020-1042 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (19 lines × 2) Snapzy/Features/Annotate/Models/AnnotateAnnotationToolType.swift:52— Snapzy/Features/Annotate/Models/AnnotateAnnotationToolType.swift:52-70 | Snapzy/Features/Annotate/Models/AnnotateAnnotationToolType.swift:74-92 — both copies are in the same file, so extract the 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 (19 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:656— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:656-674 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:557-575 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:656` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:576` calls `offset` and `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:675` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 3) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:649— Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:649-665 | Snapzy/Features/QuickAccess/Components/QuickAccessCardView.swift:726-742 | Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift:178-194 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 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 (17 lines × 3) Snapzy/Features/History/Components/HistoryCardView.swift:110— Snapzy/Features/History/Components/HistoryCardView.swift:110-126 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:107-123 | Snapzy/Features/History/Components/HistoryItemView.swift:124-140 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryCardView.swift` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/History/Components/HistoryCardView.swift:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–16 lines × 2) Snapzy/Services/Capture/AXElementSnapshot.swift:139— Snapzy/Services/Capture/AXElementSnapshot.swift:139-153 | Snapzy/Services/Capture/ActiveWindowResolver.swift:112-127 — 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–16 lines × 2) Snapzy/Services/Cloud/S3CloudProvider.swift:188— Snapzy/Services/Cloud/S3CloudProvider.swift:188-203 | Snapzy/Services/Cloud/S3CloudProvider.swift:350-364 — both copies are in the same file, so extract the 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 `Snapzy/Services/Cloud/S3CloudProvider.swift:188` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) Snapzy/Features/History/Components/HistoryCardView.swift:306— Snapzy/Features/History/Components/HistoryCardView.swift:306-318 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:286-298 | Snapzy/Features/History/Components/HistoryItemView.swift:195-207 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryCardView.swift` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/History/Components/HistoryCardView.swift:320` calls `relativeTimeString`, `localizedString`, `Date` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:300` 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 (13 lines × 3) Snapzy/Features/Recording/Components/RecordingToolbarStyles.swift:58— Snapzy/Features/Recording/Components/RecordingToolbarStyles.swift:58-70 | Snapzy/Features/Recording/Components/RecordingToolbarStyles.swift:76-88 | Snapzy/Features/Recording/Components/RecordingToolbarStyles.swift:123-135 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–13 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:2062— Snapzy/Features/Capture/CaptureViewModel.swift:2062-2069 | Snapzy/Features/Capture/CaptureViewModel.swift:2789-2801 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:2062` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–13 lines × 2) Snapzy/Features/Recording/RecordingCoordinator.swift:724— Snapzy/Features/Recording/RecordingCoordinator.swift:724-736 | Snapzy/Features/Recording/RecordingCoordinator.swift:897-904 — both copies are in the same file, so extract the 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) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1501— Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1501-1512 | Snapzy/Features/QuickAccess/Components/QuickAccessDraggableView.swift:237-248 | Snapzy/Features/VideoEditor/Models/VideoEditorSessionData.swift:47-58 — 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 `Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1501` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:119— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:119-130 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:274-285 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:424-435 — 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 `Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–12 lines × 2) Snapzy/Features/Annotate/Services/AnnotationSessionStore.swift:299— Snapzy/Features/Annotate/Services/AnnotationSessionStore.swift:299-307 | Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:388-399 — 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 `Snapzy/Features/Annotate/Services/AnnotationSessionStore.swift:299` 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–12 lines × 2) Snapzy/Features/Preferences/Components/PreferencesAnnotatePreview.swift:40— Snapzy/Features/Preferences/Components/PreferencesAnnotatePreview.swift:40-48 | Snapzy/Features/Preferences/Components/PreferencesCapturePreview.swift:95-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 4) Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:202— Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:202-211 | Snapzy/Features/Onboarding/Components/OnboardingDiagnosticsOptInView.swift:61-70 | Snapzy/Features/Onboarding/Components/OnboardingSkipConfirmationView.swift:46-55 | Snapzy/Features/Onboarding/Components/OnboardingSponsorView.swift:59-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:202` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Onboarding/Components/OnboardingCompletionView.swift:200` calls `Spacer` and `Snapzy/Features/Onboarding/Components/OnboardingSkipConfirmationView.swift:44` 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 (10 lines × 4) Snapzy/Features/History/Managers/HistoryFloatingManager.swift:521— Snapzy/Features/History/Managers/HistoryFloatingManager.swift:521-531 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:120-130 | Snapzy/Features/Shortcuts/ShortcutOverlayManager.swift:88-97 | Snapzy/Services/Capture/SmartElement/SmartElementCaptureController.swift:185-194 — 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.
Duplicated block (8–9 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:84— Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:84-91 | Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:111-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `3` in one and `6` 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) Snapzy/Services/Capture/ActiveWindowResolver.swift:81— Snapzy/Services/Capture/ActiveWindowResolver.swift:81-88 | Snapzy/Services/Capture/WindowSelectionQueryService.swift:415-423 — 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 `Snapzy/Services/Capture/ActiveWindowResolver.swift:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) Snapzy/Features/Annotate/Components/AnnotateCutOutOverlayView.swift:49— Snapzy/Features/Annotate/Components/AnnotateCutOutOverlayView.swift:49-55 | Snapzy/Features/Annotate/Components/AnnotateCutOutOverlayView.swift:61-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 `Snapzy/Features/Annotate/Components/AnnotateCutOutOverlayView.swift:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) Snapzy/Features/VideoEditor/VideoEditorState.swift:297— Snapzy/Features/VideoEditor/VideoEditorState.swift:297-304 | Snapzy/Features/VideoEditor/VideoEditorState.swift:3291-3297 — both copies are in the same file, so extract the 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 `Snapzy/Features/VideoEditor/VideoEditorState.swift:3291` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 3) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:176— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:176-182 | Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:315-321 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:71-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) Snapzy/Features/Annotate/Services/AnnotateShortcutManager.swift:275— Snapzy/Features/Annotate/Services/AnnotateShortcutManager.swift:275-281 | Snapzy/Features/Annotate/Services/AnnotateShortcutManager.swift:310-316 | Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1386-1392 — 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 (6 lines × 4) Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:47— Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:47-52 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:97-102 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:36-41 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:225-230 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:224` calls `background` and `Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:35` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:105— Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:105-110 | Snapzy/Features/Annotate/Components/AnnotateSidebarSections.swift:124-129 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoBackgroundSidebarView.swift:164-169 | Snapzy/Features/VideoEditor/Components/VideoEditorVideoBackgroundSidebarView.swift:171-176 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Sync-over-async blocking Snapzy/Services/CommandLine/CLIToolInstaller.swift:191— `run` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Snapzy/Features/QuickAccess/Services/QuickAccessCountdownTimer.swift:24— `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
DrawingCanvasNSView.mouseUp (cyclomatic 55) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1617— DrawingCanvasNSView.mouseUp has cyclomatic complexity 55 (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.
ScrollingCaptureCoordinator.startAutoScrolling (cyclomatic 51) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:265— ScrollingCaptureCoordinator.startAutoScrolling has cyclomatic complexity 51 (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.
ScrollingCaptureCoordinator.refreshPreview (cyclomatic 48) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:791— ScrollingCaptureCoordinator.refreshPreview 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.
KeyboardShortcutManager.loadShortcuts (cyclomatic 45) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1253— KeyboardShortcutManager.loadShortcuts has cyclomatic complexity 45 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ShortcutConfig.keyCodeToString (cyclomatic 100) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
DrawingCanvasNSView.mouseDragged (cyclomatic 41) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1271— DrawingCanvasNSView.mouseDragged has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScrollingCaptureStitcher.append (cyclomatic 38) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:473— ScrollingCaptureStitcher.append has cyclomatic complexity 38 (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.
AnnotateWindow.performKeyEquivalent (cyclomatic 37) Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:175— AnnotateWindow.performKeyEquivalent has cyclomatic complexity 37 (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.
DrawingCanvasNSView.keyDown (cyclomatic 36) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:619— DrawingCanvasNSView.keyDown has cyclomatic complexity 36 (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.
AnnotateQuickPropertiesBar.activePropertiesContent (cyclomatic 35) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:179— AnnotateQuickPropertiesBar.activePropertiesContent has cyclomatic complexity 35 (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.
RecordingSession.appendVideoSample (cyclomatic 30) Snapzy/Features/Recording/RecordingSession.swift:170— RecordingSession.appendVideoSample 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.
KeyboardShortcutManager.saveShortcuts (cyclomatic 30) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1169— KeyboardShortcutManager.saveShortcuts has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ShortcutConfig.keyCodeToString (cyclomatic 100) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
VideoEditorExporter.exportWithZooms (cyclomatic 30) Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:206— VideoEditorExporter.exportWithZooms has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScrollingCaptureStitcher.sweptVerifiedMatch (cyclomatic 30) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1496— ScrollingCaptureStitcher.sweptVerifiedMatch has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnnotationFactory.createAnnotation (cyclomatic 29) Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:56— AnnotationFactory.createAnnotation has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotateExporter.renderFlatFinalImage (cyclomatic 29) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:403— AnnotateExporter.renderFlatFinalImage 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.
CloudCredentialFormView.body (cyclomatic 29) Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:856— CloudCredentialFormView.body has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotateState.updateAnnotationProperties (cyclomatic 27) Snapzy/Features/Annotate/AnnotateState.swift:3939— AnnotateState.updateAnnotationProperties has cyclomatic complexity 27 (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.
AnnotateWindow.sendEvent (cyclomatic 27) Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:364— AnnotateWindow.sendEvent has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotationItem.edgeBandContains (cyclomatic 27) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1745— AnnotationItem.edgeBandContains has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScrollingCaptureCoordinator.updatePreviewTruthState (cyclomatic 27) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:1824— ScrollingCaptureCoordinator.updatePreviewTruthState has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QuickAccessCardView.body (cyclomatic 26) Snapzy/Features/QuickAccess/Components/QuickAccessCardView.swift:46— QuickAccessCardView.body 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.
KeyboardShortcutManager.unregisterAllShortcuts (cyclomatic 25) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1898— KeyboardShortcutManager.unregisterAllShortcuts has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ShortcutConfig.keyCodeToString (cyclomatic 100) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
CaptureSettingsView.body (cyclomatic 25) Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift:129— CaptureSettingsView.body has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScrollingCaptureStitcher.bestMatch (cyclomatic 25) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1269— ScrollingCaptureStitcher.bestMatch has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
ScrollingCaptureAccuracyBenchmark.run (cyclomatic 24) scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:165— ScrollingCaptureAccuracyBenchmark.run has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DrawingCanvasNSView.mouseDown (cyclomatic 24) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:988— DrawingCanvasNSView.mouseDown has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotateCutOutTransform.apply (cyclomatic 24) Snapzy/Features/Annotate/Services/AnnotateCutOutTransform.swift:33— AnnotateCutOutTransform.apply has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
PostCaptureActionHandler.executeActions (cyclomatic 23) Snapzy/Services/Capture/PostCaptureActionHandler.swift:281— PostCaptureActionHandler.executeActions has cyclomatic complexity 23 (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.
AnnotateCanvasView.body (cyclomatic 23) Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:88— AnnotateCanvasView.body has cyclomatic complexity 23 (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.
ScrollingCaptureStitcher.isAcceptable (cyclomatic 23) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:2040— ScrollingCaptureStitcher.isAcceptable 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.
AreaSelectionMagnifier.update (cyclomatic 22) Snapzy/Services/Capture/AreaSelectionMagnifier.swift:381— AreaSelectionMagnifier.update has cyclomatic complexity 22 (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.
LiquidGlassSegmentedControl.body (cyclomatic 22) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassSegmentedControl.swift:29— LiquidGlassSegmentedControl.body has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnnotateState.annotationPropertiesWillChange (cyclomatic 21) Snapzy/Features/Annotate/AnnotateState.swift:4098— AnnotateState.annotationPropertiesWillChange 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.
InlineAreaAnnotateRootView.body (cyclomatic 21) Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:234— InlineAreaAnnotateRootView.body has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScreenCaptureViewModel.captureOCR (cyclomatic 21) Snapzy/Features/Capture/CaptureViewModel.swift:2409— ScreenCaptureViewModel.captureOCR has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ScreenCaptureViewModel.shortcutTriggered (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
VideoEditorState.undo (cyclomatic 21) Snapzy/Features/VideoEditor/VideoEditorState.swift:1941— VideoEditorState.undo has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (VideoEditorState.redo) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
VideoEditorState.redo (cyclomatic 21) Snapzy/Features/VideoEditor/VideoEditorState.swift:2045— VideoEditorState.redo has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (VideoEditorState.undo) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ScreenRecordingManager.prepareRecording (cyclomatic 21) Snapzy/Services/Capture/ScreenRecordingManager.swift:797— ScreenRecordingManager.prepareRecording has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotateState.applySharedParameterDefaults (cyclomatic 20) Snapzy/Features/Annotate/AnnotateState.swift:4846— AnnotateState.applySharedParameterDefaults 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.
ScreenCaptureViewModel.startAreaCapture (cyclomatic 20) Snapzy/Features/Capture/CaptureViewModel.swift:702— ScreenCaptureViewModel.startAreaCapture 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. This is NOT this file's highest cyclomatic complexity: ScreenCaptureViewModel.shortcutTriggered (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
DrawingCanvasNSView.applyGestureResize (cyclomatic 20) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1518— DrawingCanvasNSView.applyGestureResize 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.
AnnotateState.updateDefaultAnnotationProperties (cyclomatic 19) Snapzy/Features/Annotate/AnnotateState.swift:4914— AnnotateState.updateDefaultAnnotationProperties has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScreenCaptureViewModel.startFrozenAreaSelection (cyclomatic 19) Snapzy/Features/Capture/CaptureViewModel.swift:1086— ScreenCaptureViewModel.startFrozenAreaSelection 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. This is NOT this file's highest cyclomatic complexity: ScreenCaptureViewModel.shortcutTriggered (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RecordingCoordinator.startRecording (cyclomatic 19) Snapzy/Features/Recording/RecordingCoordinator.swift:708— RecordingCoordinator.startRecording 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.
AreaSelectionController.startSelectionSession (cyclomatic 19) Snapzy/Services/Capture/AreaSelectionWindow.swift:562— AreaSelectionController.startSelectionSession 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.
WindowSelectionQueryService.prepareSnapshot (cyclomatic 19) Snapzy/Services/Capture/WindowSelectionQueryService.swift:52— WindowSelectionQueryService.prepareSnapshot 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.
AnnotateBottomBarView.handleCloudUpload (cyclomatic 19) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:560— AnnotateBottomBarView.handleCloudUpload 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.
DrawingCanvasNSView.resizeHandleRects (cyclomatic 19) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:836— DrawingCanvasNSView.resizeHandleRects 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.
DrawingCanvasNSView.updateCursor (cyclomatic 19) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2544— DrawingCanvasNSView.updateCursor 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.
DrawingCanvasNSView.handleCropResize (cyclomatic 19) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2840— DrawingCanvasNSView.handleCropResize has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SearchText.bestMatch (cyclomatic 19) Snapzy/Features/Preferences/Models/PreferencesSearchEngine.swift:307— SearchText.bestMatch has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotateState.autoCropToContent (cyclomatic 18) Snapzy/Features/Annotate/AnnotateState.swift:3380— AnnotateState.autoCropToContent 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.
ScreenCaptureViewModel.prepareLazyFrozenDisplay (cyclomatic 18) Snapzy/Features/Capture/CaptureViewModel.swift:1788— ScreenCaptureViewModel.prepareLazyFrozenDisplay has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ScreenCaptureViewModel.shortcutTriggered (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RecordingCoordinator.restartRecording (cyclomatic 18) Snapzy/Features/Recording/RecordingCoordinator.swift:576— RecordingCoordinator.restartRecording 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.
RecordingCoordinator.startRecordingWithoutMicrophone (cyclomatic 18) Snapzy/Features/Recording/RecordingCoordinator.swift:883— RecordingCoordinator.startRecordingWithoutMicrophone 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.
SnapzyConfigurationImporter.collectQuickAccess (cyclomatic 18) Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift:354— SnapzyConfigurationImporter.collectQuickAccess 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.
AnnotationRenderer.drawCurrentStroke (cyclomatic 18) Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:131— AnnotationRenderer.drawCurrentStroke 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.
ToolError.errorDescription (cyclomatic 17) tools/localization/CatalogTool.swift:60— ToolError.errorDescription has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AnnotateState.commitCutOut (cyclomatic 17) Snapzy/Features/Annotate/AnnotateState.swift:3148— AnnotateState.commitCutOut has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SplashWindowController.showWindow (cyclomatic 17) Snapzy/Features/Splash/SplashWindow.swift:119— SplashWindowController.showWindow 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.
VideoEditorState.restoreSessionIfNeeded (cyclomatic 17) Snapzy/Features/VideoEditor/VideoEditorState.swift:1091— VideoEditorState.restoreSessionIfNeeded 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.
VideoEditorState.scheduleSpeedPreviewRebuild (cyclomatic 17) Snapzy/Features/VideoEditor/VideoEditorState.swift:1401— VideoEditorState.scheduleSpeedPreviewRebuild 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.
AreaSelectionController.runSessionPresentationCheck (cyclomatic 17) Snapzy/Services/Capture/AreaSelectionWindow.swift:845— AreaSelectionController.runSessionPresentationCheck 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.
RecordingAudioLevelMeter.rms (cyclomatic 17) Snapzy/Services/Capture/RecordingAudioLevelMeter.swift:120— RecordingAudioLevelMeter.rms has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ScreenCaptureManager.captureWindowImage (cyclomatic 17) Snapzy/Services/Capture/ScreenCaptureManager.swift:2122— ScreenCaptureManager.captureWindowImage has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScreenCaptureManager.scanTransparentFringeBounds (cyclomatic 17) Snapzy/Services/Capture/ScreenCaptureManager.swift:2442— ScreenCaptureManager.scanTransparentFringeBounds has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ScreenRecordingManager.makeContentFilter (cyclomatic 17) Snapzy/Services/Capture/ScreenRecordingManager.swift:1963— ScreenRecordingManager.makeContentFilter 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.
WindowSelectionQueryService.captureImmediateMenuBarPopoverCaptures (cyclomatic 17) Snapzy/Services/Capture/WindowSelectionQueryService.swift:176— WindowSelectionQueryService.captureImmediateMenuBarPopoverCaptures 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.
AnnotateCanvasView.canvasContent (cyclomatic 17) Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:224— AnnotateCanvasView.canvasContent 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.
AnnotationRenderer.drawBlur (cyclomatic 17) Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:652— AnnotationRenderer.drawBlur has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
HistoryFloatingPanel.performKeyEquivalent (cyclomatic 17) Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:125— HistoryFloatingPanel.performKeyEquivalent 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.
SnapzyOnboardingBarSegment.body (cyclomatic 17) Snapzy/Features/Onboarding/Components/SnapzyOnboardingActionBar.swift:96— SnapzyOnboardingBarSegment.body 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.
RecordingRegionOverlayView.calculateResizedRect (cyclomatic 17) Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:435— RecordingRegionOverlayView.calculateResizedRect has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
RecordingRegionOverlayView.drawGuidance (cyclomatic 17) Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:808— RecordingRegionOverlayView.drawGuidance 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.
ColorPickerLoupe.update (cyclomatic 17) Snapzy/Services/Capture/ColorPicker/ColorPickerLoupe.swift:73— ColorPickerLoupe.update 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.
ScrollingCaptureCoordinator.finish (cyclomatic 17) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:630— ScrollingCaptureCoordinator.finish 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.
LiquidGlassBarSegment.body (cyclomatic 17) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassActionBar.swift:85— LiquidGlassBarSegment.body 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.
AnnotateState.visionSuggestedAutoCropRect (cyclomatic 16) Snapzy/Features/Annotate/AnnotateState.swift:3436— AnnotateState.visionSuggestedAutoCropRect 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.
AnnotateTextSnapping.resolve (cyclomatic 16) Snapzy/Features/Annotate/AnnotateTextSnapping.swift:59— AnnotateTextSnapping.resolve 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.
ScreenCaptureViewModel.captureObjectCutout (cyclomatic 16) Snapzy/Features/Capture/CaptureViewModel.swift:2739— ScreenCaptureViewModel.captureObjectCutout has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ScreenCaptureViewModel.shortcutTriggered (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RecordingSession.appendAudioSample (cyclomatic 16) Snapzy/Features/Recording/RecordingSession.swift:283— RecordingSession.appendAudioSample 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.
RecordingSession.appendMicrophoneSample (cyclomatic 16) Snapzy/Features/Recording/RecordingSession.swift:328— RecordingSession.appendMicrophoneSample 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.
RecordingSession.logAudioSampleFormatIfNeeded (cyclomatic 16) Snapzy/Features/Recording/RecordingSession.swift:461— RecordingSession.logAudioSampleFormatIfNeeded 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.
VideoEditorState.play (cyclomatic 16) Snapzy/Features/VideoEditor/VideoEditorState.swift:1231— VideoEditorState.play 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.
AreaSelectionOverlayView.handlePrimaryMouseUp (cyclomatic 16) Snapzy/Services/Capture/AreaSelectionWindow.swift:4715— AreaSelectionOverlayView.handlePrimaryMouseUp 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.
FrozenAreaCaptureSession.cropCompositeImage (cyclomatic 16) Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:228— FrozenAreaCaptureSession.cropCompositeImage 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.
KeyboardShortcutManager.seedDefaultClearedShortcutsOnFirstLaunchIfNeeded (cyclomatic 16) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1396— KeyboardShortcutManager.seedDefaultClearedShortcutsOnFirstLaunchIfNeeded has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ShortcutConfig.keyCodeToString (cyclomatic 100) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
AnnotateBottomBarView.annotateActionButtons (cyclomatic 16) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:399— AnnotateBottomBarView.annotateActionButtons 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.
AnnotationItem.containsPoint (cyclomatic 16) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1688— AnnotationItem.containsPoint 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.
BlurEffectRenderer.drawCIFilterRegion (cyclomatic 16) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:415— BlurEffectRenderer.drawCIFilterRegion has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CloudCredentialFormView.saveAndTest (cyclomatic 16) Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:1299— CloudCredentialFormView.saveAndTest has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VideoEditorClipStripView.bodyGesture (cyclomatic 16) Snapzy/Features/VideoEditor/Components/VideoEditorClipStripView.swift:405— VideoEditorClipStripView.bodyGesture has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScrollingCaptureCoordinator.waitForSettledAutoScrollFrame (cyclomatic 16) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:539— ScrollingCaptureCoordinator.waitForSettledAutoScrollFrame 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.
ScrollingCaptureSessionMetrics.recordRefreshSuccess (cyclomatic 16) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureMetrics.swift:155— ScrollingCaptureSessionMetrics.recordRefreshSuccess has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ScrollingCaptureStitcher.priorPenalty (cyclomatic 16) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1936— ScrollingCaptureStitcher.priorPenalty 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.
ScrollingCaptureStitcher.isAmbiguous (cyclomatic 16) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:2086— ScrollingCaptureStitcher.isAmbiguous 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.
DrawingCanvasNSView.mouseUp (cognitive 101) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1617— DrawingCanvasNSView.mouseUp has cognitive complexity 101 (threshold 15). Drivers by points: if/else 35 (76 pts), boolean chains 14, loops 2 (5 pts), match/switch 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 47). 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.
ScrollingCaptureCoordinator.refreshPreview (cognitive 85) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:791— ScrollingCaptureCoordinator.refreshPreview has cognitive complexity 85 (threshold 15). Drivers by points: ternaries 14 (37 pts), if/else 21 (36 pts), boolean chains 9, match/switch 1 (2 pts), error handling 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScrollingCaptureCoordinator.startAutoScrolling (cognitive 79) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:265— ScrollingCaptureCoordinator.startAutoScrolling has cognitive complexity 79 (threshold 15). Drivers by points: if/else 29 (56 pts), boolean chains 16, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawingCanvasNSView.mouseDragged (cognitive 62) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1271— DrawingCanvasNSView.mouseDragged has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 13, loops 2 (4 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawingCanvasNSView.keyDown (cognitive 51) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:619— DrawingCanvasNSView.keyDown has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 10, match/switch 1, ternaries 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloudCredentialFormView.body (cognitive 45) Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:856— CloudCredentialFormView.body has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (32 pts), ternaries 4 (8 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowSelectionQueryService.prepareSnapshot (cognitive 44) Snapzy/Services/Capture/WindowSelectionQueryService.swift:52— WindowSelectionQueryService.prepareSnapshot has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (30 pts), ternaries 3 (9 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyboardShortcutManager.loadShortcuts (cognitive 44) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1253— KeyboardShortcutManager.loadShortcuts has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 22, if/else 22. 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.
ScrollingCaptureStitcher.append (cognitive 42) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:473— ScrollingCaptureStitcher.append has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 16, ternaries 5 (6 pts) (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.
AnnotateWindow.performKeyEquivalent (cognitive 40) Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:175— AnnotateWindow.performKeyEquivalent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 13, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ScrollingCaptureCoordinator.updatePreviewTruthState (cognitive 40) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:1824— ScrollingCaptureCoordinator.updatePreviewTruthState has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 3 (9 pts), boolean chains 8, 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.
ScreenCaptureViewModel.startFrozenAreaSelection (cognitive 38) Snapzy/Features/Capture/CaptureViewModel.swift:1086— ScreenCaptureViewModel.startFrozenAreaSelection has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), error handling 2 (6 pts), ternaries 1 (4 pts), match/switch 2, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecordingSession.appendVideoSample (cognitive 38) Snapzy/Features/Recording/RecordingSession.swift:170— RecordingSession.appendVideoSample has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 14 (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.
VideoEditorExporter.exportWithZooms (cognitive 38) Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:206— VideoEditorExporter.exportWithZooms has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 6, loops 3 (4 pts), error handling 2, ternaries 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AnnotationItem.edgeBandContains (cognitive 37) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1745— AnnotationItem.edgeBandContains has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 12, ternaries 1 (3 pts), match/switch 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ScrollingCaptureStitcher.sweptVerifiedMatch (cognitive 37) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1496— ScrollingCaptureStitcher.sweptVerifiedMatch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 13, loops 4 (5 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.
ScreenCaptureViewModel.captureOCR (cognitive 36) Snapzy/Features/Capture/CaptureViewModel.swift:2409— ScreenCaptureViewModel.captureOCR has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 3 (6 pts), boolean chains 2, error handling 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.
AnnotateQuickPropertiesBar.activePropertiesContent (cognitive 34) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:179— AnnotateQuickPropertiesBar.activePropertiesContent has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 30, ternaries 3, 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.
AnnotateWindow.sendEvent (cognitive 34) Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:364— AnnotateWindow.sendEvent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 2, match/switch 1 (nesting depth added 15). 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.
CaptureSettingsView.body (cognitive 33) Snapzy/Features/Preferences/Components/PreferencesCaptureSettingsView.swift:129— CaptureSettingsView.body has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawingCanvasNSView.resizeHandleRects (cognitive 32) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:836— DrawingCanvasNSView.resizeHandleRects has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 4 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 15). 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.
AnnotateState.updateAnnotationProperties (cognitive 31) Snapzy/Features/Annotate/AnnotateState.swift:3939— AnnotateState.updateAnnotationProperties has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PostCaptureActionHandler.executeActions (cognitive 31) Snapzy/Services/Capture/PostCaptureActionHandler.swift:281— PostCaptureActionHandler.executeActions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 7 (9 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ScrollingCaptureAccuracyBenchmark.run (cognitive 31) scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:165— ScrollingCaptureAccuracyBenchmark.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 12, loops 1, ternaries 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.
SandboxOffDataMigrationService.mergeDirectoryIfPresent (cognitive 30) Snapzy/Services/Migration/SandboxOffDataMigrationService.swift:277— SandboxOffDataMigrationService.mergeDirectoryIfPresent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 2 (3 pts), boolean chains 2, loops 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.
AnnotateBottomBarView.handleCloudUpload (cognitive 30) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:560— AnnotateBottomBarView.handleCloudUpload has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawingCanvasNSView.applyGestureResize (cognitive 30) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:1518— DrawingCanvasNSView.applyGestureResize has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 7 (11 pts), boolean chains 4, match/switch 2 (3 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.
InlineAreaAnnotateRootView.body (cognitive 29) Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:234— InlineAreaAnnotateRootView.body has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, match/switch 1, ternaries 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.
KeyboardShortcutManager.saveShortcuts (cognitive 29) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1169— KeyboardShortcutManager.saveShortcuts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 29. 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.
RecordingCoordinator.startRecording (cognitive 28) Snapzy/Features/Recording/RecordingCoordinator.swift:708— RecordingCoordinator.startRecording has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (23 pts), error handling 2, loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawingCanvasNSView.mouseDown (cognitive 28) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:988— DrawingCanvasNSView.mouseDown has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5, match/switch 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchText.bestMatch (cognitive 28) Snapzy/Features/Preferences/Models/PreferencesSearchEngine.swift:307— SearchText.bestMatch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 10). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuickAccessCardView.body (cognitive 28) Snapzy/Features/QuickAccess/Components/QuickAccessCardView.swift:46— QuickAccessCardView.body has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11, ternaries 3 (4 pts) (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.
RecordingCoordinator.restartRecording (cognitive 27) Snapzy/Features/Recording/RecordingCoordinator.swift:576— RecordingCoordinator.restartRecording has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 pts), error handling 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoEditorState.makeSpeedPreviewItem (cognitive 27) Snapzy/Features/VideoEditor/VideoEditorState.swift:1484— VideoEditorState.makeSpeedPreviewItem has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 3 (4 pts), ternaries 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AreaSelectionController.startSelectionSession (cognitive 27) Snapzy/Services/Capture/AreaSelectionWindow.swift:562— AreaSelectionController.startSelectionSession has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, ternaries 2, 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.
AreaSelectionOverlayView.handlePrimaryMouseUp (cognitive 27) Snapzy/Services/Capture/AreaSelectionWindow.swift:4715— AreaSelectionOverlayView.handlePrimaryMouseUp has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (4 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.
ScreenCaptureViewModel.prepareLazyFrozenDisplay (cognitive 26) Snapzy/Features/Capture/CaptureViewModel.swift:1788— ScreenCaptureViewModel.prepareLazyFrozenDisplay has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 1 (3 pts), boolean chains 2, 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.
RecordingCoordinator.startRecordingWithoutMicrophone (cognitive 26) Snapzy/Features/Recording/RecordingCoordinator.swift:883— RecordingCoordinator.startRecordingWithoutMicrophone has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 2, loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AreaSelectionController.runSessionPresentationCheck (cognitive 26) Snapzy/Services/Capture/AreaSelectionWindow.swift:845— AreaSelectionController.runSessionPresentationCheck has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 5, match/switch 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowSelectionQueryService.captureImmediateMenuBarPopoverCaptures (cognitive 26) Snapzy/Services/Capture/WindowSelectionQueryService.swift:176— WindowSelectionQueryService.captureImmediateMenuBarPopoverCaptures has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, 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.
S3MultipartUploader.upload (cognitive 26) Snapzy/Services/Cloud/S3MultipartUploader.swift:47— S3MultipartUploader.upload has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 2 (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.
ScrollingCaptureStitcher.bestMatch (cognitive 26) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1269— ScrollingCaptureStitcher.bestMatch has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 12 (13 pts) (nesting depth added 1). Of this number, 20 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
ScrollingCaptureStitcher.isAcceptable (cognitive 26) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:2040— ScrollingCaptureStitcher.isAcceptable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 8, ternaries 3 (4 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenCaptureManager.captureAllDisplays (cognitive 25) Snapzy/Services/Capture/ScreenCaptureManager.swift:717— ScreenCaptureManager.captureAllDisplays has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (8 pts), loops 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenRecordingManager.prepareRecording (cognitive 25) Snapzy/Services/Capture/ScreenRecordingManager.swift:797— ScreenRecordingManager.prepareRecording has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 5 (6 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SnapzyConfigurationImporter.collectQuickAccess (cognitive 25) Snapzy/Services/Configuration/SnapzyConfigurationImporter.swift:354— SnapzyConfigurationImporter.collectQuickAccess has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (23 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.
AnnotationFactory.createAnnotation (cognitive 25) Snapzy/Features/Annotate/Services/AnnotateAnnotationFactory.swift:56— AnnotationFactory.createAnnotation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 2 (4 pts), boolean chains 2, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotateExporter.renderFlatFinalImage (cognitive 25) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:403— AnnotateExporter.renderFlatFinalImage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 6, loops 1, match/switch 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.
AnnotateState.applySharedParameterDefaults (cognitive 24) Snapzy/Features/Annotate/AnnotateState.swift:4846— AnnotateState.applySharedParameterDefaults has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 9 (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.
RecordingAudioLevelMeter.rms (cognitive 24) Snapzy/Services/Capture/RecordingAudioLevelMeter.swift:120— RecordingAudioLevelMeter.rms has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyboardShortcutManager.unregisterAllShortcuts (cognitive 24) Snapzy/Services/Shortcuts/KeyboardShortcutManager.swift:1898— KeyboardShortcutManager.unregisterAllShortcuts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24. 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.
VideoEditorCameraCPUProbe.main (cognitive 24) scripts/swift-tools/video-editor-performance/camera-cpu-probe.swift:11— VideoEditorCameraCPUProbe.main has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (9 pts), ternaries 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScrollingCaptureCoordinator.waitForSettledAutoScrollFrame (cognitive 24) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:539— ScrollingCaptureCoordinator.waitForSettledAutoScrollFrame has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 5, loops 2, ternaries 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.
ScreenCaptureViewModel.refreshFrozenDisplaysAfterTransition (cognitive 23) Snapzy/Features/Capture/CaptureViewModel.swift:1929— ScreenCaptureViewModel.refreshFrozenDisplaysAfterTransition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoogleDriveCloudProvider.performResumableUpload (cognitive 23) Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:333— GoogleDriveCloudProvider.performResumableUpload has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, 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.
AnnotateCanvasView.body (cognitive 23) Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:88— AnnotateCanvasView.body has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 11. 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.
AnnotationRenderer.drawCurrentStroke (cognitive 23) Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:131— AnnotationRenderer.drawCurrentStroke has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (4 pts), loops 1 (2 pts), boolean chains 1, 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.
RecordingSession.appendMicrophoneSample (cognitive 22) Snapzy/Features/Recording/RecordingSession.swift:328— RecordingSession.appendMicrophoneSample has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AreaSelectionMagnifier.update (cognitive 22) Snapzy/Services/Capture/AreaSelectionMagnifier.swift:381— AreaSelectionMagnifier.update has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 8, ternaries 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.
ScreenRecordingManager.makeContentFilter (cognitive 22) Snapzy/Services/Capture/ScreenRecordingManager.swift:1963— ScreenRecordingManager.makeContentFilter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawingCanvasNSView.updateCursor (cognitive 22) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2544— DrawingCanvasNSView.updateCursor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoryFloatingPanel.performKeyEquivalent (cognitive 22) Snapzy/Features/History/Managers/HistoryFloatingPanel.swift:125— HistoryFloatingPanel.performKeyEquivalent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6 (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.
ScrollingCaptureOffsetVerifier.plan (cognitive 22) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureOffsetVerifier.swift:237— ScrollingCaptureOffsetVerifier.plan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiquidGlassSegmentedControl.body (cognitive 22) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassSegmentedControl.swift:29— LiquidGlassSegmentedControl.body has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 17 (18 pts), boolean chains 3, if/else 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.
AppDelegate.presentDatabaseRecoveryFlow (cognitive 21) Snapzy/App/SnapzyApp.swift:282— AppDelegate.presentDatabaseRecoveryFlow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (8 pts), error handling 2 (6 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotateState.updateDefaultAnnotationProperties (cognitive 21) Snapzy/Features/Annotate/AnnotateState.swift:4914— AnnotateState.updateDefaultAnnotationProperties has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 4 (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.
ScreenCaptureViewModel.startAreaCapture (cognitive 21) Snapzy/Features/Capture/CaptureViewModel.swift:702— ScreenCaptureViewModel.startAreaCapture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 4, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RecordingSession.appendAudioSample (cognitive 21) Snapzy/Features/Recording/RecordingSession.swift:283— RecordingSession.appendAudioSample has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoEditorState.play (cognitive 21) Snapzy/Features/VideoEditor/VideoEditorState.swift:1231— VideoEditorState.play has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, 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.
VideoEditorState.scheduleSpeedPreviewRebuild (cognitive 21) Snapzy/Features/VideoEditor/VideoEditorState.swift:1401— VideoEditorState.scheduleSpeedPreviewRebuild has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 6, error handling 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.
FrozenAreaCaptureSession.cropCompositeImage (cognitive 21) Snapzy/Services/Capture/FrozenAreaCaptureSession.swift:228— FrozenAreaCaptureSession.cropCompositeImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (5 pts), boolean chains 3, 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.
ScreenCaptureManager.captureWindowImage (cognitive 21) Snapzy/Services/Capture/ScreenCaptureManager.swift:2122— ScreenCaptureManager.captureWindowImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 2). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SimpleTOMLParser.splitArray (cognitive 21) Snapzy/Services/Configuration/SimpleTOMLParser.swift:135— SimpleTOMLParser.splitArray has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotateSensitiveRedactionService.extractRegions (cognitive 21) Snapzy/Features/Annotate/Services/AnnotateSensitiveRedactionService.swift:354— AnnotateSensitiveRedactionService.extractRegions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 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.
CloudSettingsView.configuredView (cognitive 21) Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:182— CloudSettingsView.configuredView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloudCredentialFormView.saveAndTest (cognitive 21) Snapzy/Features/Preferences/Components/PreferencesCloudSettingsView.swift:1299— CloudCredentialFormView.saveAndTest has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10, error handling 3 (7 pts), if/else 2 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
QuickAccessDragMonitorView.continueTracking (cognitive 21) Snapzy/Features/QuickAccess/Components/QuickAccessDraggableView.swift:329— QuickAccessDragMonitorView.continueTracking has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScrollingCaptureStitcher.priorPenalty (cognitive 21) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:1936— ScrollingCaptureStitcher.priorPenalty has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotateState.autoCropToContent (cognitive 20) Snapzy/Features/Annotate/AnnotateState.swift:3380— AnnotateState.autoCropToContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8 (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.
AnnotateState.annotationPropertiesWillChange (cognitive 20) Snapzy/Features/Annotate/AnnotateState.swift:4098— AnnotateState.annotationPropertiesWillChange has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 10. 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.
VideoEditorState.restoreSessionIfNeeded (cognitive 20) Snapzy/Features/VideoEditor/VideoEditorState.swift:1091— VideoEditorState.restoreSessionIfNeeded 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.
AreaSelectionOverlayView.renderManualSelection (cognitive 20) Snapzy/Services/Capture/AreaSelectionWindow.swift:4240— AreaSelectionOverlayView.renderManualSelection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ScreenRecordingManager.stopRecording (cognitive 20) Snapzy/Services/Capture/ScreenRecordingManager.swift:1261— ScreenRecordingManager.stopRecording has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (6 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowSelectionQueryService.captureImmediateQuickLookCaptures (cognitive 20) Snapzy/Services/Capture/WindowSelectionQueryService.swift:269— WindowSelectionQueryService.captureImmediateQuickLookCaptures has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, 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.
AnnotateBottomBarView.annotateActionButtons (cognitive 20) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:399— AnnotateBottomBarView.annotateActionButtons has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 5, if/else 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotateCanvasView.canvasContent (cognitive 20) Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:224— AnnotateCanvasView.canvasContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 4, 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.
AnnotateWindowController.performCloudReUploadCopyAndClose (cognitive 20) Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1335— AnnotateWindowController.performCloudReUploadCopyAndClose has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuickAccessPinWindow.updateMousePassthrough (cognitive 20) Snapzy/Features/QuickAccess/Managers/QuickAccessPinWindow.swift:275— QuickAccessPinWindow.updateMousePassthrough has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3 (nesting depth added 9). 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.
VideoEditorSessionStore.persistWrite (cognitive 20) Snapzy/Features/VideoEditor/Services/VideoEditorSessionStore.swift:329— VideoEditorSessionStore.persistWrite has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 2 (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.
ScrollingCaptureAutoScrollController.handleCommitResult (cognitive 20) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureAutoScrollController.swift:233— ScrollingCaptureAutoScrollController.handleCommitResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScrollingCaptureCoordinator.startLiveRefreshLoopIfNeeded (cognitive 20) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:1398— ScrollingCaptureCoordinator.startLiveRefreshLoopIfNeeded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, 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.
AnnotateTextSnapping.resolve (cognitive 19) Snapzy/Features/Annotate/AnnotateTextSnapping.swift:59— AnnotateTextSnapping.resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (6 pts), boolean chains 4, 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.
CombineSnapping.resolve (cognitive 19) Snapzy/Features/Annotate/CombineSnapping.swift:5— CombineSnapping.resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (5 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.
TempCaptureManager.cleanupOrphanedFiles (cognitive 19) Snapzy/Services/Capture/TempCaptureManager.swift:272— TempCaptureManager.cleanupOrphanedFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, error handling 1 (2 pts), loops 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.
ClipboardHelper.writeSingleImageItem (cognitive 19) Snapzy/Services/Clipboard/ClipboardHelper.swift:270— ClipboardHelper.writeSingleImageItem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 2 (4 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.
AnnotateCutOutTransform.apply (cognitive 19) Snapzy/Features/Annotate/Services/AnnotateCutOutTransform.swift:33— AnnotateCutOutTransform.apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 7, match/switch 2, ternaries 2. Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
MockupExportViewForAnnotate.backgroundLayer (cognitive 19) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:1115— MockupExportViewForAnnotate.backgroundLayer has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5 (7 pts), boolean chains 2, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ShortcutsView.body (cognitive 19) Snapzy/Features/Onboarding/Components/OnboardingShortcutsView.swift:22— ShortcutsView.body has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 4 (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.
VideoEditorBottomBar.body (cognitive 19) Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift:34— VideoEditorBottomBar.body has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 4 (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.
VideoEditorClipStripView.bodyGesture (cognitive 19) Snapzy/Features/VideoEditor/Components/VideoEditorClipStripView.swift:405— VideoEditorClipStripView.bodyGesture has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (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.
SpeedTimelineTrack.interactionSegment (cognitive 19) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:527— SpeedTimelineTrack.interactionSegment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ZoomTimelineTrack.interactionSegment (cognitive 19) Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:498— ZoomTimelineTrack.interactionSegment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoryWindow.performKeyEquivalent (cognitive 18) Snapzy/Features/History/HistoryWindowController.swift:20— HistoryWindow.performKeyEquivalent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5 (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.
VideoEditorState.recalculateEstimatedFileSize (cognitive 18) Snapzy/Features/VideoEditor/VideoEditorState.swift:2890— VideoEditorState.recalculateEstimatedFileSize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenCaptureManager.scanTransparentFringeBounds (cognitive 18) Snapzy/Services/Capture/ScreenCaptureManager.swift:2442— ScreenCaptureManager.scanTransparentFringeBounds has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), loops 6 (nesting depth added 2). Of this number, 12 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenRecordingManager.logRecordingFrameDiagnostics (cognitive 18) Snapzy/Services/Capture/ScreenRecordingManager.swift:2130— ScreenRecordingManager.logRecordingFrameDiagnostics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, ternaries 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.
CaptureHistoryStore.remove (cognitive 18) Snapzy/Services/History/CaptureHistoryStore.swift:142— CaptureHistoryStore.remove has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotateWindowController.performCloudReUploadAndClose (cognitive 18) Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1241— AnnotateWindowController.performCloudReUploadAndClose has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThumbnailGenerator.generateFromImage (cognitive 18) Snapzy/Features/QuickAccess/Services/QuickAccessThumbnailGenerator.swift:93— ThumbnailGenerator.generateFromImage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColorPickerLoupe.update (cognitive 18) Snapzy/Services/Capture/ColorPicker/ColorPickerLoupe.swift:73— ColorPickerLoupe.update has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts), ternaries 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
VerticalCJKTextNormalizer.rowBands (cognitive 18) Snapzy/Services/Media/OCR/VerticalCJKTextNormalizer.swift:57— VerticalCJKTextNormalizer.rowBands has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiquidGlassBarSegment.body (cognitive 18) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassActionBar.swift:85— LiquidGlassBarSegment.body has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, ternaries 4 (6 pts), if/else 4 (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.
LiquidGlassButtonSurface.currentSubstrate (cognitive 18) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassButtonSurface.swift:99— LiquidGlassButtonSurface.currentSubstrate has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LiquidGlassButtonSurface.currentTint) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LiquidGlassButtonSurface.currentTint (cognitive 18) Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassButtonSurface.swift:114— LiquidGlassButtonSurface.currentTint has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LiquidGlassButtonSurface.currentSubstrate) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AppDelegate.ensureSandboxOffDataMigrationReadyForLaunch (cognitive 17) Snapzy/App/SnapzyApp.swift:163— AppDelegate.ensureSandboxOffDataMigrationReadyForLaunch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (7 pts), error handling 2 (6 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotateState.setTextPresentation (cognitive 17) Snapzy/Features/Annotate/AnnotateState.swift:5294— AnnotateState.setTextPresentation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
RecordingSession.logAudioSampleFormatIfNeeded (cognitive 17) Snapzy/Features/Recording/RecordingSession.swift:461— RecordingSession.logAudioSampleFormatIfNeeded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AreaSelectionController.scheduleRetainedMenuBarPopoverVisibilityRefresh (cognitive 17) Snapzy/Services/Capture/AreaSelectionWindow.swift:1001— AreaSelectionController.scheduleRetainedMenuBarPopoverVisibilityRefresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 2 (3 pts), error handling 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.
AreaSelectionController.handleLivePassthroughButton (cognitive 17) Snapzy/Services/Capture/AreaSelectionWindow.swift:1861— AreaSelectionController.handleLivePassthroughButton has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (5 pts), boolean chains 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.
ScreenCaptureManager.captureDisplaySnapshotsCore (cognitive 17) Snapzy/Services/Capture/ScreenCaptureManager.swift:470— ScreenCaptureManager.captureDisplaySnapshotsCore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (4 pts), boolean chains 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.
ArrowGeometry.taperedArrowPath (cognitive 17) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:680— ArrowGeometry.taperedArrowPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5, boolean chains 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.
BlurEffectRenderer.drawCIFilterRegion (cognitive 17) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:415— BlurEffectRenderer.drawCIFilterRegion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, ternaries 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.
SnapzyOnboardingBarSegment.body (cognitive 17) Snapzy/Features/Onboarding/Components/SnapzyOnboardingActionBar.swift:96— SnapzyOnboardingBarSegment.body has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4, ternaries 3 (4 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PreferencesSearchEngine.editDistance (cognitive 17) Snapzy/Features/Preferences/Models/PreferencesSearchEngine.swift:403— PreferencesSearchEngine.editDistance has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScrollingCaptureCoordinator.finish (cognitive 17) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureCoordinator.swift:630— ScrollingCaptureCoordinator.finish has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, match/switch 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.
InlineAreaControlGeometry.splitControlSides (cognitive 16) Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:1405— InlineAreaControlGeometry.splitControlSides has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenCaptureViewModel.prepareInlineAreaAnnotateFrozenSession (cognitive 16) Snapzy/Features/Capture/CaptureViewModel.swift:1021— ScreenCaptureViewModel.prepareInlineAreaAnnotateFrozenSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenCaptureViewModel.captureObjectCutout (cognitive 16) Snapzy/Features/Capture/CaptureViewModel.swift:2739— ScreenCaptureViewModel.captureObjectCutout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 2 (3 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SplashWindowController.showWindow (cognitive 16) Snapzy/Features/Splash/SplashWindow.swift:119— SplashWindowController.showWindow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 3, ternaries 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.
VideoEditorState.seekPlayerInternally (cognitive 16) Snapzy/Features/VideoEditor/VideoEditorState.swift:1599— VideoEditorState.seekPlayerInternally has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 1 (2 pts) (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.
AreaSelectionController.recaptureBackdropsForLuma (cognitive 16) Snapzy/Services/Capture/AreaSelectionWindow.swift:1305— AreaSelectionController.recaptureBackdropsForLuma has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, 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.
PostCaptureActionHandler.handleScreenshotCaptures (cognitive 16) Snapzy/Services/Capture/PostCaptureActionHandler.swift:63— PostCaptureActionHandler.handleScreenshotCaptures has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (4 pts), boolean chains 2 (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.
SnapzyConfigurationImporter.collectAnnotateTools (cognitive 16) Snapzy/Services/Configuration/SnapzyConfigurationShortcutsImporter.swift:233— SnapzyConfigurationImporter.collectAnnotateTools has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, 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.
AnnotationItem.containsPoint (cognitive 16) Snapzy/Features/Annotate/Models/AnnotateAnnotationItem.swift:1688— AnnotationItem.containsPoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BlurEffectRenderer.drawGaussianRegion (cognitive 16) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:266— BlurEffectRenderer.drawGaussianRegion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 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.
QuickAccessCardView.handleSwipeEnded (cognitive 16) Snapzy/Features/QuickAccess/Components/QuickAccessCardView.swift:293— QuickAccessCardView.handleSwipeEnded has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 2 (3 pts) (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.
RecordingRegionOverlayView.drawGuidance (cognitive 16) Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:808— RecordingRegionOverlayView.drawGuidance has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11, boolean chains 3, if/else 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.
VideoEditorExporter.addAudioTracks (cognitive 16) Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:732— VideoEditorExporter.addAudioTracks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (5 pts), boolean chains 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.
ScrollingCaptureEdgeDimmingDetector.dimmedDepth (cognitive 16) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureEdgeDimmingDetector.swift:97— ScrollingCaptureEdgeDimmingDetector.dimmedDepth has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 4). Of this number, 11 points are the body's own statements and 5 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.
Plan.evidence (cognitive 16) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureOffsetVerifier.swift:189— Plan.evidence has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScrollingCaptureStitcher.isAmbiguous (cognitive 16) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:2086— ScrollingCaptureStitcher.isAmbiguous has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D4 · Code Duplication· Near-duplicate member family (3 members, 17 shared lines) · ×1
Near-duplicate member family (3 members, 17 shared lines) Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:48— Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:48-77 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:81-108 | Snapzy/Features/Onboarding/Components/SnapzyCurvedHintArrow.swift:112-139 — These 3 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (71 shared lines) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:266— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:266-353 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:415-505 — These two members are variants of one another: 71 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 (52 shared lines) Snapzy/Features/Recording/RecordingCoordinator.swift:708— Snapzy/Features/Recording/RecordingCoordinator.swift:708-833 | Snapzy/Features/Recording/RecordingCoordinator.swift:883-976 — These two members are variants of one another: 52 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 (38 shared lines) Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:38— Snapzy/Features/Onboarding/DesignSystem/SnapzyUnevenRoundedRectangle.swift:38-103 | Snapzy/Shared/Extensions/View+CornerRadius.swift:26-87 — These two members are variants of one another: 38 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 (31 shared lines) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1259— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1259-1291 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2663-2695 — These two members are variants of one another: 31 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 (29 shared lines) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2665— Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2665-2718 | Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:380-433 — These two members are variants of one another: 29 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 (57 corresponding lines) · ×1
Edited copy of a member (57 corresponding lines) Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:652— Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:652-767 | Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:790-876 — These two members are one piece of code written twice and then edited apart: 57 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 (77 lines × 2) Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1242— Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1242-1318 | Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1336-1412 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1242` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1415` calls `copyImage` and `Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:1320` 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 (57 lines × 2) Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:711— Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:711-767 | Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:812-868 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:711` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:810` calls `blurEffectValue` and `Snapzy/Features/Annotate/Services/AnnotateAnnotationRenderer.swift:708` 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 (50 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:749— Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:749-798 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:130-179 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 121 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 `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:749` 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 (38–39 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:251— Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:251-288 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift:90-128 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:251` 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 (36–38 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:485— Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:485-520 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift:180-217 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (33–38 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:216— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:216-248 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:179-216 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:216` 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 (33–36 lines × 2) Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:676— Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:676-708 | Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift:52-87 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorSidebarComponents.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 121 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 `Snapzy/Features/Annotate/Components/AnnotateSidebarView.swift:676` 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 (35–36 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:443— Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:443-477 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift:141-176 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:443` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `6` in one and `4` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:479` calls `Text`, `font`, `system` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.swift:177` 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 (35 lines × 2) Snapzy/Features/Annotate/Components/AnnotateMockupCanvasView.swift:40— Snapzy/Features/Annotate/Components/AnnotateMockupCanvasView.swift:40-74 | Snapzy/Features/Annotate/Services/AnnotateMockupExporter.swift:157-191 — 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 (34 lines × 2) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:905— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:905-938 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:2309-2342 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:905` 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 (33 lines × 2) Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:634— Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:634-666 | Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift:163-195 — before extracting anything, compare `Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 89 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 (31 lines × 2) Snapzy/Features/History/Components/HistoryCardView.swift:97— Snapzy/Features/History/Components/HistoryCardView.swift:97-127 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:94-124 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryCardView.swift` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/History/Components/HistoryCardView.swift:97` 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 (28–30 lines × 2) Snapzy/Features/Annotate/Components/AnnotateMockupPresetBar.swift:73— Snapzy/Features/Annotate/Components/AnnotateMockupPresetBar.swift:73-102 | Snapzy/Features/Annotate/Components/AnnotateMockupPresetBarInline.swift:67-94 — 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 (30 lines × 2) Snapzy/Features/QuickAccess/QuickAccessManager.swift:260— Snapzy/Features/QuickAccess/QuickAccessManager.swift:260-289 | Snapzy/Features/QuickAccess/QuickAccessManager.swift:325-354 — both copies are in the same file, so extract the 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 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 (28–29 lines × 2) Snapzy/Features/Annotate/AnnotateState.swift:2332— Snapzy/Features/Annotate/AnnotateState.swift:2332-2360 | Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:343-370 — 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 `Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:343` 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 (29 lines × 2) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:325— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:325-353 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:477-505 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:325` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–28 lines × 2) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:307— Snapzy/Features/Annotate/Services/AnnotateExporter.swift:307-333 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:448-475 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:307` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:334` calls `restoreGraphicsState` and `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:476` 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 (25–27 lines × 2) Snapzy/Features/Onboarding/DesignSystem/SnapzyGlassSurface.swift:137— Snapzy/Features/Onboarding/DesignSystem/SnapzyGlassSurface.swift:137-161 | Snapzy/Shared/DesignSystem/LiquidGlass/LiquidGlassWindowBackdrop.swift:20-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/DesignSystem/SnapzyGlassSurface.swift:137` 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 (25 lines × 2) Snapzy/Services/Capture/AreaSelectionWindow.swift:4038— Snapzy/Services/Capture/AreaSelectionWindow.swift:4038-4062 | Snapzy/Services/Capture/AreaSelectionWindow.swift:4092-4116 — both copies are in the same file, so extract the 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 `Snapzy/Services/Capture/AreaSelectionWindow.swift:4038` 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 (23 lines × 2) Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:148— Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:148-170 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:199-221 — 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:148` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–22 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:705— Snapzy/Features/Capture/CaptureViewModel.swift:705-726 | Snapzy/Features/Capture/CaptureViewModel.swift:886-904 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:705` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) Snapzy/Features/History/Components/HistoryToolbar.swift:40— Snapzy/Features/History/Components/HistoryToolbar.swift:40-61 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:432-453 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryToolbar.swift` and `Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 `Snapzy/Features/History/Components/HistoryToolbar.swift:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:78— Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:78-98 | Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:188-208 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift:78` 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 (20–21 lines × 2) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:347— Snapzy/Features/Annotate/Services/AnnotateExporter.swift:347-366 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:529-549 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:347` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:345` calls `CGRect`, `drawCanvasShadow` and `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:529` 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 (19–21 lines × 2) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:242— Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:242-262 | scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-support.swift:144-162 — 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 `scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-support.swift:144` 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–20 lines × 3) Snapzy/Features/QuickAccess/QuickAccessManager.swift:904— Snapzy/Features/QuickAccess/QuickAccessManager.swift:904-923 | Snapzy/Features/QuickAccess/Services/QuickAccessThumbnailGenerator.swift:119-137 | Snapzy/Features/QuickAccess/Services/QuickAccessThumbnailGenerator.swift:188-207 — 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 `Snapzy/Features/QuickAccess/QuickAccessManager.swift:904` 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–20 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:2419— Snapzy/Features/Capture/CaptureViewModel.swift:2419-2438 | Snapzy/Features/Capture/CaptureViewModel.swift:2773-2791 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:2419` 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–20 lines × 2) Snapzy/Features/Recording/RecordingCoordinator.swift:795— Snapzy/Features/Recording/RecordingCoordinator.swift:795-814 | Snapzy/Features/Recording/RecordingCoordinator.swift:941-957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–20 lines × 2) Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:501— Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:501-511 | Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift:463-482 — before extracting anything, compare `Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift` and `Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–19 lines × 3) Snapzy/Services/Capture/ScreenCaptureManager.swift:2406— Snapzy/Services/Capture/ScreenCaptureManager.swift:2406-2422 | Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureStitcher.swift:89-107 | Snapzy/Services/Media/ForegroundCutoutService.swift:281-298 — 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 `Snapzy/Services/Capture/ScreenCaptureManager.swift:2406` 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 (18–19 lines × 2) Snapzy/Features/QuickAccess/Services/QuickAccessHoverShortcutRegistry.swift:137— Snapzy/Features/QuickAccess/Services/QuickAccessHoverShortcutRegistry.swift:137-155 | Snapzy/Services/Capture/KeystrokeMonitorService.swift:72-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–18 lines × 3) Snapzy/Features/Capture/CaptureViewModel.swift:707— Snapzy/Features/Capture/CaptureViewModel.swift:707-724 | Snapzy/Features/Capture/CaptureViewModel.swift:886-902 | Snapzy/Features/Capture/CaptureViewModel.swift:2754-2771 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–18 lines × 2) Snapzy/Features/Capture/CaptureViewModel.swift:1269— Snapzy/Features/Capture/CaptureViewModel.swift:1269-1284 | Snapzy/Features/Capture/CaptureViewModel.swift:1308-1325 — both copies are in the same file, so extract the 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 `Snapzy/Features/Capture/CaptureViewModel.swift:1269` 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–18 lines × 2) Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:1254— Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:1254-1268 | Snapzy/Shared/Components/ShortcutRecorderView.swift:125-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Preferences/Components/PreferencesShortcutsSettingsView.swift:1254` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–18 lines × 2) Snapzy/Features/QuickAccess/Models/QuickAccessActionKind.swift:148— Snapzy/Features/QuickAccess/Models/QuickAccessActionKind.swift:148-165 | Snapzy/Services/Configuration/SnapzyConfigurationShortcutsExporter.swift:176-186 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16–17 lines × 3) Snapzy/Features/Annotate/Services/AnnotateExporter.swift:314— Snapzy/Features/Annotate/Services/AnnotateExporter.swift:314-330 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:456-472 | Snapzy/Features/Annotate/Services/AnnotateExporter.swift:985-1000 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:334` calls `restoreGraphicsState` and `Snapzy/Features/Annotate/Services/AnnotateExporter.swift:476` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (2–17 lines × 3) Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:474— Snapzy/Services/Cloud/GoogleDriveCloudProvider.swift:474-475 | Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:141-157 | Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:562-578 — 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 `Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:141` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:581` calls `signingFailed` and `Snapzy/Services/Cloud/GoogleDriveOAuthService.swift:159` 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 (16–17 lines × 2) Snapzy/Services/Configuration/SimpleTOMLParser.swift:77— Snapzy/Services/Configuration/SimpleTOMLParser.swift:77-93 | Snapzy/Services/Configuration/SimpleTOMLParser.swift:142-157 — both copies are in the same file, so extract the 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 `Snapzy/Services/Configuration/SimpleTOMLParser.swift:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 4) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:606— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:606-621 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:701-716 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:940-955 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:1013-1028 — 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 `Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:606` 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–16 lines × 2) Snapzy/Features/Recording/Components/RecordingAnnotationToolbarContentBuilder.swift:43— Snapzy/Features/Recording/Components/RecordingAnnotationToolbarContentBuilder.swift:43-55 | Snapzy/Features/Recording/RecordingToolbarWindow.swift:527-542 — 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 (15 lines × 4) Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:716— Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:716-730 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:829-843 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:955-969 | Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:1028-1042 — 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 `Snapzy/Features/Annotate/Services/AnnotateBlurEffectRenderer.swift:716` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 3) Snapzy/Services/Cloud/S3CloudProvider.swift:185— Snapzy/Services/Cloud/S3CloudProvider.swift:185-199 | Snapzy/Services/Cloud/S3CloudProvider.swift:258-272 | Snapzy/Services/Cloud/S3CloudProvider.swift:347-361 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–14 lines × 4) scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:92— scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:92-105 | scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:106-119 | scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:120-128 | scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:134-146 — 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 `scripts/swift-tools/scrolling-capture-accuracy/scrolling-capture-accuracy-benchmark.swift:92` 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 (12–14 lines × 2) Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:245— Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:245-258 | Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:276-287 — both copies are in the same file, so extract the 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 `Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) scripts/swift-tools/ocr/ocr-readme-benchmark.swift:193— scripts/swift-tools/ocr/ocr-readme-benchmark.swift:193-205 | scripts/swift-tools/ocr/ocr-readme-benchmark.swift:207-220 — both copies are in the same file, so extract the 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 `scripts/swift-tools/ocr/ocr-readme-benchmark.swift:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) Snapzy/Features/Preferences/PreferencesView.swift:166— Snapzy/Features/Preferences/PreferencesView.swift:166-177 | Snapzy/Features/Preferences/PreferencesWindowController.swift:69-81 — 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 `Snapzy/Features/Preferences/PreferencesView.swift:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–13 lines × 2) Snapzy/Services/Capture/ScreenRecordingManager.swift:1386— Snapzy/Services/Capture/ScreenRecordingManager.swift:1386-1395 | Snapzy/Services/Capture/TempCaptureManager.swift:153-165 — 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 `Snapzy/Services/Capture/ScreenRecordingManager.swift:1386` 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 (9–12 lines × 3) Snapzy/Services/Capture/ScreenCaptureManager.swift:602— Snapzy/Services/Capture/ScreenCaptureManager.swift:602-610 | Snapzy/Services/Capture/ScreenCaptureManager.swift:1156-1164 | Snapzy/Services/Capture/ScreenCaptureManager.swift:1249-1260 — 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 `Snapzy/Services/Capture/ScreenCaptureManager.swift:602` 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 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. 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–12 lines × 2) Snapzy/Features/VideoEditor/Services/VideoEditorZoomCompositor.swift:372— Snapzy/Features/VideoEditor/Services/VideoEditorZoomCompositor.swift:372-379 | Snapzy/Features/VideoEditor/Services/VideoEditorZoomCompositor.swift:623-634 — both copies are in the same file, so extract the 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–12 lines × 2) Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureEdgeDimmingDetector.swift:108— Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureEdgeDimmingDetector.swift:108-114 | Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureOffsetVerifier.swift:248-259 — 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 `Snapzy/Services/Capture/ScrollingCapture/ScrollingCaptureEdgeDimmingDetector.swift:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 5) Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:153— Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:153-163 | Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:384-394 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:204-214 | Snapzy/Features/Onboarding/Mockups/SnapzyMockQuickAccessView.swift:350-360 | Snapzy/Features/Onboarding/Mockups/SnapzyMockShortcutsView.swift:74-84 — there are 5 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 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 `Snapzy/Features/Onboarding/Mockups/SnapzyMockAreaCaptureView.swift:153` 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–11 lines × 2) Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:99— Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:99-109 | Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:597-605 — both copies are in the same file, so extract the 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 `Snapzy/Features/VideoEditor/Services/VideoEditorExporter.swift:99` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 5) Snapzy/Features/History/Components/HistoryCardView.swift:228— Snapzy/Features/History/Components/HistoryCardView.swift:228-237 | Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:195-204 | Snapzy/Features/History/Components/HistoryToolbar.swift:122-131 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:515-524 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:909-918 — before extracting anything, compare `Snapzy/Features/History/Components/HistoryCardView.swift` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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, `Snapzy/Features/History/Components/HistoryCardView.swift:224` calls `rect` and `Snapzy/Features/History/Components/HistoryExpandedCaptureCardView.swift:194` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–10 lines × 5) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2670— Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2670-2679 | Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2694-2697 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:1647-1654 | Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:385-394 | Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:409-412 — there are 5 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 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 `Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2670` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) Snapzy/Features/Annotate/AnnotateState.swift:3941— Snapzy/Features/Annotate/AnnotateState.swift:3941-3949 | Snapzy/Features/Annotate/AnnotateState.swift:4100-4109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 4) Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1452— Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1452-1459 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1579-1586 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1606-1613 | Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1660-1667 — 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 `Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1452` 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 × 4) Snapzy/Features/History/Managers/HistoryFloatingPanelController.swift:253— Snapzy/Features/History/Managers/HistoryFloatingPanelController.swift:253-260 | Snapzy/Features/Preferences/Components/PreferencesCloudUploadHistoryView.swift:54-61 | Snapzy/Features/Recording/Components/RecordingAnnotationToolbarContentBuilder.swift:46-52 | Snapzy/Features/Recording/RecordingToolbarWindow.swift:532-538 — 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.
Duplicated block (2–7 lines × 5) Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:55— Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:55-57 | Snapzy/Features/Onboarding/Mockups/SnapzyMockFinderWindow.swift:64-65 | Snapzy/Features/Onboarding/Mockups/SnapzyMockNotesWindow.swift:23-24 | Snapzy/Features/Onboarding/Mockups/SnapzyMockSystemSettingsWindow.swift:55-61 | Snapzy/Features/Onboarding/Mockups/SnapzyMockVideoEditorWindow.swift:79-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Snapzy/Features/Onboarding/Mockups/SnapzyMockAnnotateWindow.swift:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `6` in one and `5` 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 (4–6 lines × 5) Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2687— Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2687-2692 | Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2701-2704 | Snapzy/Features/Annotate/InlineAreaAnnotateWindow.swift:1659-1662 | Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:402-407 | Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:416-419 — there are 5 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 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 `Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2687` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Snapzy/Features/Recording/Managers/RecordingRegionOverlayWindow.swift:422` calls `withAlphaComponent`, `setStroke`, `stroke` and `Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift:2707` 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.
Off the main sequence: SnapzyCLIProtocol — SnapzyCLIProtocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Swallowed exception (empty catch) Snapzy/Services/Diagnostics/DiagnosticLogger.swift:317— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated predicate Snapzy/Features/VideoEditor/Services/VideoEditorAutoFocusEngine.swift:132— `$0.time >= segment.startTime && $0.time <= segment.endTime` appears character-identically in 2 files — Snapzy/Features/VideoEditor/Services/VideoEditorAutoFocusEngine.swift, Snapzy/Features/VideoEditor/Services/VideoEditorExporter.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 Snapzy/Features/Annotate/AnnotateState.swift:2350— `abs(currentSize.width - expectedSize.width) < 0.5 && abs(currentSize.height - expectedSize.height) < 0.5` appears character-identically in 2 files — Snapzy/Features/Annotate/AnnotateState.swift, Snapzy/Features/Annotate/Managers/AnnotateWindowController.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 Snapzy/Features/Annotate/AnnotateState.swift:2357— `abs(currentSize.width - pixelWidth) < 0.5 && abs(currentSize.height - pixelHeight) < 0.5` appears character-identically in 3 files — Snapzy/Features/Annotate/AnnotateState.swift, Snapzy/Features/Annotate/Managers/AnnotateWindowController.swift, Snapzy/Features/QuickAccess/Services/QuickAccessThumbnailGenerator.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 Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift:539— `abs(point.x - preset.x) < 0.1 && abs(point.y - preset.y) < 0.1` appears character-identically in 2 files — Snapzy/Features/VideoEditor/Components/VideoEditorLeftSidebar.swift, Snapzy/Features/VideoEditor/Components/VideoEditorZoomSettingsPopover.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 Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:914— `activeDraftTarget != .favorite && canAddFavorite` appears character-identically in 2 files — Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift, Snapzy/Features/Annotate/InlineAreaAnnotateWindow.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 Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:114— `cloudManager.isConfigured && QuickAccessActionConfigurationStore.shared.isEnabled(.uploadToCloud)` appears character-identically in 2 files — Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift, Snapzy/Features/VideoEditor/Components/VideoEditorBottomBar.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 Snapzy/Features/Annotate/Components/AnnotateTextEditOverlay.swift:383— `event.keyCode == 36 || event.keyCode == 76` appears character-identically in 5 files — Snapzy/Features/Annotate/Components/AnnotateTextEditOverlay.swift, Snapzy/Features/Annotate/InlineAreaAnnotateSession.swift, Snapzy/Features/Annotate/Managers/AnnotateWindow.swift, Snapzy/Features/History/Managers/HistoryFloatingPanel.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 Snapzy/Features/History/HistoryWindowController.swift:63— `event.keyCode == 51 || event.keyCode == 117` appears character-identically in 2 files — Snapzy/Features/History/HistoryWindowController.swift, Snapzy/Features/History/Managers/HistoryFloatingPanel.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 Snapzy/Features/Annotate/Components/AnnotateTextEditOverlay.swift:373— `event.keyCode == 6 && flags == [.command, .shift]` appears character-identically in 2 files — Snapzy/Features/Annotate/Components/AnnotateTextEditOverlay.swift, Snapzy/Features/Annotate/Managers/AnnotateWindow.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 Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:352— `event.scrollingDeltaX != 0 || event.scrollingDeltaY != 0` appears character-identically in 2 files — Snapzy/Features/Annotate/Managers/AnnotateWindow.swift, Snapzy/Features/VideoEditor/Components/VideoEditorTimelineScrollCatcher.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 Snapzy/Features/History/HistoryWindowController.swift:48— `eventShortcut.keyCode == toggleShortcut.keyCode && eventShortcut.modifiers == toggleShortcut.modifiers` appears character-identically in 2 files — Snapzy/Features/History/HistoryWindowController.swift, Snapzy/Features/History/Managers/HistoryFloatingPanel.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 Snapzy/Features/Capture/CaptureViewModel.swift:468— `excludeDesktopIcons || excludeDesktopWidgets` appears character-identically in 3 files — Snapzy/Features/Capture/CaptureViewModel.swift, Snapzy/Features/Recording/RecordingCoordinator.swift, Snapzy/Services/Capture/ScreenCaptureManager.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 Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:384— `force || now - lastDragModelUpdateTime >= dragModelUpdateInterval` appears character-identically in 2 files — Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift, Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.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 Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:196— `hover.segmentId == segment.id && hover.edge != nil` appears character-identically in 2 files — Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift, Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.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 Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:520— `layout.visualEndX >= visibleRange.lowerBound && layout.visualStartX <= visibleRange.upperBound` appears character-identically in 2 files — Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift, Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.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 Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift:33— `lhs.state === rhs.state && lhs.timelineWidth == rhs.timelineWidth && lhs.visibleRange == rhs.visibleRange` appears character-identically in 2 files — Snapzy/Features/VideoEditor/Components/VideoEditorSpeedTimelineTrack.swift, Snapzy/Features/VideoEditor/Components/VideoEditorZoomTimelineTrack.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 Snapzy/Shared/Localization/AppLanguageManager.swift:150— `normalized.contains("hans") || normalized.hasPrefix("zh-cn") || normalized.hasPrefix("zh-sg")` appears character-identically in 2 files — Snapzy/Shared/Localization/AppLanguageManager.swift, scripts/swift-tools/ocr/ocr-readme-benchmark.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 Snapzy/Shared/Localization/AppLanguageManager.swift:146— `normalized.contains("hant") || normalized.hasPrefix("zh-tw") || normalized.hasPrefix("zh-hk") || normalized.hasPrefix("zh-mo")` appears character-identically in 2 files — Snapzy/Shared/Localization/AppLanguageManager.swift, scripts/swift-tools/ocr/ocr-readme-benchmark.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 Snapzy/Features/Annotate/Managers/AnnotateWindow.swift:327— `responder is NSTextView || responder is NSTextField` appears character-identically in 3 files — Snapzy/Features/Annotate/Managers/AnnotateWindow.swift, Snapzy/Features/History/HistoryWindowController.swift, Snapzy/Features/History/Managers/HistoryFloatingPanel.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 Snapzy/Features/VideoEditor/Models/VideoEditorSpeedSegment.swift:69— `startTime < other.endTime && endTime > other.startTime` appears character-identically in 2 files — Snapzy/Features/VideoEditor/Models/VideoEditorSpeedSegment.swift, Snapzy/Features/VideoEditor/Models/VideoEditorZoomSegment.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 Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:579— `state.isCombineMode && state.isManualImportSession` appears character-identically in 2 files — Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift, Snapzy/Features/Annotate/Managers/AnnotateWindowController.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 Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:255— `state.mockupRotationX != 0 || state.mockupRotationY != 0 || state.mockupRotationZ != 0` appears character-identically in 2 files — Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift, Snapzy/Features/Annotate/Components/AnnotateCanvasView.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 Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:374— `state.selectedTool == .crop && state.isCropActive` appears character-identically in 4 files — Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift, Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift, Snapzy/Features/Annotate/Components/AnnotateCropOverlayView.swift, Snapzy/Features/Annotate/Components/AnnotateToolbarView.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 Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift:377— `state.selectedTool == .cutOut && state.isCutOutActive` appears character-identically in 3 files — Snapzy/Features/Annotate/Components/AnnotateBottomBarView.swift, Snapzy/Features/Annotate/Components/AnnotateCanvasView.swift, Snapzy/Features/Annotate/Components/AnnotateToolbarView.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 Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift:1143— `target == .favorite && keepFavoriteSelectionPopoverOpen` appears character-identically in 2 files — Snapzy/Features/Annotate/Components/AnnotateQuickPropertiesBar.swift, Snapzy/Features/Annotate/InlineAreaAnnotateWindow.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.
Orphaned file Snapzy/Services/Capture/ActiveWindowResolver.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Snapzy/Features/Annotate/CombineImagesLayout.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Snapzy/Services/Media/OCR/OCRLinkDetector.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Silent fallback default in catch Snapzy/Services/History/HistoryThumbnailGenerator.swift:150— `totalThumbnailSize` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Snapzy/Features/VideoEditor/Services/VideoEditorClipThumbnailCache.swift:53— `generate` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (158986 LoC, 1365 module-visible types across 83 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 3 of 449 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 449 of the 607 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: Snapzy/Services/Capture/ActiveWindowResolver.swift, Snapzy/Features/Annotate/CombineImagesLayout.swift, Snapzy/Services/Media/OCR/OCRLinkDetector.swift. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 55/76 types (72%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `Packages/SnapzyCLIKit`.
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) as a CI step. What was searched, so you can tell an absence from a miss: the 57637 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.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
X5 · Nullable reference types· Ruby's type checker does not check nil everywhere · ×1
Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
Outdated: grdb.swift — `grdb.swift` is resolved at 7.10.0, but 7.11.1 is the newest release tagged on https://github.com/groue/GRDB.swift.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update grdb.swift` reaches this one with no change to Package.swift.
Outdated: libwebp-xcode — `libwebp-xcode` is resolved at 1.5.0, but 1.6.0 is the newest release tagged on https://github.com/SDWebImage/libwebp-Xcode.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update libwebp-xcode` reaches this one with no change to Package.swift.
Outdated: sparkle — `sparkle` is resolved at 2.8.1, but 2.10.1 is the newest release tagged on https://github.com/sparkle-project/Sparkle within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update sparkle` reaches this one with no change to Package.swift.
Outdated: swift-webp — `swift-webp` is resolved at 0.6.1, but 0.7.0 is the newest release tagged on https://github.com/ainame/Swift-WebP.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-webp` reaches this one with no change to Package.swift.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 107 file(s) — `Packages/SnapzyCLIKit/Sources/SnapzyCLIClient/AppLauncher.swift`, `Packages/SnapzyCLIKit/Sources/SnapzyCLICore/Output/OutputRenderer.swift`, `Snapzy/Features/Annotate/AnnotateState.swift`, `Snapzy/Features/Annotate/Components/AnnotateCanvasDrawingView.swift`, `Snapzy/Features/Annotate/Components/AnnotateDropZoneView.swift`, … (+102 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a184b8-3401-7b39-9aa2-ea51562a94f8 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 19 · Warnings: 928 · Recommendations: 43 · Info: 4 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 28-10-2026 @ 22:53 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.