Public report of JerryZLiu/Dayflow, published 26 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). Watchdog 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, 26 October 2026, 10:58 UTC · Survey ID cd_b3cce422fafa494b9acfa96a239b26d8
JerryZLiu/Dayflow
Measured 26 October 2026, 10:49 UTC, at code version 730d6f8
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
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 110,991 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.8 person-years · Weakest lens: Production Readiness, 34
Findings by how serious they are
8 critical747 serious53 minor
39 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
26 October 2026, 10:49 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 ▸
38of 38 dimensions measured by tools.
801of 808 findings point to an exact file and line, so you can open each one in the code. The other 7 concern the repository as a whole, such as missing documentation.
38dimensions across 6 lenses, read from 110,991 lines of product code in 2 projects.
JerryZLiu/Dayflow falls short of our standard for production because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 53 out of 100 and is rated Adequate, and six of its eight critical findings are security problems.
Production Readiness, at 34, is the weakest lens and counts most in the score. The best first step for the work it takes is making the tests check their results, worth about 5 points. Adding an automated build and test pipeline would lift Production Readiness itself, worth about 9 points. Raising Production Readiness to 70 would lift the score to about 68.
Four weaknesses in the code could be used by an attacker. Two passwords or keys are open to anyone who can read the repository. Fixing the weaknesses the scanner points to and replacing each exposed password or key would close both risks. The two tests that check nothing need to check the result they produce.
The product code is 110,991 lines, about €110,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 34 to 70, the lowest score rated Strong, the score would rise from 53 to about 68.
Code composition: what the lines of code are
Product code 96%Tests 4%
New since the last survey: 102 findings
These 102 critical or serious findings weren't in the previous survey, on 12 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
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: 34 findings
These 34 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one.
Exception handling · Swallowed exception (caught, then discarded) Dayflow/Dayflow/App/RecordingControl.swift
Rebuild cost: about €110,000 · Estimate
Cost to rebuild
€37,000 to €190,000, for 617 to 1,956 hours of work, about 0.8 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 53. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 110,991 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 1 Assertions commented out finding(s) in Test Quality — start with DayflowUITests.swift.
Raises the score by about 5 points · Low effort · Test Quality
2
Resolve the 1 Test project verifies nothing finding(s) in Test Quality — start with DayflowUITests.swift.
Raises the score by about 5 points · Low effort · Test Quality
3
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 9 points · Medium effort · CI/CD gates
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €110,000 to build again, about 0.8 person-years of work. Its weakest lens is Production Readiness, at 34 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Assertions commented out finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 1 Test Quality 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.
2 modules, with 2 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.
tools~dayflow-cli~dayflow uses repository, so a change to repository can break tools~dayflow-cli~dayflow, while a change to tools~dayflow-cli~dayflow can't break repository.
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.
810 pairs of types, where a type in repository uses a type in tools~dayflow-cli~dayflow. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository uses tools~dayflow-cli~dayflow, so a change to tools~dayflow-cli~dayflow can break repository, while a change to repository can't break tools~dayflow-cli~dayflow.
Position
Below the diagonal: repository uses a module listed above it, which is the healthy direction.
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
4
High / Critical
A07:2025 — Authentication Failures
3
High / Critical
A03:2025 — Software Supply Chain Failures
1
Medium
Roadmap
Establish a CI pipeline that builds the project and runs the test suite on every push to ensure immediate feedback. Integrate security scanning into this workflow to prevent regressions from reaching the main branch. Simultaneously, address critical test quality issues in DayflowUITests.swift by uncommenting assertions and verifying actual functionality. Finally, document architectural decisions by creating the first Architecture Decision Record.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Assertions commented out finding(s) in Test Quality — start with DayflowUITests.swift.
Run what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
God Classes: MethodTooLong: DayflowTheme.lightPalette
Dayflow/Dayflow/Core/AI/ClaudeProvider.swift
7.0
Mixed
God Classes: TooManyMethods: ClaudeProvider
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 8
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 — 747
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 — 53
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 39
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. 38 of 38 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 38 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, 801 of 808 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: test source is present (.swift) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, 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. You can widen what we reach: optional: 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 — then 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) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 0 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
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 (8 contributor(s) across 2252 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 7 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift`, `Dayflow/Dayflow/Core/AI/CLIVersionTelemetry.swift`, `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift`, `Dayflow/Dayflow/Core/AI/ClaudeTimelinePrompt.swift`, `Dayflow/Dayflow/Core/AI/CodexExecutableResolver.swift`, … (+50 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: a native UI project (Dayflow/Dayflow.xcodeproj/project.pbxproj). The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — 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. 'SQLite3' is imported (tools/dayflow-cli/Sources/dayflow/Database.swift:11), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — 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. 'SQLite3' is imported (tools/dayflow-cli/Sources/dayflow/Database.swift:11), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M3 Folder & project structure — 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. Whether the tests sit apart from production code is not visible here, because the suite is not in a form this pass reads. The test-separation credit is granted rather than withheld: this is a gap in the analyzer's language coverage, not a finding about the repository's tests. You can widen what we reach: keep the test surface somewhere a reader can find it without opening a binary — an exported/checked-in test source tree beside the production code makes the suite reviewable, diffable and discoverable by tooling.
P8 Schema migrations — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads EF Core usage in C# and the schema tooling its file scan recognises only, and no .NET project was loaded, and this repository's language is not one the scan models, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust and Dart source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust or Dart was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's Swift (Foundation mutable collections) 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.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart and Ruby source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart or Ruby was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
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.
D13 REDACTED Scanning: REDACTED 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.
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.
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.
71 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ChatCLIProcessRunner.executeStreaming at 52. A further 5 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 TimelineFailureClassification.cardMessage at 18 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift (DailyBriefApps.displayName at 17), Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift (WeeklyInteractionGraphGlyphView.body at 17). 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.
+ 66 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 ChatCLIProcessRunner.executeStreaming (cyclomatic 52), DailyWorkflowComputation.swift.computeDailyWorkflow (cyclomatic 50), ChatService.processConversation (cyclomatic 49). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 9 together lifts Cyclomatic Complexity from 6.7 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Stand up a CI pipeline, then gate Cyclomatic Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 117 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 60 down to 60 or less in Cognitive Complexity — start with DailyWorkflowComputation.swift.computeDailyWorkflow (cognitive 112), CodexProvider.transcribeScreenshots (cognitive 73), ChatService.processConversation (cognitive 71). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 7 together lifts Cognitive Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Stand up a CI pipeline, then gate Cognitive Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.1 / 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 42 MethodTooLong finding(s) in God Classes — start with DayflowBackendProvider.swift (3), ChatCLIProcessRunner.swift (2), GeminiDirectProvider+Transcription.swift (2). — One of this dimension's main actionable groups (42 warning-level).
Resolve the 35 FileTooLong finding(s) in God Classes — start with ChatCLIProcessRunner.swift, WhatsNewView.swift, FlowDistractionAgent.swift. — One of this dimension's main actionable groups (35 warning-level).
Resolve the 25 ClassTooLong finding(s) in God Classes — start with ChatCLIProcessRunner.swift, LLMService.swift, WhatsNewView.swift. — One of this dimension's main actionable groups (25 warning-level).
Stand up a CI pipeline, then gate God Classes in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
370 duplicated block group(s) detected. A further 26 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 138 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 24 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with AgentCLISupport+Parsing.swift, DailyRecapGenerator.swift, GeminiDirectProvider+ActivityCards.swift. — One of this dimension's main actionable groups (24 warning-level).
Resolve the 23 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with WeeklyDonutBuilder.swift (2), WeeklySankeyModelFactory.swift (2), WriteCommands.swift (2). — One of this dimension's main actionable groups (23 warning-level).
Resolve the 20 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with DayflowTheme.swift (2), DayflowBackendProvider.swift, GeminiDirectProvider+ActivityCards.swift. — One of this dimension's main actionable groups (20 warning-level).
Stand up a CI pipeline, then gate Code Duplication in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ 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.
2 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; 0 module(s) off the main sequence.
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 8 Low cohesion finding(s) in Cohesion (LCOM4) — start with StorageManager.swift, AnalyticsService.swift, StatusBarController.swift. — One of this dimension's main actionable groups (8 warning-level).
Stand up a CI pipeline, then gate Cohesion (LCOM4) in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution9.8 / 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.
219 test methods: 216 unit, 0 integration, 0 BDD, 3 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.7 / 10Adequategated by 2 critical 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.
Test project verifies nothing: DayflowUITestsDayflow/DayflowUITests/DayflowUITests.swift:23
No assertions: testWeeklyDashboardSnapshotIsSendableForBackgroundLoading · ×3Dayflow/DayflowTests/WeeklyDashboardBuilderTests.swift:29
What to do
Resolve the 1 Assertions commented out finding(s) in Test Quality — start with DayflowUITests.swift. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Test project verifies nothing finding(s) in Test Quality — start with DayflowUITests.swift. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 3 No assertions finding(s) in Test Quality — start with WeeklyDashboardBuilderTests.swift, DayflowUITests.swift, DayflowUITestsLaunchTests.swift. — One of this dimension's main actionable groups (3 warning-level).
Stand up a CI pipeline, then gate Test Quality in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_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.
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 0 third-party package(s) use a banned license. This repository's 1 SwiftPM file(s) declare no third-party dependencies and no committed resolution pins any, so there is no third-party package licence to grade — a complete answer, not a gap in coverage. It also commits no CocoaPods or Carthage manifest, so SwiftPM is the only package manager it takes dependencies through. This repository's OWN licence is its own choice and is not judged here.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 15 Hotspot finding(s) in Churn × Complexity Hotspots — start with ChatCLIProcessRunner.swift, FlowWebView.swift, FlowDistractionAgent.swift. — One of this dimension's main actionable groups (15 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.
1 deducted task-comment markers across 110991 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 1 TodoComment finding(s) in Explicit Debt — start with OllamaProvider.swift. — One of this dimension's main actionable groups (1 warning-level).
Stand up a CI pipeline, then gate Explicit Debt in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
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: REDACTED 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.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
4 finding(s): 0 critical, 4 high, 0 medium, 0 low. semgrep hit a parse error in 6 file(s) — `Dayflow/Dayflow/System/AnalyticsService.swift`, `Dayflow/Dayflow/Views/Components/DaySummaryView.swift` (line 942), `Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift` (line 897), `Dayflow/Dayflow/Views/UI/Agents/AgentPlaybackView.swift`, `Dayflow/Dayflow/Views/UI/SupportChatWebView.swift`, … (+1 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.
REDACTED
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 348 of the 408 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.
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, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Maturity · Maturity — Whether the 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.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Run what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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 20 use(s) across 124,775 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.
`executeStreaming` is async and calls .wait() — 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. — Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:592
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 · 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.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×13) — tools/dayflow-cli/Sources/dayflow/AgentUsageTelemetry.swift:201, Dayflow/Dayflow/Views/UI/Settings/StorageSettingsViewModel.swift:255, Dayflow/Dayflow/Views/UI/MainView/Support.swift:66, …
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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 — 22 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 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.
C4 Data Retention — Not assessed: this repository stores data through 'SQLite3' (tools/dayflow-cli/Sources/dayflow/Database.swift:11) but declares no persisted model this check reads (SwiftData @Model, Core Data, Realm, GRDB and Fluent types, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'SQLite3' (tools/dayflow-cli/Sources/dayflow/Database.swift:11) but declares no persisted model this check reads (SwiftData @Model, Core Data NSManagedObject, Realm Object, GRDB record and Fluent Model properties, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 73 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not included — no .swift test runner
D12 Dependency Hygiene — Not scored — 0 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
D21 Naming Consistency — Naming consistency is measured on C# only; Swift not measured.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 55 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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 included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
M4 Documentation accuracy — Not applicable: the 2 current-state document(s) make no claim of a kind M4 checks.
P12 CI test-gate honesty — no CI workflow found
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X13 Undrained process stream — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X15 Unvalidated length from an untrusted reader — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X19 Unrestored process-global state — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X23 Unguarded diagnostic materialisation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X25 Inert configuration knob — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X27 Collection changed while being enumerated — not 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
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Assertions commented out: testExample Dayflow/DayflowUITests/DayflowUITests.swift:23— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
D10 · Test Quality· Test project verifies nothing · ×1
Test project verifies nothing: DayflowUITests Dayflow/DayflowUITests/DayflowUITests.swift:23— No conventional assertion call was detected in 3 of 3 tests in `DayflowUITests` — the project as a whole, not one method. 1 of them has its assertions commented out, so this suite did verify conventionally and was switched off — it is not an approval/verifier harness.
MethodTooLong: LLMProviderSetupView.currentStepContent REDACTED:198— MethodTooLong — currentStepContent runs 365 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× 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: LLMService.processBatch Dayflow/Dayflow/Core/AI/LLMService.swift:650— MethodTooLong — processBatch runs 326 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 226 over it, 3.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: ChatCLIProcessRunner.executeStreaming Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:592— MethodTooLong — executeStreaming runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× 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: GeminiDirectProvider.geminiTranscribeRequest Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:259— MethodTooLong — geminiTranscribeRequest runs 229 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 129 over it, 2.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StorageManager.migrate Dayflow/Dayflow/Core/Recording/StorageManager.swift:458— MethodTooLong — migrate runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ChatCLIProcessRunner.run Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1362— MethodTooLong — run runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DailyView.regenerateStandupFromTimeline Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:264— MethodTooLong — regenerateStandupFromTimeline runs 193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× 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: ChatService.processConversation Dayflow/Dayflow/Core/AI/ChatService.swift:172— MethodTooLong — processConversation 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: DailyRecapScheduler.runCheck Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:71— MethodTooLong — runCheck 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: CodexProvider.transcribeScreenshots Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:12— MethodTooLong — transcribeScreenshots runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× 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: GeminiDirectProvider.transcribeVideoData Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:14— MethodTooLong — transcribeVideoData runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DayflowTheme.lightPalette Dayflow/Dayflow/Utilities/DayflowTheme.swift:235— MethodTooLong — lightPalette runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× 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: DayflowTheme.darkPalette Dayflow/Dayflow/Utilities/DayflowTheme.swift:450— MethodTooLong — darkPalette runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× 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: DailyWorkflowGrid.body Dayflow/Dayflow/Views/UI/DailyWorkflowGrid.swift:33— MethodTooLong — body 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: ScreenRecordingPermissionView.content Dayflow/Dayflow/Views/Onboarding/ScreenRecordingPermissionView.swift:95— MethodTooLong — content runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VideoPlayerModal.body Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:613— MethodTooLong — body runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WeeklySankeyModelFactory.build Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:263— MethodTooLong — build runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: DayflowBackendProvider.generateTimeline Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:560— MethodTooLong — generateTimeline runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: Coordinator.handle Dayflow/Dayflow/Views/UI/Flow/FlowWebView.swift:150— MethodTooLong — handle runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OnboardingFlow.body Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:44— MethodTooLong — body runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OllamaProvider.callChatAPI Dayflow/Dayflow/Core/AI/OllamaProvider+Networking.swift:70— MethodTooLong — callChatAPI 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: WeeklyInteractionGraphLayoutBuilder.layout Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:35— MethodTooLong — layout 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: ClaudeProvider.transcribeScreenshots Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:12— MethodTooLong — transcribeScreenshots runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DayflowBackendProvider.transcribeScreenshots Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:380— MethodTooLong — transcribeScreenshots 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: OnboardingCategoryPreset.categoryDefinitions Dayflow/Dayflow/Models/TimelineCategory.swift:318— MethodTooLong — categoryDefinitions runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: AI/ChatCLIProcessRunner.swift Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift— FileTooLong — 1162 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: ChatCLIProcessRunner (245-1616). The bar is 500 significant lines; this is 662 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: UI/WhatsNewView.swift Dayflow/Dayflow/Views/UI/WhatsNewView.swift— FileTooLong — 1076 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: WhatsNewView (177-1202). The bar is 500 significant lines; this is 576 over it, 2.15× 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: Flow/FlowDistractionAgent.swift Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift— FileTooLong — 1004 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 504 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: UI/SupportChatWebView.swift Dayflow/Dayflow/Views/UI/SupportChatWebView.swift— FileTooLong — 930 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 430 over it, 1.86× 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: AI/LLMService.swift Dayflow/Dayflow/Core/AI/LLMService.swift— FileTooLong — 849 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: LLMService (97-1220). The bar is 500 significant lines; this is 349 over it, 1.70× 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: System/DayflowAuthManager.swift Dayflow/Dayflow/System/DayflowAuthManager.swift— FileTooLong — 821 significant lines (blank, comment-only and punctuation-only lines excluded), about 63% of them inside a single declaration: DayflowAuthManager (260-1014). The bar is 500 significant lines; this is 321 over it, 1.64× 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/StorageManager+TimelineCards.swift Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift— FileTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 299 over it, 1.60× 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: Weekly/WeeklyView.swift Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift— FileTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 249 over it, 1.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Components/DayGoalHeader.swift Dayflow/Dayflow/Views/Components/DayGoalHeader.swift— FileTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 210 over it, 1.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: DailyBrief/DailyBriefGenerator.swift Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift— FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× 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/DaySummaryView.swift Dayflow/Dayflow/Views/Components/DaySummaryView.swift— FileTooLong — 674 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: DaySummaryView (28-940). The bar is 500 significant lines; this is 174 over it, 1.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: AI/DayflowBackendProvider.swift Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift— FileTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: DayflowBackendProvider (191-912). The bar is 500 significant lines; this is 165 over it, 1.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Settings/SettingsProvidersTabView.swift Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift— FileTooLong — 650 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: SettingsProvidersTabView (4-628). The bar is 500 significant lines; this is 150 over it, 1.30× 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: UI/CanvasTimelineDataView.swift Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift— FileTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: CanvasTimelineDataView (50-865). The bar is 500 significant lines; this is 146 over it, 1.29× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Components/TimelineCardColorPicker.swift Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift— FileTooLong — 629 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ColorOrganizerRoot (6-893). The bar is 500 significant lines; this is 129 over it, 1.26× 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 — 625 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: ProvidersSettingsViewModel (5-842). The bar is 500 significant lines; this is 125 over it, 1.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: DailyBrief/DailyBriefSections.swift Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift— FileTooLong — 614 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 114 over it, 1.23× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Analysis/AnalysisManager.swift Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift— FileTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AnalysisManager (29-978). The bar is 500 significant lines; this is 112 over it, 1.22× 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 — 612 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: LLMProviderSetupView (5-863). The bar is 500 significant lines; this is 112 over it, 1.22× 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: Sections/WeeklySankeyModelFactory.swift Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift— FileTooLong — 607 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: WeeklySankeyModelFactory (3-704). The bar is 500 significant lines; this is 107 over it, 1.21× 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: Sections/WeeklyInteractionGraphLayout.swift Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift— FileTooLong — 603 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: WeeklyInteractionGraphLayoutBuilder (3-794). The bar is 500 significant lines; this is 103 over it, 1.21× 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/ScreenRecorder.swift Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift— FileTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: ScreenRecorder (87-980). The bar is 500 significant lines; this is 101 over it, 1.20× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Onboarding/OnboardingFlow.swift Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift— FileTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 87 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: UI/VideoPlayerModal.swift Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift— FileTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 87 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Settings/SettingsAccountSection.swift Dayflow/Dayflow/Views/UI/Settings/SettingsAccountSection.swift— FileTooLong — 586 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 86 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
ClassTooLong: ChatCLIProcessRunner Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:245— ClassTooLong — 984 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 584 over it, 2.46× 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: LLMService Dayflow/Dayflow/Core/AI/LLMService.swift:97— ClassTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 382 over it, 1.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WhatsNewView Dayflow/Dayflow/Views/UI/WhatsNewView.swift:177— ClassTooLong — 730 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 330 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DaySummaryView Dayflow/Dayflow/Views/Components/DaySummaryView.swift:28— ClassTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), 26 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: ColorOrganizerRoot Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:6— ClassTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 221 over it, 1.55× 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: LLMProviderSetupView REDACTED:5— ClassTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 209 over it, 1.52× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ProvidersSettingsViewModel REDACTED:4— ClassTooLong — 607 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 207 over it, 1.52× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AnalysisManager Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:29— ClassTooLong — 596 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 196 over it, 1.49× 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: WeeklyInteractionGraphLayoutBuilder Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:3— ClassTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 180 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: StorageManager Dayflow/Dayflow/Core/Recording/StorageManager.swift:10— ClassTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded), 114 methods. The bar is 400 significant lines; this is 160 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ScreenRecorder Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:87— ClassTooLong — 559 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 159 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CanvasTimelineDataView Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:50— ClassTooLong — 551 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 151 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: WeeklySankeyModelFactory Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:3— ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 147 over it, 1.37× 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: WeekTimelineGridView Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridView.swift:61— ClassTooLong — 536 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 136 over it, 1.34× 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: DayflowBackendProvider Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:191— ClassTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 128 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DailyRecapGenerator Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:70— ClassTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 122 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DayflowAuthManager Dayflow/Dayflow/System/DayflowAuthManager.swift:259— ClassTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 115 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TimelineReviewOverlay Dayflow/Dayflow/Views/UI/TimelineReviewOverlay.swift:9— ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 104 over it, 1.26× 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: SupportChatPage Dayflow/Dayflow/Views/UI/SupportChatWebView.swift:655— ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 101 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: ActivityCard Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:7— ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 98 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: DayflowProOnboardingSignInPanel Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:48— ClassTooLong — 481 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 81 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ChatService Dayflow/Dayflow/Core/AI/ChatService.swift:13— ClassTooLong — 477 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 77 over it, 1.19× 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: SettingsProvidersTabView Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:4— ClassTooLong — 438 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 38 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.
ClassTooLong: DayGoalHeader Dayflow/Dayflow/Views/Components/DayGoalHeader.swift:22— ClassTooLong — 407 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 7 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FlowSessionTimeline Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:20— ClassTooLong — 403 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 3 over it, 1.01× 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) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:347— Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:347-354 | Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1298-1305 — 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 `Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.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.
Duplicated block (8 lines × 2) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:287— Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:287-294 | Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:353-360 — 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 `Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:287` 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) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:383— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:383-390 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:12-19 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:383` 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) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:240— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:240-247 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:340-347 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:240` 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) Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:25— Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:25-32 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:460-467 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Dayflow/Dayflow/Core/AI/LLMLogger.swift:57— Dayflow/Dayflow/Core/AI/LLMLogger.swift:57-64 | Dayflow/Dayflow/Core/AI/LLMLogger.swift:111-118 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/LLMLogger.swift:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Dayflow/Dayflow/Core/AgentAccess/AgentBridgeServer.swift:69— Dayflow/Dayflow/Core/AgentAccess/AgentBridgeServer.swift:69-76 | tools/dayflow-cli/Sources/dayflow/Bridge.swift:54-61 — 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 `Dayflow/Dayflow/Core/AgentAccess/AgentBridgeServer.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 (8 lines × 2) Dayflow/Dayflow/Core/AgentAccess/AgentUsageTelemetryQueue.swift:173— Dayflow/Dayflow/Core/AgentAccess/AgentUsageTelemetryQueue.swift:173-180 | tools/dayflow-cli/Sources/dayflow/AgentUsageTelemetry.swift:205-212 — 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. 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 (8 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:13— Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:13-21 | Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:28-35 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:217— Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:217-224 | Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:258-265 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:217` 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) Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:24— Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:24-31 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:494-501 — 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 (8 lines × 2) Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:165— Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:165-173 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:458-465 — before extracting anything, compare `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift` and `Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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 `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:165` 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) Dayflow/Dayflow/Utilities/TimelineClipboardFormatter.swift:78— Dayflow/Dayflow/Utilities/TimelineClipboardFormatter.swift:78-85 | Dayflow/Dayflow/Utilities/TimelineClipboardFormatter.swift:90-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Utilities/TimelineClipboardFormatter.swift:78` 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) Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:305— Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:305-312 | Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:316-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:305` 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) Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:470— Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:470-477 | Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:575-582 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.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 (8 lines × 2) Dayflow/Dayflow/Views/Onboarding/ScreenRecordingPermissionView.swift:192— Dayflow/Dayflow/Views/Onboarding/ScreenRecordingPermissionView.swift:192-199 | Dayflow/Dayflow/Views/Onboarding/ScreenRecordingPermissionView.swift:203-210 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Onboarding/ScreenRecordingPermissionView.swift:192` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) Dayflow/Dayflow/Views/UI/ChatHistoryPanel.swift:20— Dayflow/Dayflow/Views/UI/ChatHistoryPanel.swift:20-27 | Dayflow/Dayflow/Views/UI/ChatView+Content.swift:253-261 — 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 `Dayflow/Dayflow/Views/UI/ChatHistoryPanel.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 (8 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:203— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:203-210 | Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:15-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) REDACTED:831— REDACTED:831-838 | REDACTED:850-857 — both copies are in the same file, so extract the 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:831` 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextChartsSection.swift:108— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextChartsSection.swift:108-115 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextShiftComparisonSection.swift:78-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextChartsSection.swift:108` 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, `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextChartsSection.swift:116` calls `lineLimit`, `minimumScaleFactor` and `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextShiftComparisonSection.swift:86` 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:38— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:38-45 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:135-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:38` 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) Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:46— Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:46-53 | Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift:46-53 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 2) REDACTED:818— REDACTED:818-825 | REDACTED:299-306 — 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 (8 lines × 2) Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:621— Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:621-628 | Dayflow/Dayflow/Views/UI/MainView/WeekTimelineStatusCard.swift:73-80 — 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 (6 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:101— Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:101-106 | Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift:101-106 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:101` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:432— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:432-437 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:624-629 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:432` 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 `batchId` to `Int64?) async throws -> (observations: [Observation]` in one and `Int64? ) async throws -> (cards: [ActivityCardData]` 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 (6 lines × 2) Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:132— Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:132-137 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:144-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:128` calls `parseJSONResponse` and `Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:141` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:274— Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:274-279 | Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:339-344 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:274` 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) Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:217— Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:217-222 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:483-488 — before extracting anything, compare `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift` and `Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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 `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:217` 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) Dayflow/Dayflow/Utilities/DayflowTheme.swift:363— Dayflow/Dayflow/Utilities/DayflowTheme.swift:363-368 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:581-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:453— Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:453-458 | Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:550-555 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:453` 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 (6 lines × 2) Dayflow/Dayflow/Views/Components/TimelineReviewSummaryCard.swift:200— Dayflow/Dayflow/Views/Components/TimelineReviewSummaryCard.swift:200-205 | Dayflow/Dayflow/Views/Components/TimelineReviewSummaryCard.swift:228-233 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Components/TimelineReviewSummaryCard.swift:200` 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) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:125— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:125-130 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:919-924 — 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 `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:131` calls `contentShape`, `Circle` and `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:925` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:231— Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:231-236 | Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:348-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:231` 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) Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:171— Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:171-176 | Dayflow/Dayflow/Views/UI/MainView/Layout.swift:656-661 — 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 `Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyOverviewSection.swift:319— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyOverviewSection.swift:319-324 | Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:529-534 — 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:47— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:47-53 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:144-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:93— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:93-99 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:148-153 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.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.
Duplicated block (6 lines × 2) tools/dayflow-cli/Sources/dayflow/MCPServer.swift:372— tools/dayflow-cli/Sources/dayflow/MCPServer.swift:372-377 | tools/dayflow-cli/Sources/dayflow/MCPServer.swift:426-431 — both copies are in the same file, so extract the 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/dayflow-cli/Sources/dayflow/MCPServer.swift:372` 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 `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) tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:74— tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:74-79 | tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:82-87 — both copies are in the same file, so extract the 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/dayflow-cli/Sources/dayflow/WriteCommands.swift:74` 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) tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:80— tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:80-85 | tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:88-93 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:188— Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:188-193 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:474-479 — before extracting anything, compare `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift` and `Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:168— Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:168-173 | Dayflow/Dayflow/Views/Components/CategoryPickerView.swift:229-234 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Views/UI/CanvasActivityCard.swift:48— Dayflow/Dayflow/Views/UI/CanvasActivityCard.swift:48-53 | Dayflow/Dayflow/Views/UI/MainView/WeekTimelineActivityCard.swift:56-61 — 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 (6 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:300— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:300-305 | Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:48-53 — 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) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:170— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:170-175 | Dayflow/Dayflow/Views/UI/TimelineReviewPlaybackModels.swift:423-428 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Dayflow/Dayflow/Views/UI/ChatView+State.swift:50— Dayflow/Dayflow/Views/UI/ChatView+State.swift:50-55 | Dayflow/Dayflow/Views/UI/MainView/Support.swift:140-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:717— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:717-721 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:866-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:717` 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) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:357— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:357-361 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:263-268 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:357` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:137— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:137-141 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:257-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Dayflow/Dayflow/Core/Flow/FlowNativeState.swift:92— Dayflow/Dayflow/Core/Flow/FlowNativeState.swift:92-96 | Dayflow/Dayflow/System/TimelineFailureToast.swift:41-54 — 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 `Dayflow/Dayflow/Core/Flow/FlowNativeState.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 (5 lines × 2) Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:395— Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:395-400 | Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:485-489 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Utilities/DayflowTheme.swift:283— Dayflow/Dayflow/Utilities/DayflowTheme.swift:283-287 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:504-508 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Utilities/DayflowTheme.swift:376— Dayflow/Dayflow/Utilities/DayflowTheme.swift:376-380 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:594-598 — both copies are in the same file, so extract the 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, `Dayflow/Dayflow/Utilities/DayflowTheme.swift:599` calls `Color`, `opacity` and `Dayflow/Dayflow/Utilities/DayflowTheme.swift:381` 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 × 2) Dayflow/Dayflow/Views/Components/CategorySetupCards.swift:98— Dayflow/Dayflow/Views/Components/CategorySetupCards.swift:98-104 | Dayflow/Dayflow/Views/Components/CategorySetupCards.swift:162-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 `Dayflow/Dayflow/Views/Components/CategorySetupCards.swift:98` 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) Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:283— Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:283-289 | Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:599-603 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:45— Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:45-50 | Dayflow/Dayflow/Views/UI/TimelineReviewOverlay.swift:278-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `4` in one and `12` 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) Dayflow/Dayflow/Views/UI/Agents/AgentThreadCardView.swift:156— Dayflow/Dayflow/Views/UI/Agents/AgentThreadCardView.swift:156-160 | Dayflow/Dayflow/Views/UI/Agents/AgentThreadCardView.swift:340-344 — both copies are in the same file, so extract the 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, `Dayflow/Dayflow/Views/UI/Agents/AgentThreadCardView.swift:162` calls `AgentStatusChipView` and `Dayflow/Dayflow/Views/UI/Agents/AgentThreadCardView.swift:345` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) Dayflow/Dayflow/Views/UI/MainView/TimelineCalendarPopover.swift:292— Dayflow/Dayflow/Views/UI/MainView/TimelineCalendarPopover.swift:292-296 | Dayflow/Dayflow/Views/UI/MainView/TimelineCalendarPopover.swift:309-313 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/MainView/TimelineCalendarPopover.swift:292` 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) Dayflow/Dayflow/Views/UI/TimelineReviewPlaybackModels.swift:189— Dayflow/Dayflow/Views/UI/TimelineReviewPlaybackModels.swift:189-193 | Dayflow/Dayflow/Views/UI/TimelineReviewPlaybackModels.swift:487-491 — both copies are in the same file, so extract the 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 (5 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:454— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:454-458 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift:11-21 — 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 `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:454` 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 (5 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:118— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:118-122 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:160-164 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:118` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:165` calls `Set`, `appTemplates`, `contains` and `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:124` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) tools/dayflow-cli/Sources/dayflow/main.swift:136— tools/dayflow-cli/Sources/dayflow/main.swift:136-140 | tools/dayflow-cli/Sources/dayflow/main.swift:345-349 — both copies are in the same file, so extract the 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/dayflow-cli/Sources/dayflow/main.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 (5 lines × 2) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:272— Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:272-276 | Dayflow/Dayflow/Core/AgentAccess/CodexMCPRegistration.swift:232-236 — 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) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:307— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:307-311 | Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:55-59 — 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) Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:6— Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:6-10 | Dayflow/Dayflow/Core/Recording/StorageManager+Screenshots.swift:9-13 — 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) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:323— Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:323-327 | Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:145-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:323` 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) Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:211— Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:211-220 | Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:232-241 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:12— Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:12-21 | Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:12-21 — 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:12` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:112— Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:112-121 | Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:193-202 — 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 `Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:112` 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) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:125— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:125-134 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:228-237 — 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:159— Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:159-168 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:453-462 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:182— Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:182-191 | Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:280-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) Dayflow/Dayflow/Core/Recording/StorageManager+Observations.swift:38— Dayflow/Dayflow/Core/Recording/StorageManager+Observations.swift:38-47 | Dayflow/Dayflow/Core/Recording/StorageManager+Observations.swift:67-76 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+Observations.swift:38` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Utilities/DayflowTheme.swift:411— Dayflow/Dayflow/Utilities/DayflowTheme.swift:411-420 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:630-639 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Utilities/DayflowTheme.swift:411` 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) Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:81— Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:81-90 | Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:140-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Views/Onboarding/APIKeyInputView.swift:27— Dayflow/Dayflow/Views/Onboarding/APIKeyInputView.swift:27-36 | Dayflow/Dayflow/Views/Onboarding/TerminalCommandView.swift:17-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/APIKeyInputView.swift:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) REDACTED:641— REDACTED:641-650 | REDACTED:652-661 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:513— Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:513-522 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:542-551 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:513` 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) Dayflow/Dayflow/Views/UI/BugReportView.swift:37— Dayflow/Dayflow/Views/UI/BugReportView.swift:37-46 | Dayflow/Dayflow/Views/UI/ChatView+Content.swift:545-554 — 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) Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:159— Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:159-168 | Dayflow/Dayflow/Views/UI/SurveyPromptCard.swift:244-253 — 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 `Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:159` 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) Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:154— Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:154-163 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:651-660 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `0` 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.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Views/UI/WhatsNewView.swift:591— Dayflow/Dayflow/Views/UI/WhatsNewView.swift:591-600 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:769-778 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:591` 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, `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:768` calls `frame` and `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:590` 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyFocusHeatmapSection.swift:161— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyFocusHeatmapSection.swift:161-170 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyWorkflowSection.swift:122-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:168— Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:168-177 | Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:469-478 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:17— Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:17-29 | Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:17-29 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:399— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:399-411 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:581-596 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:399` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:177— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:177-189 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:209-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:254— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:254-266 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:67-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. 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 (13 lines × 2) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:541— Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:541-553 | Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:565-577 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:541` 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, `Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:539` calls `arraySchema` and `Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:564` 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) Dayflow/Dayflow/Core/Flow/FlowEarlyBirdController.swift:110— Dayflow/Dayflow/Core/Flow/FlowEarlyBirdController.swift:110-122 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefMenuBarNotice.swift:85-97 — 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) Dayflow/Dayflow/Core/Recording/StorageManager.swift:699— Dayflow/Dayflow/Core/Recording/StorageManager.swift:699-711 | Dayflow/Dayflow/Core/Recording/StorageManager.swift:715-727 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager.swift:699` 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) REDACTED:280— REDACTED:280-292 | REDACTED:669-681 — both copies are in the same file, so extract the 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:280` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:825— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:825-837 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:247-259 — 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) Dayflow/Dayflow/Views/UI/Agents/AgentsBriefingView.swift:73— Dayflow/Dayflow/Views/UI/Agents/AgentsBriefingView.swift:73-85 | Dayflow/Dayflow/Views/UI/Agents/AgentsCardsView.swift:100-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:453— Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:453-465 | Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:469-481 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:453` 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) Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:219— Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:219-231 | Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:403-415 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:219` 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) Dayflow/Dayflow/Views/UI/Flow/FlowSupportChatView.swift:67— Dayflow/Dayflow/Views/UI/Flow/FlowSupportChatView.swift:67-79 | Dayflow/Dayflow/Views/UI/Flow/FlowWaitlistChatView.swift:37-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Flow/FlowSupportChatView.swift:67` 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, `Dayflow/Dayflow/Views/UI/Flow/FlowSupportChatView.swift:81` calls `frame` and `Dayflow/Dayflow/Views/UI/Flow/FlowWaitlistChatView.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 (13 lines × 2) Dayflow/Dayflow/Views/UI/Settings/SettingsStorageTabView.swift:153— Dayflow/Dayflow/Views/UI/Settings/SettingsStorageTabView.swift:153-165 | Dayflow/Dayflow/Views/UI/Settings/SettingsStorageTabView.swift:252-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Settings/SettingsStorageTabView.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 (13 lines × 2) Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:206— Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:206-218 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:634-646 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:206` 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:71— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:71-83 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:621-633 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.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 (13 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/WeeklyAccessLockedView.swift:61— Dayflow/Dayflow/Views/UI/Weekly/WeeklyAccessLockedView.swift:61-73 | Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:558-570 — 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 `Dayflow/Dayflow/Views/UI/Weekly/WeeklyAccessLockedView.swift:61` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Dayflow/Dayflow/Views/UI/Weekly/WeeklyAccessLockedView.swift:75` calls `estimatedUnlockDate`, `addingTimeInterval`, `TimeInterval` and `Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:571` 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) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:144— Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:144-152 | Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:180-188 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:144` 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) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:805— Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:805-813 | Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:428-436 — 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) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:815— Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:815-823 | Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:438-446 — 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) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:445— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:445-453 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:372-380 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) Dayflow/Dayflow/Core/AI/GeminiModelPreference.swift:15— Dayflow/Dayflow/Core/AI/GeminiModelPreference.swift:15-23 | Dayflow/Dayflow/Core/AI/GeminiModelPreference.swift:25-33 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:210— Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:210-218 | Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:230-238 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:144— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:144-152 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:1062-1070 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:512— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:512-520 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:575-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:512` 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) Dayflow/Dayflow/Core/Recording/StorageManager.swift:356— Dayflow/Dayflow/Core/Recording/StorageManager.swift:356-364 | Dayflow/Dayflow/Core/Recording/StorageManager.swift:448-456 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager.swift:356` 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) Dayflow/Dayflow/Utilities/DayflowTheme.swift:317— Dayflow/Dayflow/Utilities/DayflowTheme.swift:317-325 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:538-546 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Utilities/DayflowTheme.swift:317` 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) Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:266— Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:266-274 | Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:293-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 `Dayflow/Dayflow/Views/Components/ColorWheelPicker.swift:266` 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) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:139— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:139-147 | Dayflow/Dayflow/Views/UI/TimelineReviewPlaybackModels.swift:389-397 — 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 `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:139` 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 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift:159— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift:159-167 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift:169-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift:159` 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, `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift:168` calls `RoundedRectangle`, `fill`, `Color` and `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphGlyphs.swift:178` 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) Dayflow/Dayflow/Views/UI/WhatsNewView.swift:506— Dayflow/Dayflow/Views/UI/WhatsNewView.swift:506-514 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:674-682 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:506` 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 `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 (9 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyFocusHeatmapSection.swift:228— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyFocusHeatmapSection.swift:228-236 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyWorkflowSection.swift:258-266 — 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) Dayflow/Dayflow/Core/AI/GeminiPromptPreferences.swift:21— Dayflow/Dayflow/Core/AI/GeminiPromptPreferences.swift:21-29 | Dayflow/Dayflow/Core/AI/OllamaPromptPreferences.swift:19-27 — 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: Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:592— Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in ChatCLIProcessRunner.executeStreaming at line 592. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.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: Dayflow/Dayflow/Views/UI/Flow/FlowWebView.swift Dayflow/Dayflow/Views/UI/Flow/FlowWebView.swift:150— Dayflow/Dayflow/Views/UI/Flow/FlowWebView.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in Coordinator.handle at line 150. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Views/UI/Flow/FlowWebView.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: Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:586— Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in FlowDistractionAgent.tick at line 586. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.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: Dayflow/Dayflow/Core/AI/LLMService.swift Dayflow/Dayflow/Core/AI/LLMService.swift:650— Dayflow/Dayflow/Core/AI/LLMService.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in LLMService.processBatch at line 650. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/AI/LLMService.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: Dayflow/Dayflow/App/AppDelegate.swift Dayflow/Dayflow/App/AppDelegate.swift:65— Dayflow/Dayflow/App/AppDelegate.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in AppDelegate.applicationDidFinishLaunching at line 65. 1 of those changes was a fix/bug commit, 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/App/AppDelegate.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Dayflow/Dayflow/App/DayflowApp.swift Dayflow/Dayflow/App/DayflowApp.swift:293— Dayflow/Dayflow/App/DayflowApp.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in DayflowApp.body at line 293. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/App/DayflowApp.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: Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:44— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in OnboardingFlow.body at line 44. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.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: Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:173— Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ActivityCard.activityDetails at line 173. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Views/UI/MainView/ActivityCard.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: Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:12— Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in CodexProvider.transcribeScreenshots at line 12. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.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: REDACTED REDACTED:198— REDACTED changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in LLMProviderSetupView.currentStepContent at line 198. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- REDACTED`: 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: Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:31— Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in FlowOverlayView.body at line 31. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.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: Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:163— Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in FlowSessionTimeline.apply at line 163. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.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: Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:7— Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in CodexProvider.generateActivityCards at line 7. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.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: Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:6— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in GeminiDirectProvider.generateText at line 6. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.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: Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:272— Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ScreenRecorder.setupCapture at line 272. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 01:56:04 -07:00' --until='2026-10-22 01:56:04 -07:00' --full-history --no-merges -- Dayflow/Dayflow/Core/Recording/ScreenRecorder.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 (12 lines × 2) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:792— Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:792-803 | Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:415-426 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:37— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:37-48 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:84-95 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift` and `Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:37` 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 (12 lines × 2) Dayflow/Dayflow/Core/AI/OllamaProvider+Networking.swift:131— Dayflow/Dayflow/Core/AI/OllamaProvider+Networking.swift:131-142 | Dayflow/Dayflow/Core/AI/OllamaProvider+Networking.swift:175-186 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/OllamaProvider+Networking.swift:131` 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) Dayflow/Dayflow/Core/Flow/FlowEarlyBirdController.swift:144— Dayflow/Dayflow/Core/Flow/FlowEarlyBirdController.swift:144-155 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefMenuBarNotice.swift:103-114 — 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 (12 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:115— Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:115-126 | Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:195-206 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Core/Recording/StorageModels.swift:99— Dayflow/Dayflow/Core/Recording/StorageModels.swift:99-110 | Dayflow/Dayflow/Core/Recording/StorageModels.swift:215-226 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageModels.swift:99` 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) Dayflow/Dayflow/System/DayflowAuthManager.swift:599— Dayflow/Dayflow/System/DayflowAuthManager.swift:599-610 | Dayflow/Dayflow/System/DayflowAuthManager.swift:704-715 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/System/DayflowAuthManager.swift:599` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/System/DayflowAuthManager.swift:703` calls `clearPendingReferralCode` and `Dayflow/Dayflow/System/DayflowAuthManager.swift:598` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) Dayflow/Dayflow/Views/Components/ToolCallBubble.swift:164— Dayflow/Dayflow/Views/Components/ToolCallBubble.swift:164-175 | Dayflow/Dayflow/Views/Components/ToolCallBubble.swift:177-188 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:212— Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:212-223 | Dayflow/Dayflow/Views/UI/Agents/AgentsView.swift:167-178 — 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 `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:212` 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 `10` in one and `14` 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) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:598— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:598-609 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:684-695 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:598` 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) Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:174— Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:174-185 | Dayflow/Dayflow/Views/UI/SurveyPromptCard.swift:262-273 — 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 `Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:174` 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) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:305— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:305-316 | Dayflow/Dayflow/Views/UI/TimelineReviewFrameLoading.swift:147-158 — 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) Dayflow/Dayflow/Views/UI/Settings/SettingsDataTabView.swift:337— Dayflow/Dayflow/Views/UI/Settings/SettingsDataTabView.swift:337-348 | Dayflow/Dayflow/Views/UI/Settings/SettingsDataTabView.swift:352-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 `Dayflow/Dayflow/Views/UI/Settings/SettingsDataTabView.swift:337` 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) Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:83— Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:83-94 | Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:261-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) Dayflow/Dayflow/Core/AI/ChatService.swift:673— Dayflow/Dayflow/Core/AI/ChatService.swift:673-683 | Dayflow/Dayflow/Core/AI/ChatService.swift:688-698 — both copies are in the same file, so extract the 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 (11 lines × 2) Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:59— Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:59-69 | Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:181-191 — 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 `Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.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. 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) Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:210— Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:210-220 | Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:384-394 — 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 `Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:210` 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) Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:194— Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:194-204 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:131-141 — 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 (11 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineReview.swift:230— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineReview.swift:230-240 | Dayflow/Dayflow/Views/UI/TimelineReviewOverlay.swift:658-668 — 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineReview.swift:230` 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) Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:406— Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:406-416 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyWorkflowSection.swift:299-309 — 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 (11 lines × 2) Dayflow/Dayflow/Views/Components/DayFocusSummarySection.swift:68— Dayflow/Dayflow/Views/Components/DayFocusSummarySection.swift:68-78 | Dayflow/Dayflow/Views/Components/DayFocusSummarySection.swift:97-107 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:249— Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:249-259 | Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:315-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:249` 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) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:782— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:782-792 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:82-92 — before extracting anything, compare `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift` and `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:782` 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) Dayflow/Dayflow/Views/UI/ChatView+Content.swift:31— Dayflow/Dayflow/Views/UI/ChatView+Content.swift:31-41 | Dayflow/Dayflow/Views/UI/ChatWelcomeComponents.swift:84-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/ChatView+Content.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 after the matched lines, `Dayflow/Dayflow/Views/UI/ChatWelcomeComponents.swift:95` calls `scaleEffect` and `Dayflow/Dayflow/Views/UI/ChatView+Content.swift:42` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:205— Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:205-215 | Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:370-380 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:205` 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) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefCompletedView.swift:171— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefCompletedView.swift:171-181 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSavedView.swift:63-73 — 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 `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefCompletedView.swift:171` 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, `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSavedView.swift:60` calls `Image`, `font`, `system` and `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefCompletedView.swift:170` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:49— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:49-59 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:627-637 — 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 `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.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.
Duplicated block (11 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:728— Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:728-738 | Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:831-841 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:728` 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, `Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:727` calls `escaping` and `Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:830` 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) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:11— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:11-17 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:57-63 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift` and `Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:11` 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) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:75— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:75-81 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:92-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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Dayflow/Dayflow/Utilities/DayflowTheme.swift:243— Dayflow/Dayflow/Utilities/DayflowTheme.swift:243-249 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:253-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Utilities/DayflowTheme.swift:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Dayflow/Dayflow/Views/Components/DaySummaryView.swift:265— Dayflow/Dayflow/Views/Components/DaySummaryView.swift:265-271 | Dayflow/Dayflow/Views/Components/DaySummaryView.swift:914-920 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Components/DaySummaryView.swift:265` 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) Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:160— Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:160-166 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:227-233 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:160` 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 `scaled(4)` in one and `scaled(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 (7 lines × 2) Dayflow/Dayflow/Views/UI/Agents/AgentsModels.swift:262— Dayflow/Dayflow/Views/UI/Agents/AgentsModels.swift:262-268 | Dayflow/Dayflow/Views/UI/Agents/AgentsModels.swift:271-277 — both copies are in the same file, so extract the 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) Dayflow/Dayflow/Views/UI/ChatView+Content.swift:476— Dayflow/Dayflow/Views/UI/ChatView+Content.swift:476-482 | Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:239-245 — 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 `Dayflow/Dayflow/Views/UI/ChatView+Content.swift:476` 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) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:187— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:187-193 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:210-216 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:72— Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:72-78 | Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:126-132 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:372— Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:372-378 | Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:393-399 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:372` 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:231— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:231-237 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:410-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:231` 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 (7 lines × 2) Dayflow/Dayflow/Core/AI/ActivityCardPromptOverrides.swift:8— Dayflow/Dayflow/Core/AI/ActivityCardPromptOverrides.swift:8-14 | Dayflow/Dayflow/Core/AI/GeminiPromptPreferences.swift:8-14 — 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 (7 lines × 2) Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:207— Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:207-213 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:420-426 — before extracting anything, compare `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift` and `Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:242— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:242-248 | Dayflow/Dayflow/Views/UI/TimelineReviewMediaViews.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.
Swallowed exception (caught, then discarded) tools/dayflow-cli/Sources/dayflow/AgentUsageTelemetry.swift:201— `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) Dayflow/Dayflow/Views/UI/Settings/StorageSettingsViewModel.swift:255— `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) Dayflow/Dayflow/Views/UI/MainView/Support.swift:66— `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) Dayflow/Dayflow/Views/UI/Agents/AgentPlaybackView.swift:340— `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) Dayflow/Dayflow/Views/UI/Agents/AgentThreadOpener.swift:292— `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) Dayflow/Dayflow/System/DayflowAuthManager.swift:557— `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) Dayflow/Dayflow/Core/Recording/StorageFileManagerExtensions.swift:24— `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) Dayflow/Dayflow/Core/Net/FaviconService.swift:315— `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) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:429— `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) Dayflow/Dayflow/Core/AgentAccess/AgentClientRegistration.swift:249— `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) Dayflow/Dayflow/Core/AgentAccess/AgentUsageTelemetryQueue.swift:160— `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) Dayflow/Dayflow/Core/AgentAccess/CodexMCPRegistration.swift:253— `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) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:289— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
TooManyMethods: StorageManager Dayflow/Dayflow/Core/Recording/StorageManager.swift:10— TooManyMethods — 114 methods, declared across 13 files: Recording/StorageManager+TimelineCards.swift (28), Recording/StorageManager+Maintenance.swift (17), Recording/StorageManager+Chunks.swift (13), Recording/StorageManager+Screenshots.swift (11), +9 more file(s). The bar is 30 methods; this is 84 over it, 3.80× 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: GeminiDirectProvider Dayflow/Dayflow/Core/AI/GeminiDirectProvider.swift:8— TooManyMethods — 70 methods, declared across 11 files: AI/GeminiDirectProvider+DashboardTools.swift (15), AI/GeminiDirectProvider+DashboardStreaming.swift (12), AI/GeminiDirectProvider+DashboardChat.swift (9), AI/GeminiDirectProvider+ActivityCards.swift (8), +7 more file(s). The bar is 30 methods; this is 40 over it, 2.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MainView Dayflow/Dayflow/Views/UI/MainView/MainView.swift:15— TooManyMethods — 59 methods, declared across 7 files: MainView/Layout.swift (17), MainView/Support.swift (11), MainView/Actions.swift (10), MainView/Lifecycle.swift (7), +3 more file(s). The bar is 30 methods; this is 29 over it, 1.97× 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: DailyView Dayflow/Dayflow/Views/UI/DailyView.swift:6— TooManyMethods — 56 methods, declared across 5 files: UI/DailyView+Standup.swift (20), UI/DailyView+Workflow.swift (19), UI/DailyView+Access.swift (12), UI/DailyView+Provider.swift (4), +1 more file(s). The bar is 30 methods; this is 26 over it, 1.87× 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: ProvidersSettingsViewModel REDACTED:4— TooManyMethods — 51 methods, declared across 2 files: REDACTED (38), Settings/ProvidersSettingsViewModel+PromptOverrides.swift (13). The bar is 30 methods; this is 21 over it, 1.70× 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: DailyBriefStore Dayflow/Dayflow/Core/DailyBrief/DailyBriefStore.swift:19— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClaudeProvider Dayflow/Dayflow/Core/AI/ClaudeProvider.swift:3— TooManyMethods — 40 methods, declared across 7 files: AI/ClaudeStrictJSONParser.swift (10), AI/ClaudeProvider.swift (7), AI/ClaudeProvider+ActivityCards.swift (5), AI/ClaudeProvider+Timeline.swift (5), +3 more file(s). The bar is 30 methods; this is 10 over it, 1.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DayflowAuthManager Dayflow/Dayflow/System/DayflowAuthManager.swift:259— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChatCLIProcessRunner Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:245— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: FlowDistractionAgent Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:27— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: DailyRecapGenerator Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:70— 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.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:62— Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:62-75 | Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:84-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Core/AI/ChatService.swift:500— Dayflow/Dayflow/Core/AI/ChatService.swift:500-513 | Dayflow/Dayflow/Core/AI/ChatService.swift:518-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/ChatService.swift:500` 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 (14 lines × 2) Dayflow/Dayflow/Core/AI/ClaudePromptDefaults.swift:30— Dayflow/Dayflow/Core/AI/ClaudePromptDefaults.swift:30-43 | Dayflow/Dayflow/Core/AI/CodexPromptPreferences.swift:38-51 — 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 `Dayflow/Dayflow/Core/AI/ClaudePromptDefaults.swift:30` 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) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:322— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:322-335 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:851-864 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:322` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:238— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:238-251 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:217-230 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:238` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Core/AI/LLMLogger.swift:39— Dayflow/Dayflow/Core/AI/LLMLogger.swift:39-52 | Dayflow/Dayflow/Core/AI/LLMLogger.swift:79-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/LLMLogger.swift:39` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Core/AI/LLMService.swift:997— Dayflow/Dayflow/Core/AI/LLMService.swift:997-1010 | Dayflow/Dayflow/Core/AI/LLMService.swift:1108-1121 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/LLMService.swift:997` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Views/Components/DayGoalHeader.swift:300— Dayflow/Dayflow/Views/Components/DayGoalHeader.swift:300-313 | Dayflow/Dayflow/Views/Components/DayGoalHeader.swift:318-331 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Components/DayGoalHeader.swift:300` 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, `Dayflow/Dayflow/Views/Components/DayGoalHeader.swift:332` calls `scaleEffect` and `Dayflow/Dayflow/Views/Components/DayGoalHeader.swift:314` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:149— Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:149-162 | Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:41-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:295— Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:295-308 | Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:335-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:295` 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:191— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:191-204 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:238-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×10
Members sharing a duplicated core (4 members, 50+ identical tokens) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:32— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:32-48 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:233-251 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:212-230 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:79-95 — 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) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:620— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:620-627 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:268-275 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:259-266 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:32-39 — 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) Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:490— Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:490-499 | Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:165-176 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:458-467 | Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:405-410 — 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) Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:256— Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:256-282 | Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift:111-137 | Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:359-382 | Dayflow/Dayflow/Views/UI/ChatStylesAndDebug.swift:132-154 — 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) Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:284— Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:284-306 | Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift:139-161 | Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:384-406 | Dayflow/Dayflow/Views/UI/ChatStylesAndDebug.swift:156-173 — 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) Dayflow/Dayflow/Views/Components/ReferralSurveyView.swift:180— Dayflow/Dayflow/Views/Components/ReferralSurveyView.swift:180-202 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:756-792 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:74-158 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:27-129 — 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) Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeChooseProviderStep.swift:317— Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeChooseProviderStep.swift:317-325 | Dayflow/Dayflow/Views/UI/Agents/AgentsBriefingView.swift:72-86 | Dayflow/Dayflow/Views/UI/Agents/AgentsCardsView.swift:85-119 | Dayflow/Dayflow/Views/UI/Agents/AgentsCardsView.swift:121-137 — 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) Dayflow/Dayflow/Views/UI/Agents/AgentsOverviewView.swift:291— Dayflow/Dayflow/Views/UI/Agents/AgentsOverviewView.swift:291-311 | Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:640-715 | Dayflow/Dayflow/Views/UI/SettingsView.swift:199-221 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:933-988 — 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) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:162— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:162-219 | Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:13-25 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:220-275 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:613-839 — 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) Dayflow/Dayflow/Views/UI/WhatsNewView.swift:375— Dayflow/Dayflow/Views/UI/WhatsNewView.swift:375-463 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:504-600 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:673-707 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:712-779 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (15 lines × 2) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:417— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:417-431 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:607-621 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:417` 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) Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:9— Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:9-23 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:479-493 — 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 (15 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:526— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:526-540 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:589-603 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:526` 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 (15 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:833— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:833-847 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:891-905 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:833` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Dayflow/Dayflow/Views/Onboarding/LLMProviderSetupCLI.swift:30— Dayflow/Dayflow/Views/Onboarding/LLMProviderSetupCLI.swift:30-44 | Dayflow/Dayflow/Views/Onboarding/LLMProviderSetupCLI.swift:88-102 — both copies are in the same file, so extract the 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 (15 lines × 2) Dayflow/Dayflow/Views/UI/ChatCharts.swift:30— Dayflow/Dayflow/Views/UI/ChatCharts.swift:30-44 | Dayflow/Dayflow/Views/UI/ChatCharts.swift:47-61 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:312— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:312-326 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:603-617 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:312` 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) Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:222— Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:222-236 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:661-675 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:222` 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.
Low cohesion: StorageManager (LCOM4 18) Dayflow/Dayflow/Core/Recording/StorageManager.swift:10— StorageManager's methods fall into 18 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 18 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: AnalyticsService (LCOM4 8) Dayflow/Dayflow/System/AnalyticsService.swift:214— AnalyticsService's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StatusBarController (LCOM4 6) Dayflow/Dayflow/System/StatusBarController.swift:5— StatusBarController'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: ClaudeProvider (LCOM4 5) Dayflow/Dayflow/Core/AI/ClaudeProvider.swift:3— ClaudeProvider'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: AppState (LCOM4 4) Dayflow/Dayflow/App/AppState.swift:11— AppState'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: NonInteractiveAVPlayerView (LCOM4 4) Dayflow/Dayflow/Views/Onboarding/VideoLaunchView.swift:187— NonInteractiveAVPlayerView'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: Coordinator (LCOM4 4) Dayflow/Dayflow/Views/UI/Flow/FlowWebView.swift:114— Coordinator'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: OtherSettingsViewModel (LCOM4 4) Dayflow/Dayflow/Views/UI/Settings/OtherSettingsViewModel.swift:6— OtherSettingsViewModel'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 (5 lines × 3) Dayflow/Dayflow/Utilities/DayflowTheme.swift:243— Dayflow/Dayflow/Utilities/DayflowTheme.swift:243-247 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:253-257 | Dayflow/Dayflow/Views/Onboarding/OnboardingBackdrop.swift:18-22 — 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 `Dayflow/Dayflow/Utilities/DayflowTheme.swift:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeChooseProviderStep.swift:321— Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeChooseProviderStep.swift:321-325 | Dayflow/Dayflow/Views/UI/Agents/AgentsBriefingView.swift:77-81 | Dayflow/Dayflow/Views/UI/Agents/AgentsCardsView.swift:104-108 — 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 `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeChooseProviderStep.swift:321` 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) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:57— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:57-61 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:617-621 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:633-637 — 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 `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:68— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:68-72 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:85-89 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:646-650 — 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 `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:68` 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 × 3) tools/dayflow-cli/Sources/dayflow/MCPServer.swift:381— tools/dayflow-cli/Sources/dayflow/MCPServer.swift:381-385 | tools/dayflow-cli/Sources/dayflow/MCPServer.swift:437-441 | tools/dayflow-cli/Sources/dayflow/main.swift:288-292 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 3) Dayflow/Dayflow/Core/AgentAccess/AgentBridgeServer.swift:32— Dayflow/Dayflow/Core/AgentAccess/AgentBridgeServer.swift:32-36 | Dayflow/Dayflow/Core/AgentAccess/AgentBridgeServer.swift:38-42 | tools/dayflow-cli/Sources/dayflow/Bridge.swift:20-24 — 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. 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–12 lines × 2) Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:98— Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:98-108 | Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:202-213 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.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 (11–12 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:138— Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:138-149 | Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:151-161 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:151` 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–12 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:568— Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:568-578 | Dayflow/Dayflow/Views/UI/VideoThumbnailView.swift:93-104 — 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 `Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:568` 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–12 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:264— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshowPlayback.swift:264-274 | Dayflow/Dayflow/Views/UI/TimelineReviewFrameLoading.swift:92-103 — 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 `Dayflow/Dayflow/Views/UI/TimelineReviewFrameLoading.swift:92` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:103— tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:103-114 | tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:135-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. Read the line range as the matched WINDOW rather than a finished unit: at `tools/dayflow-cli/Sources/dayflow/WriteCommands.swift:103` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:420— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:420-430 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:610-620 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:778-788 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:420` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:310— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:310-320 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:196-206 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:279-289 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:192` calls `max` and `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:308` 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) Dayflow/Dayflow/Core/Flow/FlowEarlyBirdController.swift:146— Dayflow/Dayflow/Core/Flow/FlowEarlyBirdController.swift:146-156 | Dayflow/Dayflow/Core/Flow/FlowOverlayController.swift:113-123 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefMenuBarNotice.swift:105-115 — 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 `Dayflow/Dayflow/Core/Flow/FlowEarlyBirdController.swift:146` 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 (11 lines × 3) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:864— Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:864-874 | Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:905-915 | Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:946-956 — 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 `Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:864` 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 (11 lines × 3) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:807— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:807-817 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:212-222 | Dayflow/Dayflow/Views/UI/Agents/AgentsView.swift:167-177 — 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 `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:807` 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 (10 lines × 3) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:383— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:383-392 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:563-572 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:757-766 — 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) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:609— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:609-618 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:682-691 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:27-36 — before extracting anything, compare `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift` and `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:609` 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, `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:619` calls `lineSpacing` and `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:692` 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 × 3) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:660— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:660-669 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:315-324 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefSections.swift:606-615 — 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 `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:660` 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 × 3) Dayflow/Dayflow/Views/UI/Settings/SettingsReferralProgramCard.swift:267— Dayflow/Dayflow/Views/UI/Settings/SettingsReferralProgramCard.swift:267-276 | Dayflow/Dayflow/Views/UI/Settings/SettingsReferralProgramCard.swift:299-308 | Dayflow/Dayflow/Views/UI/Settings/SettingsReferralProgramCard.swift:338-347 — 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 `Dayflow/Dayflow/Views/UI/Settings/SettingsReferralProgramCard.swift:267` 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, `Dayflow/Dayflow/Views/UI/Settings/SettingsReferralProgramCard.swift:277` calls `textSelection` and `Dayflow/Dayflow/Views/UI/Settings/SettingsReferralProgramCard.swift:309` 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 × 3) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:514— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:514-523 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphModels.swift:8-17 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphModels.swift:19-28 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphModels.swift:31` calls `Color` and `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyApplicationInteractionsSection.swift:524` 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 × 3) Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:60— Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:60-66 | Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:216-222 | Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:257-263 — 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 `Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:399— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:399-405 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:512-520 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:575-583 — 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:399` 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 × 3) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:419— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:419-425 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:536-542 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:599-605 — 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 (7 lines × 3) Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:490— Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:490-497 | Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:166-173 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:459-465 — before extracting anything, compare `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift` and `Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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 `Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:490` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) REDACTED:279— REDACTED:279-285 | REDACTED:668-674 | Dayflow/Dayflow/Views/UI/MainView/Layout.swift:770-778 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `16` in one and `12` 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 (19 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:186— Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:186-204 | Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:72-90 — 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:199— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:199-217 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:219-237 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) Dayflow/Dayflow/Core/Thumbnails/ScreenshotThumbnailCache.swift:35— Dayflow/Dayflow/Core/Thumbnails/ScreenshotThumbnailCache.swift:35-53 | Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:395-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/Thumbnails/ScreenshotThumbnailCache.swift:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:253— Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:253-271 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:698-716 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:253` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:50— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:50-66 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:97-113 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift` and `Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:139— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:139-155 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:258-274 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Dayflow/Dayflow/Views/Components/DayDistractionSummarySection.swift:52— Dayflow/Dayflow/Views/Components/DayDistractionSummarySection.swift:52-68 | Dayflow/Dayflow/Views/Components/DayFocusSummarySection.swift:48-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Components/DayDistractionSummarySection.swift:52` 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) Dayflow/Dayflow/Views/UI/ChatCharts.swift:404— Dayflow/Dayflow/Views/UI/ChatCharts.swift:404-420 | Dayflow/Dayflow/Views/UI/ChatCharts.swift:439-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 `Dayflow/Dayflow/Views/UI/ChatCharts.swift:404` 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–14 lines × 2) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:268— Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:268-281 | Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:335-347 — 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 `Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:268` 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–14 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:421— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:421-433 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:601-614 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:421` 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–14 lines × 2) Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:925— Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:925-938 | Dayflow/Dayflow/Views/UI/MainView/Layout+Panels.swift:196-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) Dayflow/Dayflow/Views/UI/MainView/DateNavigationControls.swift:27— Dayflow/Dayflow/Views/UI/MainView/DateNavigationControls.swift:27-39 | Dayflow/Dayflow/Views/UI/MainView/DateNavigationControls.swift:63-76 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/MainView/DateNavigationControls.swift:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:318— Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:318-330 | Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:385-396 — 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 `Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:318` 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–13 lines × 2) Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:370— Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:370-382 | Dayflow/Dayflow/Views/UI/ChatStylesAndDebug.swift:143-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:370` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12–13 lines × 2) Dayflow/Dayflow/Views/UI/MainView/DateNavigationControls.swift:86— Dayflow/Dayflow/Views/UI/MainView/DateNavigationControls.swift:86-97 | Dayflow/Dayflow/Views/UI/MainView/Support.swift:197-209 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 2) Dayflow/Dayflow/Views/UI/WhatsNewView.swift:487— Dayflow/Dayflow/Views/UI/WhatsNewView.swift:487-499 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:618-629 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:487` 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–10 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:918— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:918-927 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:286-293 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–10 lines × 2) Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:230— Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:230-239 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:354-361 — both copies are in the same file, so extract the 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–10 lines × 2) Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:126— Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:126-135 | Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:347-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:126` 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 `16` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:122` calls `VStack`, `DailyAccessHeaderView` and `Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:346` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–10 lines × 2) Dayflow/Dayflow/Views/UI/Settings/SettingsAccountSection.swift:510— Dayflow/Dayflow/Views/UI/Settings/SettingsAccountSection.swift:510-517 | Dayflow/Dayflow/Views/UI/Settings/SettingsAccountSection.swift:596-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 `Dayflow/Dayflow/Views/UI/Settings/SettingsAccountSection.swift:510` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `12` in one and `4` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/Views/UI/Settings/SettingsAccountSection.swift:595` calls `HStack` and `Dayflow/Dayflow/Views/UI/Settings/SettingsAccountSection.swift:509` 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 × 4) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:877— Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:877-885 | Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:903-911 | Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:918-926 | Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:944-952 — 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 `Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:877` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 4) Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:256— Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:256-264 | Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift:111-119 | Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:359-367 | Dayflow/Dayflow/Views/UI/ChatStylesAndDebug.swift:132-140 — before extracting anything, compare `Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift` and `Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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 `Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:256` 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 × 4) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:599— Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:599-607 | Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:186-194 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:673-681 | Dayflow/Dayflow/Views/UI/VideoThumbnailView.swift:112-120 — 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 (9 lines × 4) Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridPreview.swift:66— Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridPreview.swift:66-74 | Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridPreview.swift:84-92 | Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridPreview.swift:94-105 | Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridPreview.swift:106-114 — 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 `Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridPreview.swift:66` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) Dayflow/Dayflow/Views/Components/LongestFocusCard.swift:259— Dayflow/Dayflow/Views/Components/LongestFocusCard.swift:259-264 | Dayflow/Dayflow/Views/Components/LongestFocusCard.swift:266-271 | Dayflow/Dayflow/Views/Components/LongestFocusCard.swift:273-278 — 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 `Dayflow/Dayflow/Views/Components/LongestFocusCard.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 (6 lines × 3) Dayflow/Dayflow/Views/UI/Agents/AgentsBriefingView.swift:77— Dayflow/Dayflow/Views/UI/Agents/AgentsBriefingView.swift:77-82 | Dayflow/Dayflow/Views/UI/Agents/AgentsCardsView.swift:104-109 | Dayflow/Dayflow/Views/UI/Agents/AgentsCardsView.swift:128-133 — 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 `Dayflow/Dayflow/Views/UI/Agents/AgentsBriefingView.swift:77` 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 × 3) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:70— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:70-75 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:87-92 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:620-625 — 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 (6 lines × 3) Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:22— Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:22-27 | Dayflow/Dayflow/Views/UI/MainView/Support.swift:76-81 | Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridView.swift:53-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.
No assertions: testWeeklyDashboardSnapshotIsSendableForBackgroundLoading Dayflow/DayflowTests/WeeklyDashboardBuilderTests.swift:29— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLaunchPerformance Dayflow/DayflowUITests/DayflowUITests.swift:32— 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: testLaunch Dayflow/DayflowUITests/DayflowUITestsLaunchTests.swift:18— 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.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:81— Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:81-195 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:197-258 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:292-387 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:389-506 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:299-450 — 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) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:387— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:387-435 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:476-553 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:555-617 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:803-847 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:851-905 — 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) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:562— Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:562-637 | Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:162-219 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:220-275 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:613-839 | Dayflow/Dayflow/Views/UI/VideoThumbnailView.swift:83-137 — 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 (20–21 lines × 2) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1240— Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1240-1260 | Dayflow/Dayflow/Core/AI/ClaudeStrictJSONParser.swift:268-287 — 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 (20–21 lines × 2) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:296— Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:296-316 | Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:363-382 — 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 (20–21 lines × 2) Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:296— Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:296-315 | Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:327-347 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:327` 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 `title` to `String(localized: "Upgrade account")` in one and `String(localized: "Edit configuration")` 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 (18 lines × 2) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:200— Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:200-217 | Dayflow/Dayflow/Core/AI/AgentCLISupport+Transcription.swift:84-101 — 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 `Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:200` 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) Dayflow/Dayflow/Core/AI/ClaudeProvider+Prompts.swift:7— Dayflow/Dayflow/Core/AI/ClaudeProvider+Prompts.swift:7-24 | Dayflow/Dayflow/Core/AI/CodexProvider+Prompts.swift:11-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/ClaudeProvider+Prompts.swift:7` 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 lines × 2) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextChartsSection.swift:169— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextChartsSection.swift:169-186 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextShiftComparisonSection.swift:137-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyContextChartsSection.swift:169` 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) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:67— Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:67-82 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:79-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:67` 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) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:344— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:344-359 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Logging.swift:76-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:344` 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) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:611— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:611-626 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:29-44 — before extracting anything, compare `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift` and `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:611` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:69— Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:69-78 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:7-18 — 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 `Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.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. 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–12 lines × 2) Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:86— Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:86-95 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:232-243 — 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 `Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) Dayflow/Dayflow/Views/UI/Settings/SettingsOtherTabView.swift:19— Dayflow/Dayflow/Views/UI/Settings/SettingsOtherTabView.swift:19-30 | Dayflow/Dayflow/Views/UI/Settings/SettingsStorageTabView.swift:92-101 — 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 `Dayflow/Dayflow/Views/UI/Settings/SettingsOtherTabView.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `SettingsStyle.sectionSpacing` in one and `14` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10–11 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:23— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:23-32 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:114-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:32` calls `guard`, `contains`, `readAllData` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:124` 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–11 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:192— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:192-201 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:237-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:192` 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–11 lines × 2) Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:117— Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:117-127 | REDACTED:675-684 — 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 `Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:117` 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 × 3) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:527— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:527-534 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:724-731 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:872-879 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:527` 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 × 3) Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:53— Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:53-60 | Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:84-91 | Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:143-150 — 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 `Dayflow/Dayflow/Utilities/DebugLogFormatter.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.
Duplicated block (8 lines × 3) REDACTED:238— REDACTED:238-245 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:826-833 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:248-255 — 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 `REDACTED:238` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7–8 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:64— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:64-71 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:82-88 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:77— Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:77-84 | Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:102-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.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.
Duplicated block (7–8 lines × 2) Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:238— Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:238-244 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:677-684 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:238` 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.
FunctionTooLong: DailyWorkflowComputation.swift.computeDailyWorkflow Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:8— FunctionTooLong — computeDailyWorkflow runs 274 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 174 over it, 2.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: MCPServer.swift.toolDefinitions tools/dayflow-cli/Sources/dayflow/MCPServer.swift:109— FunctionTooLong — toolDefinitions runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (33 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:269— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:269-301 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:201-233 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:269` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (33 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager.swift:318— Dayflow/Dayflow/Core/Recording/StorageManager.swift:318-350 | Dayflow/Dayflow/Core/Recording/StorageManager.swift:410-442 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager.swift:318` 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) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:130— Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:130-155 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:151-176 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:257— Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:257-282 | Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift:112-137 — before extracting anything, compare `Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift` and `Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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 (21–22 lines × 2) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:99— Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:99-120 | Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:154-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:99` 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 (21–22 lines × 2) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:498— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:498-519 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:694-714 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:498` 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) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:49— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:49-69 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:82-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:732— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:732-752 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:780-800 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:732` 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, `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:776` calls `IN` and `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:728` 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 (18–20 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:293— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:293-310 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:269-288 — 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 (18–20 lines × 2) Dayflow/Dayflow/Core/Recording/StorageModels.swift:99— Dayflow/Dayflow/Core/Recording/StorageModels.swift:99-116 | Dayflow/Dayflow/System/TimelineFailureToast.swift:83-102 — 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 `Dayflow/Dayflow/Core/Recording/StorageModels.swift:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 3) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:107— Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:107-125 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:122-140 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:114-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 all 3 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `batchId` to `Int64? ) async throws -> (cards: [ActivityCardData]` in one and `Int64? ) async throws -> ( cards: [ActivityCardData]` 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 (19 lines × 3) Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:288— Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:288-306 | Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift:143-161 | Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:388-406 — before extracting anything, compare `Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift` and `Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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 `Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:288` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–19 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:401— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:401-417 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:516-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:401` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–19 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:815— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:815-831 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:871-889 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:815` 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–18 lines × 2) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:718— Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:718-735 | Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:822-838 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:718` 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, `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:839` calls `removeAll` and `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:736` 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 (17–18 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:315— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:315-332 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:241-257 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:315` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16–18 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:265— Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:265-280 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:187-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16–18 lines × 2) Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:170— Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:170-187 | Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:357-372 — 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 `Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:170` 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 × 3) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:261— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:261-277 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:90-106 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:193-209 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:261` 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 × 3) Dayflow/Dayflow/Core/Thumbnails/ScreenshotThumbnailCache.swift:36— Dayflow/Dayflow/Core/Thumbnails/ScreenshotThumbnailCache.swift:36-52 | Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:396-412 | Dayflow/Dayflow/Views/UI/ScrubberView.swift:47-63 — before extracting anything, compare `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift` and `Dayflow/Dayflow/Views/UI/ScrubberView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 113 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 `Dayflow/Dayflow/Core/Thumbnails/ScreenshotThumbnailCache.swift:36` 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 first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (NSImage?) -> Void` in one and `@escaping (Int, [NSImage]) -> Void` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15–17 lines × 2) Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:92— Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:92-108 | Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:111-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `batchId` to `Int64? ) async throws -> ( cards: [ActivityCardData]` in one and `Int64? ) async throws -> (observations: [Observation]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15–17 lines × 2) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:383— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:383-397 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:563-579 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:383` 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 (16 lines × 3) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:644— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:644-659 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:717-732 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:104-119 — before extracting anything, compare `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift` and `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:644` 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 × 3) Dayflow/Dayflow/Views/UI/DailyView+Workflow.swift:471— Dayflow/Dayflow/Views/UI/DailyView+Workflow.swift:471-486 | Dayflow/Dayflow/Views/UI/MainView/Layout+TimelineHeader.swift:82-97 | Dayflow/Dayflow/Views/UI/Weekly/WeeklyHeader.swift:64-79 — 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 `Dayflow/Dayflow/Views/UI/DailyView+Workflow.swift:471` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:235— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:235-244 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:417-428 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:607-618 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:775-786 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:284— Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:284-293 | Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift:139-148 | Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:384-393 | Dayflow/Dayflow/Views/UI/ChatStylesAndDebug.swift:156-165 — before extracting anything, compare `Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift` and `Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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 `Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:284` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1286— Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1286-1294 | Dayflow/Dayflow/Core/AI/ClaudeStrictJSONParser.swift:313-321 | Dayflow/Dayflow/System/AnalyticsService.swift:177-185 — 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 `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1286` 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 lines × 3) Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:160— Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:160-168 | Dayflow/Dayflow/Views/UI/MainView/Layout.swift:674-682 | Dayflow/Dayflow/Views/UI/SurveyPromptCard.swift:245-253 — 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 `Dayflow/Dayflow/Views/UI/GitHubStarPromptCard.swift:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/Views/UI/MainView/Layout.swift:673` calls `lineLimit` and `Dayflow/Dayflow/Views/UI/SurveyPromptCard.swift:244` 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 × 4) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:328— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:328-335 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:512-519 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:707-714 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:857-864 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:328` 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 × 4) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:620— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:620-627 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:268-275 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:259-266 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:32-39 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:265` calls `AppSites` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:616` 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 × 4) Dayflow/Dayflow/Views/UI/Agents/AgentsOverviewView.swift:295— Dayflow/Dayflow/Views/UI/Agents/AgentsOverviewView.swift:295-301 | Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:691-697 | Dayflow/Dayflow/Views/UI/SettingsView.swift:209-215 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:966-972 — 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. 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.
Duplicated block (7 lines × 4) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:204— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:204-210 | Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:16-22 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:254-260 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:699-705 — 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 `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:204` 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–7 lines × 2) Dayflow/Dayflow/App/DayflowApp.swift:361— Dayflow/Dayflow/App/DayflowApp.swift:361-367 | Dayflow/Dayflow/App/DayflowApp.swift:372-377 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/App/DayflowApp.swift:361` 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–7 lines × 2) tools/dayflow-cli/Sources/dayflow/MCPServer.swift:437— tools/dayflow-cli/Sources/dayflow/MCPServer.swift:437-443 | tools/dayflow-cli/Sources/dayflow/main.swift:288-293 — 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 `tools/dayflow-cli/Sources/dayflow/MCPServer.swift:437` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 4) Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:491— Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:491-499 | Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:166-176 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:459-467 | Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:406-410 — before extracting anything, compare `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift` and `Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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 `Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:491` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (5 lines × 4) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:66— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:66-70 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:79-83 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:629-633 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:636-640 — 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 `Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
ChatCLIProcessRunner.executeStreaming (cyclomatic 52) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:592— ChatCLIProcessRunner.executeStreaming has cyclomatic complexity 52 (threshold 15). Of this number, 42 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DailyWorkflowComputation.swift.computeDailyWorkflow (cyclomatic 50) Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:8— DailyWorkflowComputation.swift.computeDailyWorkflow has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatService.processConversation (cyclomatic 49) Dayflow/Dayflow/Core/AI/ChatService.swift:172— ChatService.processConversation has cyclomatic complexity 49 (threshold 15). Of this number, 37 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Coordinator.handle (cyclomatic 41) Dayflow/Dayflow/Views/UI/Flow/FlowWebView.swift:150— Coordinator.handle has cyclomatic complexity 41 (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.
LLMService.processBatch (cyclomatic 38) Dayflow/Dayflow/Core/AI/LLMService.swift:650— LLMService.processBatch has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GeminiDirectProvider.geminiTranscribeRequest (cyclomatic 34) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:259— GeminiDirectProvider.geminiTranscribeRequest has cyclomatic complexity 34 (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.
ChatChartSpec.parse (cyclomatic 34) Dayflow/Dayflow/Views/UI/ChatCharts.swift:63— ChatChartSpec.parse has cyclomatic complexity 34 (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.
DebugLogFormatter.makeLog (cyclomatic 33) Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:43— DebugLogFormatter.makeLog has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GeminiDirectProvider.geminiCardsRequest (cyclomatic 31) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:334— GeminiDirectProvider.geminiCardsRequest has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsProvidersTabView.routingRow (cyclomatic 30) Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:243— SettingsProvidersTabView.routingRow 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.
main.swift.top-level code (cyclomatic 30) tools/dayflow-cli/Sources/dayflow/main.swift:14— main.swift.top-level code 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.
FlowSessionTimeline.apply (cyclomatic 29) Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:163— FlowSessionTimeline.apply 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.
VideoPlayerModal.body (cyclomatic 29) Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:613— VideoPlayerModal.body has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClaudeProvider.validateClaudeCardPolicy (cyclomatic 27) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:326— ClaudeProvider.validateClaudeCardPolicy 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.
WeeklyInteractionGraphLayoutBuilder.guidePoint (cyclomatic 27) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:576— WeeklyInteractionGraphLayoutBuilder.guidePoint 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.
TimelineActivityLoader.resolveDisplaySegments (cyclomatic 26) Dayflow/Dayflow/Views/UI/MainView/TimelineActivityLoader.swift:185— TimelineActivityLoader.resolveDisplaySegments has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentCLISupporting.parseCards (cyclomatic 25) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:88— AgentCLISupporting.parseCards has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatCLIProcessRunner.run (cyclomatic 25) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1362— ChatCLIProcessRunner.run 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.
CodexProvider.transcribeScreenshots (cyclomatic 25) Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:12— CodexProvider.transcribeScreenshots 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.
GeminiDirectProvider.validateTimeCoverage (cyclomatic 25) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:744— GeminiDirectProvider.validateTimeCoverage 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.
TimelineOutputSupporting.validateTimeCoverage (cyclomatic 25) Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:147— TimelineOutputSupporting.validateTimeCoverage 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.
FlowDistractionAgent.tick (cyclomatic 25) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:586— FlowDistractionAgent.tick 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.
DayflowButton.body (cyclomatic 25) Dayflow/Dayflow/Views/Components/DayflowButton.swift:29— DayflowButton.body 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.
LLMProviderSetupView.currentStepContent (cyclomatic 25) REDACTED:198— LLMProviderSetupView.currentStepContent 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.
DailyBriefGenerator.cleaned (cyclomatic 24) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:889— DailyBriefGenerator.cleaned has cyclomatic complexity 24 (threshold 15). Of this number, 21 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.
ClaudeOutputValidator.validateActivityCards (cyclomatic 23) Dayflow/Dayflow/Core/AI/ClaudeOutputValidator.swift:96— ClaudeOutputValidator.validateActivityCards 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.
FlowDistractionAgent.handle (cyclomatic 23) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:846— FlowDistractionAgent.handle 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.
ColorOrganizerRoot.contentCard (cyclomatic 23) Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:126— ColorOrganizerRoot.contentCard 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.
ChatCLITestView.runTest (cyclomatic 23) Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:108— ChatCLITestView.runTest 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.
AgentCLISupporting.parseSegments (cyclomatic 22) Dayflow/Dayflow/Core/AI/AgentCLISupport+Transcription.swift:6— AgentCLISupporting.parseSegments has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DailyView.regenerateStandupFromTimeline (cyclomatic 22) Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:264— DailyView.regenerateStandupFromTimeline has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GeminiDirectProvider.generateText (cyclomatic 21) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:6— GeminiDirectProvider.generateText 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.
DailyBriefGenerator.writeTranscript (cyclomatic 21) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:711— DailyBriefGenerator.writeTranscript 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.
ScreenRecorder.registerForSleepAndLock (cyclomatic 21) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:819— ScreenRecorder.registerForSleepAndLock has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentCLISupporting.stripOSCEscapes (cyclomatic 20) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:11— AgentCLISupporting.stripOSCEscapes 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.
ChatCLIProcessRunner.parseCodexEvent (cyclomatic 20) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:946— ChatCLIProcessRunner.parseCodexEvent 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.
LLMLogger.logFailure (cyclomatic 20) Dayflow/Dayflow/Core/AI/LLMLogger.swift:70— LLMLogger.logFailure 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.
OnboardingFlow.body (cyclomatic 20) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:44— OnboardingFlow.body 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.
CanvasActivityCard.body (cyclomatic 20) Dayflow/Dayflow/Views/UI/CanvasActivityCard.swift:93— CanvasActivityCard.body 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.
ClaudeTranscriptionInputBuilder.selectedOCRText (cyclomatic 19) Dayflow/Dayflow/Core/AI/ClaudeTranscriptionInputBuilder.swift:243— ClaudeTranscriptionInputBuilder.selectedOCRText 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.
CodexProvider.generateActivityCards (cyclomatic 19) Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:7— CodexProvider.generateActivityCards 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.
GeminiDirectProvider.generateActivityCards (cyclomatic 19) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:4— GeminiDirectProvider.generateActivityCards 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.
LLMService.makeBatchProvider (cyclomatic 19) Dayflow/Dayflow/Core/AI/LLMService.swift:226— LLMService.makeBatchProvider 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.
OllamaProvider.callChatAPI (cyclomatic 19) Dayflow/Dayflow/Core/AI/OllamaProvider+Networking.swift:70— OllamaProvider.callChatAPI 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.
VideoProcessingService.generateVideoFromScreenshots (cyclomatic 19) Dayflow/Dayflow/Core/Recording/VideoProcessingService.swift:129— VideoProcessingService.generateVideoFromScreenshots 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.
PausePillView.pill (cyclomatic 19) Dayflow/Dayflow/Views/UI/PausePillView.swift:128— PausePillView.pill 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.
Coordinator.startMonitoring (cyclomatic 19) Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:448— Coordinator.startMonitoring 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.
ActivityCard.activityDetails (cyclomatic 19) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:173— ActivityCard.activityDetails 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.
WeekTimelineActivityCard.cardCanvas (cyclomatic 19) Dayflow/Dayflow/Views/UI/MainView/WeekTimelineActivityCard.swift:129— WeekTimelineActivityCard.cardCanvas 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.
FlowDistractionAgent.start (cyclomatic 18) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:253— FlowDistractionAgent.start has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DailyBriefDebugStats.lines (cyclomatic 18) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:528— DailyBriefDebugStats.lines has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentUsageTelemetry.operation (cyclomatic 18) tools/dayflow-cli/Sources/dayflow/AgentUsageTelemetry.swift:68— AgentUsageTelemetry.operation has cyclomatic complexity 18 (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.
AppDelegate.applicationDidFinishLaunching (cyclomatic 17) Dayflow/Dayflow/App/AppDelegate.swift:65— AppDelegate.applicationDidFinishLaunching 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.
DayflowApp.body (cyclomatic 17) Dayflow/Dayflow/App/DayflowApp.swift:293— DayflowApp.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.
ChatCLIProcessRunner.parseClaudeEvent (cyclomatic 17) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:995— ChatCLIProcessRunner.parseClaudeEvent 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.
DailyRecapScheduler.runCheck (cyclomatic 17) Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:71— DailyRecapScheduler.runCheck 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.
TimelineFailureClassifier.providerName (cyclomatic 17) Dayflow/Dayflow/Core/AI/TimelineFailureClassifier.swift:465— TimelineFailureClassifier.providerName 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. This is NOT this file's highest cyclomatic complexity: TimelineFailureClassification.cardMessage (cyclomatic 18) 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.
ColorAssignmentCard.body (cyclomatic 17) Dayflow/Dayflow/Views/Components/CategorySetupCards.swift:210— ColorAssignmentCard.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.
DayflowSurfaceButton.body (cyclomatic 17) Dayflow/Dayflow/Views/Components/DayflowSurfaceButton.swift:34— DayflowSurfaceButton.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.
ChatView.betaLockScreen (cyclomatic 17) Dayflow/Dayflow/Views/UI/ChatView+Content.swift:471— ChatView.betaLockScreen 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.
FilmstripGenerator.generate (cyclomatic 17) Dayflow/Dayflow/Views/UI/ScrubberView.swift:39— FilmstripGenerator.generate 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.
ClaudeTranscriptionInputBuilder.makeFeatures (cyclomatic 16) Dayflow/Dayflow/Core/AI/ClaudeTranscriptionInputBuilder.swift:554— ClaudeTranscriptionInputBuilder.makeFeatures 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.
DayflowBackendProvider.generateTimeline (cyclomatic 16) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:560— DayflowBackendProvider.generateTimeline 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.
GeminiDirectProvider.decodeDashboardSSEChunkObjects (cyclomatic 16) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:280— GeminiDirectProvider.decodeDashboardSSEChunkObjects 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.
OneStepTimelineObservations.make (cyclomatic 16) Dayflow/Dayflow/Core/AI/OneStepTimelineSupport.swift:74— OneStepTimelineObservations.make has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 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.
TimelineOutputSupporting.validateSegments (cyclomatic 16) Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:295— TimelineOutputSupporting.validateSegments 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.
AnalysisManager.queueLLMRequest (cyclomatic 16) Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:533— AnalysisManager.queueLLMRequest 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.
FlowDistractionAgent.finishTick (cyclomatic 16) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:719— FlowDistractionAgent.finishTick 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.
ScreenRecorder.setupCapture (cyclomatic 16) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:272— ScreenRecorder.setupCapture 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.
WhatsNewView.body (cyclomatic 16) Dayflow/Dayflow/Views/UI/WhatsNewView.swift:222— WhatsNewView.body has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WeeklySankeyModelFactory.build (cyclomatic 16) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:263— WeeklySankeyModelFactory.build 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.
TodoComment Dayflow/Dayflow/Core/AI/OllamaProvider.swift:87— // TODO: Remove this when observation generation is fixed upstream — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
DailyWorkflowComputation.swift.computeDailyWorkflow (cognitive 112) Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.swift:8— DailyWorkflowComputation.swift.computeDailyWorkflow has cognitive complexity 112 (threshold 15). Drivers by points: if/else 33 (84 pts), loops 10 (17 pts), boolean chains 8, ternaries 2 (3 pts) (nesting depth added 59). 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.
CodexProvider.transcribeScreenshots (cognitive 73) Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:12— CodexProvider.transcribeScreenshots has cognitive complexity 73 (threshold 15). Drivers by points: if/else 17 (54 pts), error handling 3 (6 pts), loops 2 (5 pts), ternaries 1 (5 pts), boolean chains 3 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatService.processConversation (cognitive 71) Dayflow/Dayflow/Core/AI/ChatService.swift:172— ChatService.processConversation has cognitive complexity 71 (threshold 15). Drivers by points: if/else 26 (49 pts), boolean chains 16, match/switch 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 26). Of this number, 58 points are the body's own statements and 13 belong to 3 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.
DebugLogFormatter.makeLog (cognitive 70) Dayflow/Dayflow/Utilities/DebugLogFormatter.swift:43— DebugLogFormatter.makeLog has cognitive complexity 70 (threshold 15). Drivers by points: if/else 23 (55 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLMService.processBatch (cognitive 70) Dayflow/Dayflow/Core/AI/LLMService.swift:650— LLMService.processBatch has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 12, error handling 5 (11 pts), loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatCLIProcessRunner.executeStreaming (cognitive 65) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:592— ChatCLIProcessRunner.executeStreaming has cognitive complexity 65 (threshold 15). Drivers by points: if/else 36 (63 pts), boolean chains 9, loops 5 (8 pts), ternaries 3 (7 pts), match/switch 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent 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 (ChatCLIProcessRunner.executeStreaming::drainBufferedLines) 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.
GeminiDirectProvider.geminiTranscribeRequest (cognitive 64) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:259— GeminiDirectProvider.geminiTranscribeRequest has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (54 pts), boolean chains 6, match/switch 1 (3 pts), error handling 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimelineActivityLoader.resolveDisplaySegments (cognitive 58) Dayflow/Dayflow/Views/UI/MainView/TimelineActivityLoader.swift:185— TimelineActivityLoader.resolveDisplaySegments has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (33 pts), ternaries 2 (10 pts), boolean chains 8, loops 4 (7 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiDirectProvider.geminiCardsRequest (cognitive 57) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:334— GeminiDirectProvider.geminiCardsRequest has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (46 pts), boolean chains 7, match/switch 1 (3 pts), error handling 1 (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.
GeminiDirectProvider.validateTimeCoverage (cognitive 55) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:744— GeminiDirectProvider.validateTimeCoverage has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 9 (20 pts), boolean chains 3 (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.
TimelineOutputSupporting.validateTimeCoverage (cognitive 55) Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:147— TimelineOutputSupporting.validateTimeCoverage has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 9 (20 pts), boolean chains 3 (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.
ChatCLITestView.runTest (cognitive 52) Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:108— ChatCLITestView.runTest has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (42 pts), ternaries 3 (8 pts), error handling 1, match/switch 1 (nesting depth added 26). 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.
WeeklyInteractionGraphLayoutBuilder.guidePoint (cognitive 51) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:576— WeeklyInteractionGraphLayoutBuilder.guidePoint has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 15 (42 pts), match/switch 3 (5 pts), if/else 2 (4 pts) (nesting depth added 31). 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.
ChatChartSpec.parse (cognitive 50) Dayflow/Dayflow/Views/UI/ChatCharts.swift:63— ChatChartSpec.parse has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 7, loops 1 (2 pts), match/switch 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.
OllamaProvider.callChatAPI (cognitive 47) Dayflow/Dayflow/Core/AI/OllamaProvider+Networking.swift:70— OllamaProvider.callChatAPI has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (37 pts), error handling 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentCLISupporting.stripOSCEscapes (cognitive 46) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:11— AgentCLISupporting.stripOSCEscapes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 7 (26 pts), boolean chains 10, loops 3 (10 pts) (nesting depth added 26). 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.
AgentCLISupporting.parseCards (cognitive 44) Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift:88— AgentCLISupporting.parseCards has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 4, loops 1 (nesting depth added 20). Of this number, 35 points are the body's own statements and 9 belong to one function item inside it that branches. 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.
DailyBriefGenerator.writeTranscript (cognitive 41) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:711— DailyBriefGenerator.writeTranscript has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (7 pts), match/switch 2 (6 pts), ternaries 1 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlowSessionTimeline.apply (cognitive 39) Dayflow/Dayflow/Core/Flow/FlowSessionTimeline.swift:163— FlowSessionTimeline.apply has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 5 (10 pts), boolean chains 9, loops 5 (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.
Coordinator.handle (cognitive 39) Dayflow/Dayflow/Views/UI/Flow/FlowWebView.swift:150— Coordinator.handle has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 10, match/switch 2 (3 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SettingsProvidersTabView.routingRow (cognitive 38) Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:243— SettingsProvidersTabView.routingRow has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 14, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoPlayerModal.body (cognitive 37) Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:613— VideoPlayerModal.body has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 8, ternaries 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GeminiDirectProvider.generateText (cognitive 36) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:6— GeminiDirectProvider.generateText has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 11, error handling 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeProvider.validateClaudeCardPolicy (cognitive 35) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:326— ClaudeProvider.validateClaudeCardPolicy has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 12, loops 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.
GeminiDirectProvider.generateActivityCards (cognitive 35) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:4— GeminiDirectProvider.generateActivityCards has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatCLIProcessRunner.run (cognitive 34) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1362— ChatCLIProcessRunner.run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (7 pts), boolean chains 6, ternaries 2 (4 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexProvider.generateActivityCards (cognitive 34) Dayflow/Dayflow/Core/AI/CodexProvider+ActivityCards.swift:7— CodexProvider.generateActivityCards has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 5, error handling 1 (2 pts), loops 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlowDistractionAgent.tick (cognitive 34) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:586— FlowDistractionAgent.tick has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, ternaries 1 (4 pts), match/switch 1 (2 pts), error handling 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.
GeminiDirectProvider.uploadAndAwait (cognitive 33) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Upload.swift:4— GeminiDirectProvider.uploadAndAwait has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), error handling 2 (6 pts), loops 3 (5 pts), 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.
DailyView.regenerateStandupFromTimeline (cognitive 32) Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:264— DailyView.regenerateStandupFromTimeline has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 7, 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.
ClaudeOutputValidator.validateActivityCards (cognitive 31) Dayflow/Dayflow/Core/AI/ClaudeOutputValidator.swift:96— ClaudeOutputValidator.validateActivityCards has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 8, loops 4 (5 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.
ScreenRecorder.setupCapture (cognitive 31) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:272— ScreenRecorder.setupCapture has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (30 pts), error handling 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.
LLMProviderSetupView.currentStepContent (cognitive 31) REDACTED:198— LLMProviderSetupView.currentStepContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 2 (3 pts), boolean chains 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.
AgentCLISupporting.parseSegments (cognitive 30) Dayflow/Dayflow/Core/AI/AgentCLISupport+Transcription.swift:6— AgentCLISupporting.parseSegments has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 10, error handling 1 (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.
OllamaProvider.generateActivityCards (cognitive 30) Dayflow/Dayflow/Core/AI/OllamaProvider.swift:100— OllamaProvider.generateActivityCards has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 2 (nesting depth added 15). 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.
CanvasActivityCard.body (cognitive 30) Dayflow/Dayflow/Views/UI/CanvasActivityCard.swift:93— CanvasActivityCard.body has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 10 (13 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.
main.swift.top-level code (cognitive 30) tools/dayflow-cli/Sources/dayflow/main.swift:14— main.swift.top-level code has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 6 (12 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlowDistractionAgent.handle (cognitive 29) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:846— FlowDistractionAgent.handle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 7, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeTranscriptionInputBuilder.selectedOCRText (cognitive 28) Dayflow/Dayflow/Core/AI/ClaudeTranscriptionInputBuilder.swift:243— ClaudeTranscriptionInputBuilder.selectedOCRText has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, ternaries 2 (3 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiDirectProvider.extractJSONObjectStrings (cognitive 27) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:336— GeminiDirectProvider.extractJSONObjectStrings has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (3 pts), boolean chains 1, 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.
GeminiDirectProvider.transcribeVideoData (cognitive 27) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:14— GeminiDirectProvider.transcribeVideoData has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 5, error handling 1 (2 pts), loops 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.
DailyBriefGenerator.cleaned (cognitive 27) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:889— DailyBriefGenerator.cleaned has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 4). Of this number, 21 points are the body's own statements and 6 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.
DayflowButton.body (cognitive 27) Dayflow/Dayflow/Views/Components/DayflowButton.swift:29— DayflowButton.body has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 20, if/else 6 (7 pts) (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.
ColorOrganizerRoot.contentCard (cognitive 27) Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:126— ColorOrganizerRoot.contentCard has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 17 (20 pts), if/else 6 (7 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
StorageManager.performPurgeIfNeeded (cognitive 26) Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:430— StorageManager.performPurgeIfNeeded has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (7 pts), boolean chains 1, error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PausePillView.pill (cognitive 26) Dayflow/Dayflow/Views/UI/PausePillView.swift:128— PausePillView.pill has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 9 (11 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.
TimelineActivityLoader.recordingProjectionWindow (cognitive 26) Dayflow/Dayflow/Views/UI/MainView/TimelineActivityLoader.swift:285— TimelineActivityLoader.recordingProjectionWindow has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SquarifiedTreemapLayout.squarify (cognitive 26) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyTreemapLayout.swift:96— SquarifiedTreemapLayout.squarify has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (3 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.
LLMLogger.logFailure (cognitive 25) Dayflow/Dayflow/Core/AI/LLMLogger.swift:70— LLMLogger.logFailure has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 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.
LLMService.makeBatchProvider (cognitive 25) Dayflow/Dayflow/Core/AI/LLMService.swift:226— LLMService.makeBatchProvider has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CodexProvider.generateTimeline (cognitive 24) Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:17— CodexProvider.generateTimeline has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 3 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DailyRecapGenerator.extractFirstJSONObject (cognitive 24) Dayflow/Dayflow/Core/AI/DailyRecapGenerator.swift:682— DailyRecapGenerator.extractFirstJSONObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiDirectProvider.decodeDashboardSSEChunkObjects (cognitive 24) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:280— GeminiDirectProvider.decodeDashboardSSEChunkObjects has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2, 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.
VideoProcessingService.generateVideoFromScreenshots (cognitive 24) Dayflow/Dayflow/Core/Recording/VideoProcessingService.swift:129— VideoProcessingService.generateVideoFromScreenshots has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 2 (3 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ActivityCard.activityDetails (cognitive 24) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:173— ActivityCard.activityDetails has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 9 (10 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WeeklySankeyModelFactory.placeLabels (cognitive 24) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:537— WeeklySankeyModelFactory.placeLabels has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 15). 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.
ChatCLIProcessRunner.executeStreaming::drainBufferedLines (cognitive 23) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:705— ChatCLIProcessRunner.executeStreaming::drainBufferedLines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ChatCLIProcessRunner.executeStreaming) 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.
FlowDistractionAgent.start (cognitive 23) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:253— FlowDistractionAgent.start has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 2 (3 pts), match/switch 1 (3 pts), loops 1 (2 pts), 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.
ChatCLIProcessRunner.parseCodexEvent (cognitive 22) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:946— ChatCLIProcessRunner.parseCodexEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, 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.
ChatToolExecutor.formatTimelineCardsForLLM (cognitive 22) Dayflow/Dayflow/Core/AI/ChatToolExecutor.swift:211— ChatToolExecutor.formatTimelineCardsForLLM has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 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.
ClaudeProvider.transcribeScreenshots (cognitive 22) Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:12— ClaudeProvider.transcribeScreenshots has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 2 (6 pts), error handling 3 (5 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalysisManager.queueLLMRequest (cognitive 22) Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:533— AnalysisManager.queueLLMRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppDelegate.applicationDidFinishLaunching (cognitive 21) Dayflow/Dayflow/App/AppDelegate.swift:65— AppDelegate.applicationDidFinishLaunching has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3 (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.
ChatCLIProcessRunner.parseClaudeEvent (cognitive 21) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:995— ChatCLIProcessRunner.parseClaudeEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 9 (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.
ClaudeOutputValidator.validateTranscriptionSegments (cognitive 21) Dayflow/Dayflow/Core/AI/ClaudeOutputValidator.swift:210— ClaudeOutputValidator.validateTranscriptionSegments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OneStepTimelineObservations.make (cognitive 21) Dayflow/Dayflow/Core/AI/OneStepTimelineSupport.swift:74— OneStepTimelineObservations.make has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, loops 3 (5 pts), ternaries 1 (nesting depth added 6). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlowDistractionAgent.jsonObjects (cognitive 21) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:1293— FlowDistractionAgent.jsonObjects has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 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.
FaviconContrast.pixelSamples (cognitive 21) Dayflow/Dayflow/Core/Net/FaviconService.swift:519— FaviconContrast.pixelSamples has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 2 (3 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.
ChatCLITestView.body (cognitive 21) Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:18— ChatCLITestView.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 5 (8 pts), boolean chains 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.
ChatContentParser.blocks (cognitive 21) Dayflow/Dayflow/Views/UI/ChatCharts.swift:289— ChatContentParser.blocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.swift.runStatus (cognitive 21) tools/dayflow-cli/Sources/dayflow/main.swift:358— main.swift.runStatus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (8 pts), error handling 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.
TelemetryErrorSanitizer.balancedJSONEnd (cognitive 20) Dayflow/Dayflow/System/AnalyticsService.swift:153— TelemetryErrorSanitizer.balancedJSONEnd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, 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.
ChatCLIProcessRunner.balancedJSONEnd (cognitive 20) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1262— ChatCLIProcessRunner.balancedJSONEnd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, 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.
ChatService.parseAssistantMetadata (cognitive 20) Dayflow/Dayflow/Core/AI/ChatService.swift:660— ChatService.parseAssistantMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 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.
ClaudeProvider.balancedJSONEnd (cognitive 20) Dayflow/Dayflow/Core/AI/ClaudeStrictJSONParser.swift:289— ClaudeProvider.balancedJSONEnd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, 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.
DayflowBackendProvider.generateTimeline (cognitive 20) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:560— DayflowBackendProvider.generateTimeline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiDirectProvider.extractFirstJSONObject (cognitive 20) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Logging.swift:65— GeminiDirectProvider.extractFirstJSONObject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (3 pts), boolean chains 1, 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.
TimelineOutputSupporting.validateSegments (cognitive 20) Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:295— TimelineOutputSupporting.validateSegments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, 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.
FlowDistractionAgent.finishTick (cognitive 20) Dayflow/Dayflow/Core/Flow/FlowDistractionAgent.swift:719— FlowDistractionAgent.finishTick has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 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.
ScreenRecorder.registerForSleepAndLock (cognitive 20) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:819— ScreenRecorder.registerForSleepAndLock has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WeeklyOverviewBuilder.longestFocusSummary (cognitive 20) Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:282— WeeklyOverviewBuilder.longestFocusSummary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Coordinator.startMonitoring (cognitive 20) Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:448— Coordinator.startMonitoring has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
DayflowApp.body (cognitive 19) Dayflow/Dayflow/App/DayflowApp.swift:293— DayflowApp.body has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (5 pts), boolean chains 4 (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.
GeminiDirectProvider.processDashboardSSEChunkObject (cognitive 19) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:228— GeminiDirectProvider.processDashboardSSEChunkObject has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalysisManager.reprocessDay (cognitive 19) Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:105— AnalysisManager.reprocessDay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (6 pts), match/switch 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnboardingFlow.body (cognitive 19) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:44— OnboardingFlow.body has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilmstripGenerator.generate (cognitive 19) Dayflow/Dayflow/Views/UI/ScrubberView.swift:39— FilmstripGenerator.generate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SpinnerNSView.precomputeAnimations (cognitive 19) Dayflow/Dayflow/Views/UI/TimelineThinkingSpinner.swift:206— SpinnerNSView.precomputeAnimations has cognitive complexity 19 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 5). Of this number, 13 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TimelineCalendarPopover.daysToDisplay (cognitive 19) Dayflow/Dayflow/Views/UI/MainView/TimelineCalendarPopover.swift:256— TimelineCalendarPopover.daysToDisplay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WeekTimelineActivityCard.cardCanvas (cognitive 19) Dayflow/Dayflow/Views/UI/MainView/WeekTimelineActivityCard.swift:129— WeekTimelineActivityCard.cardCanvas has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 14 (15 pts), if/else 3, boolean chains 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.
WeeklyInteractionGraphLayoutBuilder.layout (cognitive 19) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyInteractionGraphLayout.swift:35— WeeklyInteractionGraphLayoutBuilder.layout has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 3 (4 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.
WeeklySankeyModelFactory.build (cognitive 19) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:263— WeeklySankeyModelFactory.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (6 pts), boolean chains 3, ternaries 2 (nesting depth added 4). 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.
ChatCLIProcessRunner.stripANSIEscapes (cognitive 18) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1022— ChatCLIProcessRunner.stripANSIEscapes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DailyRecapScheduler.runCheck (cognitive 18) Dayflow/Dayflow/Core/AI/DailyRecapScheduler.swift:71— DailyRecapScheduler.runCheck has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 6, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GemmaBackupProvider.appendCard (cognitive 18) Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:174— GemmaBackupProvider.appendCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 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.
DailyBriefGenerator.recentBriefItems (cognitive 18) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:350— DailyBriefGenerator.recentBriefItems has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 1 (2 pts), ternaries 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
StorageManager.cleanupRecordingStragglers (cognitive 18) Dayflow/Dayflow/Core/Recording/StorageManager+Maintenance.swift:498— StorageManager.cleanupRecordingStragglers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, 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.
DayflowSurfaceButton.body (cognitive 18) Dayflow/Dayflow/Views/Components/DayflowSurfaceButton.swift:34— DayflowSurfaceButton.body has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LocalLLMTestView.runTest (cognitive 18) Dayflow/Dayflow/Views/Onboarding/LocalLLMTestView.swift:174— LocalLLMTestView.runTest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4 (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.
DailyBriefDebugStats.lines (cognitive 18) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefPageView.swift:528— DailyBriefDebugStats.lines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, ternaries 3 (4 pts), boolean chains 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.
FlowOverlayView.updateCreature (cognitive 18) Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:105— FlowOverlayView.updateCreature has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
main.swift.runDaily (cognitive 18) tools/dayflow-cli/Sources/dayflow/main.swift:221— main.swift.runDaily has cognitive complexity 18 (threshold 15). Drivers by points: loops 2 (6 pts), ternaries 2 (6 pts), if/else 3 (5 pts), error handling 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.
DayflowBackendProvider.transcribeScreenshots (cognitive 17) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:380— DayflowBackendProvider.transcribeScreenshots has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 2 (3 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.
GeminiDirectProvider.validateTimeline (cognitive 17) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:870— GeminiDirectProvider.validateTimeline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiDirectProvider.logGeminiFailure (cognitive 17) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Logging.swift:18— GeminiDirectProvider.logGeminiFailure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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.
TimelineOutputSupporting.validateTimeline (cognitive 17) Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:247— TimelineOutputSupporting.validateTimeline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageManager.replaceTimelineCardsInRange (cognitive 17) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:977— StorageManager.replaceTimelineCardsInRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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.
ColorAssignmentCard.body (cognitive 17) Dayflow/Dayflow/Views/Components/CategorySetupCards.swift:210— ColorAssignmentCard.body has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 6, boolean chains 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.
ChatView.betaLockScreen (cognitive 17) Dayflow/Dayflow/Views/UI/ChatView+Content.swift:471— ChatView.betaLockScreen has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 4. 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.
DailyView.refreshStandupDraftIfNeeded (cognitive 17) Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:597— DailyView.refreshStandupDraftIfNeeded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6 (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.
AgentPlaybackHost.receive (cognitive 17) Dayflow/Dayflow/Views/UI/Agents/AgentPlaybackView.swift:349— AgentPlaybackHost.receive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, 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.
StoragePathMigrator.relocateDirectoryContents (cognitive 16) Dayflow/Dayflow/Utilities/StoragePathMigrator.swift:63— StoragePathMigrator.relocateDirectoryContents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DayflowBackendProvider.generateDaily (cognitive 16) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:228— DayflowBackendProvider.generateDaily has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 2 (3 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.
LLMLogger.logSuccess (cognitive 16) Dayflow/Dayflow/Core/AI/LLMLogger.swift:35— LLMLogger.logSuccess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 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.
TimelineFailureClassifier.providerName (cognitive 16) Dayflow/Dayflow/Core/AI/TimelineFailureClassifier.swift:465— TimelineFailureClassifier.providerName has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 5. 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.
DailyBriefGenerator.runStructuredClaude (cognitive 16) Dayflow/Dayflow/Core/DailyBrief/DailyBriefGenerator.swift:620— DailyBriefGenerator.runStructuredClaude has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, error handling 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenRecorder.refreshDisplay (cognitive 16) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:704— ScreenRecorder.refreshDisplay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageManager.saveTimelineCardShell (cognitive 16) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:67— StorageManager.saveTimelineCardShell has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 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.
ActivityCard.titleView (cognitive 16) Dayflow/Dayflow/Views/UI/MainView/ActivityCard.swift:312— ActivityCard.titleView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimelineActivityLoader.buildActivities (cognitive 16) Dayflow/Dayflow/Views/UI/MainView/TimelineActivityLoader.swift:95— TimelineActivityLoader.buildActivities has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Database.query (cognitive 16) tools/dayflow-cli/Sources/dayflow/Database.swift:88— Database.query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 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.
MCPServer.swift.runMCPServer (cognitive 16) tools/dayflow-cli/Sources/dayflow/MCPServer.swift:18— MCPServer.swift.runMCPServer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (4 members, 51 shared lines) · ×1
Near-duplicate member family (4 members, 51 shared lines) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:228— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:228-362 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:380-555 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:560-752 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:754-900 — These 4 members are variants of one another: a block of 51 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member pair (219 shared lines) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:334— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:334-614 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:259-568 — These two members are variants of one another: 219 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 (91 shared lines) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:510— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:510-620 | Dayflow/Dayflow/Views/UI/ScrubberView.swift:189-306 — These two members are variants of one another: 91 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (72 shared lines) Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:105— Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:105-238 | Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:240-369 — These two members are variants of one another: 72 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 (67 shared lines) Dayflow/Dayflow/Core/Recording/StorageManager.swift:274— Dayflow/Dayflow/Core/Recording/StorageManager.swift:274-364 | Dayflow/Dayflow/Core/Recording/StorageManager.swift:366-456 — These two members are variants of one another: 67 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 (61 shared lines) Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:17— Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:17-166 | Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:17-164 — These two members are variants of one another: 61 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 (57 shared lines) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:39— Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:39-155 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:12-176 — These two members are variants of one another: 57 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 (32 shared lines) Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:121— Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:121-232 | Dayflow/Dayflow/Views/UI/DailyAccessLockedViews.swift:346-415 — These two members are variants of one another: 32 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 (23 shared lines) Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:37— Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:37-132 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyModelFactory.swift:134-176 — These two members are variants of one another: 23 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 (177 corresponding lines) · ×1
Edited copy of a member (177 corresponding lines) Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:31— Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:31-207 | Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:209-385 — These two members are one piece of code written twice and then edited apart: 177 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:242— Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:242-306 | Dayflow/Dayflow/Core/Weekly/WeeklyDashboardBuilder.swift:318-351 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:186— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:186-207 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:209-228 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:262— Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:262-286 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:325-349 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (77 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:538— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:538-614 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:492-568 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:538` 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 (51–65 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:781— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:781-845 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:170-220 — 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:781` 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 (55–58 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:389— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:389-443 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:292-349 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:389` 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 (51 lines × 2) Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:32— Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:32-82 | Dayflow/Dayflow/Core/AI/ChatPromptBuilder.swift:210-260 — both copies are in the same file, so extract the 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 (48–50 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:563— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:563-610 | Dayflow/Dayflow/Views/UI/ScrubberView.swift:245-294 — before extracting anything, compare `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift` and `Dayflow/Dayflow/Views/UI/ScrubberView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 113 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 `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:563` 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 (43 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:55— Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:55-97 | Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift:55-97 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:55` 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 (32–38 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:497— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:497-534 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:457-488 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:497` 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 (30–38 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:870— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:870-907 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:247-276 — 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:870` 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 (35–37 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:525— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:525-559 | Dayflow/Dayflow/Views/UI/ScrubberView.swift:205-241 — before extracting anything, compare `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift` and `Dayflow/Dayflow/Views/UI/ScrubberView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 113 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 `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:525` 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–37 lines × 2) Dayflow/Dayflow/Views/UI/MainView/TimelineActivityLoader.swift:147— Dayflow/Dayflow/Views/UI/MainView/TimelineActivityLoader.swift:147-183 | Dayflow/Dayflow/Views/UI/TimelineReviewTypes.swift:206-241 — 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 `Dayflow/Dayflow/Views/UI/MainView/TimelineActivityLoader.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 `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 (33–36 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:34— Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:34-69 | Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:33-65 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (34–35 lines × 2) Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:182— Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:182-215 | Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:318-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:182` 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 (32 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:170— Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:170-201 | Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:187-218 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:170` 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 (22–29 lines × 2) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:623— Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:623-644 | Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1402-1430 — both copies are in the same file, so extract the 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, `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1432` calls `shellEscape` and `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:645` 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 (29 lines × 2) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:458— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:458-486 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:816-844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:458` 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 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:17— Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift:17-44 | Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift:17-44 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Text.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Text.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (26–27 lines × 2) Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:659— Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:659-685 | Dayflow/Dayflow/Views/Onboarding/SetupContinueButton.swift:51-76 — 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 `Dayflow/Dayflow/Views/Components/TimelineCardColorPicker.swift:659` 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–26 lines × 3) Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:127— Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:127-138 | Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:154-179 | Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:195-202 — 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 `Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:127` 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 (21–26 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineReview.swift:246— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineReview.swift:246-271 | Dayflow/Dayflow/Views/UI/TimelineReviewOverlay.swift:672-692 — 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 `Dayflow/Dayflow/Core/Recording/StorageManager+TimelineReview.swift:246` 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 first that the copies are not typed on the same thing: the declarations holding them bind `segments` to `[TimelineReviewRatingSegment]` in one and `[CoverageSegment]` 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 (24–25 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:456— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:456-479 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:383-407 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:456` 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 (25 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager.swift:287— Dayflow/Dayflow/Core/Recording/StorageManager.swift:287-311 | Dayflow/Dayflow/Core/Recording/StorageManager.swift:379-403 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager.swift:287` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (17–24 lines × 5) Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:179— Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:179-195 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:242-258 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:368-387 | Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:490-506 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:427-450 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.swift:179` 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 (21–24 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:137— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:137-157 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:234-257 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:137` 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–24 lines × 2) Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:156— Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:156-179 | Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:293-315 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–24 lines × 2) Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeVideoIntroStep.swift:80— Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeVideoIntroStep.swift:80-98 | Dayflow/Dayflow/Views/Onboarding/VideoLaunchView.swift:52-75 — 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 `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeVideoIntroStep.swift:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–24 lines × 2) Dayflow/Dayflow/Views/UI/GettingStarted/GettingStartedTourView.swift:50— Dayflow/Dayflow/Views/UI/GettingStarted/GettingStartedTourView.swift:50-61 | Dayflow/Dayflow/Views/UI/GettingStarted/GettingStartedTourView.swift:63-86 — both copies are in the same file, so extract the 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–23 lines × 4) Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:124— Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:124-136 | Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:150-172 | Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:192-200 | Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:226-239 — 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 `Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:173` calls `String`, `information` and `Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:239` 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) Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1263— Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1263-1285 | Dayflow/Dayflow/Core/AI/ClaudeStrictJSONParser.swift:290-312 | Dayflow/Dayflow/System/AnalyticsService.swift:154-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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1263` 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–23 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:90— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:90-112 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:117-132 — both copies are in the same file, so extract the 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 (22 lines × 3) Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:838— Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:838-859 | Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:879-900 | Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:920-941 — 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 `Dayflow/Dayflow/Core/Recording/ScreenRecorder.swift:838` 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 (17–21 lines × 3) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:486— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:486-506 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:411-428 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:447-463 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:486` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–21 lines × 2) Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:112— Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:112-132 | Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift:114-128 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift` and `Dayflow/Dayflow/Core/AI/CodexProvider+Timeline.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:112` 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 (20 lines × 3) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:536— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:536-555 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:733-752 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:881-900 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:536` 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–20 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:125— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:125-140 | Dayflow/Dayflow/Views/UI/VideoPlayerModal.swift:773-792 — 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 `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–19 lines × 6) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:486— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:486-503 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:509-527 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:411-425 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:429-444 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:447-461 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:466-481 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:486` 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–19 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:279— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:279-291 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:243-261 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:279` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16–18 lines × 3) Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:262— Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:262-277 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:288-305 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:325-340 — 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 `Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `scaled(10)` in one and `scaled(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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:322` calls `frame` and `Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:259` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–18 lines × 2) Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:239— Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:239-252 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:175-192 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider.swift:239` 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–17 lines × 4) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:276— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:276-292 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:453-467 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:647-661 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:811-825 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:276` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) Dayflow/Dayflow/Core/AI/DailyRecapModels.swift:83— Dayflow/Dayflow/Core/AI/DailyRecapModels.swift:83-98 | Dayflow/Dayflow/Core/AI/DailyRecapModels.swift:100-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–17 lines × 2) Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:77— Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift:77-93 | Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift:117-124 — before extracting anything, compare `Dayflow/Dayflow/Core/Weekly/WeeklyDonutBuilder.swift` and `Dayflow/Dayflow/Core/Weekly/WeeklyOverviewBuilder.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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. 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–17 lines × 2) Dayflow/Dayflow/Views/Components/DayflowButton.swift:90— Dayflow/Dayflow/Views/Components/DayflowButton.swift:90-101 | Dayflow/Dayflow/Views/UI/MainView/WeekTimelineActivityCard.swift:198-214 — 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 `Dayflow/Dayflow/Views/Components/DayflowButton.swift:90` 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–16 lines × 2) Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:18— Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:18-32 | Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.swift:463-478 — 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 `Dayflow/Dayflow/Core/AI/CodexProvider+Transcription.swift:18` 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–16 lines × 2) Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:107— Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:107-120 | Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:242-257 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Analysis/AnalysisManager.swift:107` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 4) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:424— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:424-438 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:541-555 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:329-343 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:495-509 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–15 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:164— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:164-175 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:248-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) Dayflow/Dayflow/Views/UI/DailyView+Access.swift:162— Dayflow/Dayflow/Views/UI/DailyView+Access.swift:162-176 | Dayflow/Dayflow/Views/UI/Weekly/WeeklyView.swift:407-420 — 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 × 4) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:123— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:123-136 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:242-255 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:303-316 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:358-371 — 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 `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:123` 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 `batchId` to `Int64? ) async throws -> (SummaryResponse` in one and `Int64?) async throws -> ( TitleResponse` 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 (14 lines × 3) Dayflow/Dayflow/Views/UI/WhatsNewView.swift:435— Dayflow/Dayflow/Views/UI/WhatsNewView.swift:435-448 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:571-584 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:748-761 — 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 `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:435` 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–14 lines × 2) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:598— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:598-611 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:277-288 — 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Transcription.swift:598` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–14 lines × 3) Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:333— Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:333-345 | Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:418-431 | Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:501-510 — 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 `Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:349` calls `scheduleStandupRegenerateReset` and `Dayflow/Dayflow/Views/UI/DailyView+Standup.swift:435` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 4) Dayflow/Dayflow/Views/UI/WhatsNewView.swift:436— Dayflow/Dayflow/Views/UI/WhatsNewView.swift:436-448 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:572-584 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:692-703 | Dayflow/Dayflow/Views/UI/WhatsNewView.swift:749-761 — 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 `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:436` 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, `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:585` calls `disabled`, `opacity` and `Dayflow/Dayflow/Views/UI/WhatsNewView.swift:704` 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) Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:37— Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:37-49 | Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:59-71 | Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:81-93 — 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 `Dayflow/Dayflow/Core/AI/ChatMetadataParser.swift:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–13 lines × 3) Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:396— Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:396-408 | Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:432-441 | Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:478-489 — 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 `Dayflow/Dayflow/Views/UI/Settings/SettingsProvidersTabView.swift:396` 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 (9–13 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:67— Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:67-75 | Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:149-161 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:67` 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 × 5) Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:153— Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:153-164 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:125-136 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:244-255 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:305-316 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:360-371 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `batchId` to `Int64? ) async throws -> (SummaryResponse` in one and `Int64?) async throws -> ( TitleResponse` 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 × 4) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:342— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:342-353 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:536-547 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:733-744 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:881-892 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:342` 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, `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:548` calls `capture` and `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:354` 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–12 lines × 4) REDACTED:204— REDACTED:204-214 | REDACTED:325-335 | REDACTED:414-423 | REDACTED:608-619 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:68— Dayflow/Dayflow/Core/AI/ClaudeProvider+ActivityCards.swift:68-79 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Timeline.swift:80-91 | Dayflow/Dayflow/Core/AI/ClaudeProvider+Transcription.swift:76-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (9–12 lines × 2) Dayflow/Dayflow/System/DayflowAuthManager.swift:489— Dayflow/Dayflow/System/DayflowAuthManager.swift:489-500 | Dayflow/Dayflow/System/DayflowAuthManager.swift:565-573 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/System/DayflowAuthManager.swift:489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–11 lines × 5) REDACTED:204— REDACTED:204-213 | REDACTED:310-317 | REDACTED:325-334 | REDACTED:414-422 | REDACTED:608-618 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:204` 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 `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, `REDACTED:621` calls `VStack`, `HStack` and `REDACTED:318` 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 × 5) Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:649— Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:649-659 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:722-732 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:829-839 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeFlow.swift:251-261 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:109-119 — 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 `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:649` 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 × 4) REDACTED:156— REDACTED:156-164 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:645-655 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:718-728 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:105-115 — before extracting anything, compare `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift` and `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–11 lines × 2) Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:194— Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:194-204 | Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:217-225 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/UI/DailyBrief/DailyBriefComponents.swift:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–11 lines × 2) Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:212— Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:212-218 | Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:251-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/UI/Flow/FlowOverlayView.swift:212` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 6) Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:116— Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:116-125 | REDACTED:158-167 | REDACTED:182-191 | REDACTED:285-294 | REDACTED:674-683 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeChooseProviderStep.swift:381-390 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Onboarding/HowItWorksView.swift:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:192` calls `disabled`, `opacity` and `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeChooseProviderStep.swift:391` 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–10 lines × 4) Dayflow/Dayflow/Views/Components/ReferralSurveyView.swift:188— Dayflow/Dayflow/Views/Components/ReferralSurveyView.swift:188-197 | Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift:782-791 | Dayflow/Dayflow/Views/Onboarding/Prototype/DayflowProOnboardingSignIn.swift:143-149 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:82-91 — before extracting anything, compare `Dayflow/Dayflow/Views/Onboarding/OnboardingFlow.swift` and `Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Views/Components/ReferralSurveyView.swift:188` 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–10 lines × 3) REDACTED:297— REDACTED:297-306 | REDACTED:315-321 | Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeRoleSelectionStep.swift:46-53 — 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 `REDACTED:315` 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 (4–10 lines × 4) Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:267— Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:267-270 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:440-449 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:642-645 | Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:798-807 — 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 `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:440` 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, `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:449` calls `setValue` and `Dayflow/Dayflow/Core/AI/DayflowBackendProvider.swift:645` 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–10 lines × 2) Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:62— Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:62-71 | Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:159-165 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–10 lines × 2) Dayflow/Dayflow/Views/Components/DayGoalReviewComponents.swift:162— Dayflow/Dayflow/Views/Components/DayGoalReviewComponents.swift:162-171 | Dayflow/Dayflow/Views/UI/TimelineReviewChrome.swift:345-350 — 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 `Dayflow/Dayflow/Views/Components/DayGoalReviewComponents.swift:162` 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–9 lines × 4) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:34— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:34-41 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:235-243 | Dayflow/Dayflow/Core/AI/OllamaProvider.swift:214-222 | Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift:81-88 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift` and `Dayflow/Dayflow/Core/AI/TimelineOutputSupport.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Prompting.swift:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–9 lines × 3) Dayflow/Dayflow/Core/AI/ClaudeProvider+Prompts.swift:15— Dayflow/Dayflow/Core/AI/ClaudeProvider+Prompts.swift:15-22 | Dayflow/Dayflow/Core/AI/CodexProvider+Prompts.swift:19-26 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:10-18 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8–9 lines × 2) Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:516— Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:516-523 | Dayflow/Dayflow/Views/UI/ScrubberView.swift:195-203 — before extracting anything, compare `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift` and `Dayflow/Dayflow/Views/UI/ScrubberView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 113 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 `Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:516` 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) Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:421— Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:421-427 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:601-607 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:837-844 | Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:895-902 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–8 lines × 3) Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:290— Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:290-297 | Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:299-306 | Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:307-311 — 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 `Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:307` 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 before the matched lines, `Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:290` calls `Text` and `Dayflow/Dayflow/Views/Onboarding/ChatCLIDetectionViews.swift:307` 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–6 lines × 3) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:478— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:478-484 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:145-148 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:60-65 — before extracting anything, compare `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift` and `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:478` 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–6 lines × 2) Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:156— Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:156-161 | Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:256-260 — both copies are in the same file, so extract the 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 `Dayflow/Dayflow/Views/Onboarding/ChatCLITestView.swift:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–6 lines × 4) Dayflow/Dayflow/Utilities/DayflowTheme.swift:605— Dayflow/Dayflow/Utilities/DayflowTheme.swift:605-607 | Dayflow/Dayflow/Utilities/DayflowTheme.swift:626-628 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyComponents.swift:122-127 | Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklySankeyComponents.swift:148-153 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Utilities/DayflowTheme.swift:605` 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, `Dayflow/Dayflow/Utilities/DayflowTheme.swift:609` calls `init`, `Color`, `opacity` and `Dayflow/Dayflow/Utilities/DayflowTheme.swift:630` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 6) Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:147— Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:147-149 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+DashboardStreaming.swift:238-240 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Logging.swift:117-121 | Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift:65-69 | Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:91-95 | Dayflow/Dayflow/Utilities/GeminiAPIHelper.swift:220-222 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Logging.swift:117` 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.
Sync-over-async blocking Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:592— `executeStreaming` is async and calls .wait() — 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.
Duplicated predicate Dayflow/Dayflow/Models/DayGoalPlan.swift:110— `$0.isSystem == false && $0.isIdle == false` appears character-identically in 2 files — Dayflow/Dayflow/Models/DayGoalPlan.swift, Dayflow/Dayflow/Views/Components/DayGoalFlowView.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 Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1286— `byte == UInt8(ascii: "}") || byte == UInt8(ascii: "]")` appears character-identically in 3 files — Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift, Dayflow/Dayflow/Core/AI/ClaudeStrictJSONParser.swift, Dayflow/Dayflow/System/AnalyticsService.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 Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift:1246— `bytes[start] == UInt8(ascii: "{") || bytes[start] == UInt8(ascii: "[")` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift, Dayflow/Dayflow/Core/AI/ClaudeStrictJSONParser.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 Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:131— `className.contains("TextField") || className.contains("TextEditor") || className.contains("TextInput")` appears character-identically in 2 files — Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift, Dayflow/Dayflow/Views/UI/VideoPlayerModal.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 Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift:261— `cleanedPrimary == nil && cleanedSecondary == nil` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Networking.swift, Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.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 Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:789— `coveredStart < inputRange.end && safetyCounter > 0` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift, Dayflow/Dayflow/Core/AI/TimelineOutputSupport.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 Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeVideoIntroStep.swift:102— `currentSeconds >= totalSeconds - 0.3 && currentSeconds < totalSeconds` appears character-identically in 2 files — Dayflow/Dayflow/Views/Onboarding/Prototype/OnboardingPrototypeVideoIntroStep.swift, Dayflow/Dayflow/Views/Onboarding/VideoLaunchView.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 Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift:78— `descriptor.isIdle && description.isEmpty` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Summaries.swift, Dayflow/Dayflow/Core/AI/OllamaProvider+Summaries.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 Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:907— `durationMinutes < 10 && index < cards.count - 1` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift, Dayflow/Dayflow/Core/AI/TimelineOutputSupport.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 Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:138— `event.keyCode == 49 && event.modifierFlags.intersection(.deviceIndependentFlagsMask).isEmpty` appears character-identically in 2 files — Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift, Dayflow/Dayflow/Views/UI/VideoPlayerModal.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 Dayflow/Dayflow/Core/Weekly/WeeklyDashboardModels.swift:78— `hasNonEmpty(faviconPrimaryRaw) || hasNonEmpty(faviconSecondaryRaw) || hasNonEmpty(faviconPrimaryHost) || hasNonEmpty(faviconSecondaryHost)` appears character-identically in 2 files — Dayflow/Dayflow/Core/Weekly/WeeklyDashboardModels.swift, Dayflow/Dayflow/Views/UI/Weekly/Sections/WeeklyTreemapModels.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 Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift:790— `intersectsTimelineCard || intersectsStatusCard` appears character-identically in 2 files — Dayflow/Dayflow/Views/UI/CanvasTimelineDataView.swift, Dayflow/Dayflow/Views/UI/MainView/WeekTimelineGridView.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 Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:731— `merged.isEmpty || range.start > merged.last!.end + 1` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift, Dayflow/Dayflow/Core/AI/TimelineOutputSupport.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 Dayflow/Dayflow/Models/DayGoalPlan.swift:115— `normalized == "distraction" || normalized == "distractions"` appears character-identically in 2 files — Dayflow/Dayflow/Models/DayGoalPlan.swift, Dayflow/Dayflow/Views/UI/DailyWorkflowComputation.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 Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:292— `origin.x > bounds.minX && origin.x + size.width > bounds.maxX` appears character-identically in 4 files — Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift, Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.swift, Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift, Dayflow/Dayflow/Views/UI/ChatStylesAndDebug.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 Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:796— `outputRange.start - flexibility <= coveredStart && coveredStart <= outputRange.end + flexibility` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift, Dayflow/Dayflow/Core/AI/TimelineOutputSupport.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 Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:812— `outputRange.start > coveredStart && outputRange.start < nextCovered` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift, Dayflow/Dayflow/Core/AI/TimelineOutputSupport.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 Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift:251— `provider == .chatGPT || provider == .claude` appears character-identically in 2 files — Dayflow/Dayflow/Views/Onboarding/ProviderSetupState.swift, REDACTED. 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 Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift:127— `responder is NSTextField || responder is NSTextView || responder is NSText` appears character-identically in 2 files — Dayflow/Dayflow/Views/UI/MainView/ScreenshotSlideshow.swift, Dayflow/Dayflow/Views/UI/VideoPlayerModal.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 Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift:267— `rowWidth > 0 && rowWidth + spacing + proposedWidth > maxWidth` appears character-identically in 2 files — Dayflow/Dayflow/Views/Components/CategoryPickerOverlay.swift, Dayflow/Dayflow/Views/Components/DayCategorySelectionEditor.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 Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift:368— `rowWidth > 0 && rowWidth + spacing + size.width > maxWidth` appears character-identically in 2 files — Dayflow/Dayflow/Views/Components/DayGoalSetupComponents.swift, Dayflow/Dayflow/Views/UI/ChatStylesAndDebug.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 Dayflow/Dayflow/Views/UI/CanvasActivityCard.swift:132— `showTimelineAppIcons && (faviconPrimaryRaw != nil || faviconSecondaryRaw != nil)` appears character-identically in 2 files — Dayflow/Dayflow/Views/UI/CanvasActivityCard.swift, Dayflow/Dayflow/Views/UI/MainView/WeekTimelineActivityCard.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 Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift:221— `startSeconds < -tolerance || endSeconds > videoDuration + tolerance` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GemmaBackupProvider+Frames.swift, Dayflow/Dayflow/Core/AI/OllamaProvider+Transcription.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 Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:878— `startTime.contains("AM") || startTime.contains("PM")` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift, Dayflow/Dayflow/Core/AI/TimelineOutputSupport.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 Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift:290— `strategy == .noRetry || attempt >= maxRetries - 1` appears character-identically in 2 files — Dayflow/Dayflow/Core/AI/GeminiDirectProvider+ActivityCards.swift, Dayflow/Dayflow/Core/AI/GeminiDirectProvider+Text.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default in catch Dayflow/Dayflow/Core/AI/LoginShellRunner.swift:51— `getCodexMCPServerNames` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+ChatHistory.swift:64— `fetchChatConversations` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+ChatHistory.swift:89— `fetchChatMessages` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:57— `fetchUnprocessedChunks` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:130— `fetchBatchLLMMetadata` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:145— `chunksForBatch` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Chunks.swift:176— `fetchChunksInTimeRange` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+DailyStandup.swift:102— `fetchAllDailyStandups` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+DayGoals.swift:22— `countDistinctTimelineDays` 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 Dayflow/Dayflow/Core/Recording/StorageManager+DayGoals.swift:39— `consecutiveSkippedDayGoalCount` 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 Dayflow/Dayflow/Core/Recording/StorageManager+Observations.swift:26— `fetchObservations` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Observations.swift:53— `fetchObservationsByTimeRange` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Observations.swift:130— `fetchObservations` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Reprocessing.swift:229— `countCompletedAnalysisBatchesForWeeklyAccess` 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 Dayflow/Dayflow/Core/Recording/StorageManager+Screenshots.swift:104— `fetchUnprocessedScreenshots` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Screenshots.swift:143— `screenshotsForBatch` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+Screenshots.swift:159— `fetchScreenshotsInTimeRange` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:58— `countTimelineCards` 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 Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:389— `fetchTimelineCards` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/StorageManager+TimelineCards.swift:439— `allBatches` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Dayflow/Dayflow/Core/Recording/TimelapseStorageManager.swift:20— `currentUsageBytes` 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 Dayflow/Dayflow/Core/Recording/TimelapseStorageManager.swift:57— `entrySize` 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.
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 `Dayflow` (108889 LoC, 1066 module-visible types across 30 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.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 55 file(s) — `Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift`, `Dayflow/Dayflow/Core/AI/CLIVersionTelemetry.swift`, `Dayflow/Dayflow/Core/AI/ChatCLIProcessRunner.swift`, `Dayflow/Dayflow/Core/AI/ClaudeTimelinePrompt.swift`, `Dayflow/Dayflow/Core/AI/CodexExecutableResolver.swift`, … (+50 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a177d4-2ec2-78be-8ffa-b219352d2842 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 8 · Warnings: 747 · Recommendations: 53 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 10:49 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.