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

hanxiao/omni-macos

Measured 17 November 2026, 19:45 UTC, at code version 86bdf26

First survey, so nothing to compare with yet
CAI score 33.0out of 100 Weak
CriticalWeakAdequateStrongExemplary

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: 118,137 lines of product code in 16 projects, tests not counted · Estimated rebuild effort: about 0.9 person-years · Weakest lens: Event-Driven, 10.0

Findings by how serious they are

9 critical 1227 serious 31 minor

21 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 19:45 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

48of 48 dimensions measured by tools.
1253of 1267 findings point to an exact file and line, so you can open each one in the code. The other 14 concern the repository as a whole, such as missing documentation.
48dimensions across 7 lenses, read from 118,137 lines of product code in 16 projects.
Chapters

Executive summary

hanxiao/omni-macos falls short of our standard for a preview release, held back most by its Event-Driven lens, the way the code's parts exchange events. It scores 33.0 out of 100 and is rated Weak, and eight of its nine critical findings are security problems in the build pipeline and in its code.

Event-Driven, at 10.0, is the weakest lens and counts most in the score. The best first step is stopping the event handlers from waiting on other services, worth about 20.0 points. Raising Event-Driven to 65 would lift the score to about 52.1.

Three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three weaknesses in the code could be used by an attacker. Pinning each tool to an exact version and fixing the weaknesses the scanner points to would close both risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command, and limiting each secret to its own step would deal with the secret exposed to more of the pipeline than needed. Letting the handler publish a message instead of waiting for the reply would take care of the message handler that waits for another service.

The product code is 118,137 lines, about €130,000 to rebuild.

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

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

If Event-Driven rose from 10.0 to 65, the lowest score rated Strong, the score would rise from 33.0 to about 52.1.

Code composition: what the lines of code are
Product code 78%Tests 22%
Rebuild cost: about €130,000 · Estimate
Cost to rebuild€43,000 to €210,000, for 713 to 2,260 hours of work, about 0.9 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 33. 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.
SizeLarge: 118,137 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
Raises the score by about 20.0 points · Medium effort · Handler temporal coupling
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Package.swift.
Raises the score by about 1.8 points · Low effort · ADR Quality
3
Resolve the 1 `othersGPUNs` spells `Ns` where 34 names in the project spell it `NS` finding(s) in Naming Consistency — start with PaperSuite.swift.
Raises the score by about 1.2 points · Low effort · Naming Consistency

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 €130,000 to build again, about 0.9 person-years of work. Its weakest lens is Event-Driven, at 10.0 (Critical). Event-Driven is about whether the parts of the system can rely on the messages they send each other. Because the weakest lens counts most in the score, work on Event-Driven also moves the score most.
Based on: the rebuild estimate · the Event-Driven grade · how much each lens counts
What to do: Start with the Event-Driven actions in Top priorities.
If you do one thing first · First action
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource. Of all the actions in this report, it raises the score most for the work it takes: about 20.0 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 337,990 lines over the last 90 days, which is about 1,370,737 lines a year. At that pace, the extra work comes to an estimated 210.1 to 1260.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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.

arch Omni (XcodeGen) Omni (XcodeGen) OmniKit OmniKit OmniLink OmniLink crawlbench crawlbench crawlbench->OmniKit filterbench filterbench filterbench->OmniKit linktool linktool linktool->OmniLink mutbench mutbench mutbench->OmniKit ocr-verify ocr-verify ocr-verify->OmniKit omni (SwiftPM) omni (SwiftPM) omni-cli omni-cli omni-pages (SwiftPM) omni-pages (SwiftPM) omni-pages (XcodeGen) omni-pages (XcodeGen) omni-verify omni-verify omni-verify->OmniKit opentime opentime opentime->OmniKit profbench profbench profbench->OmniKit searchbench searchbench searchbench->OmniKit

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.

34 modules, with 13 dependencies between them. One loop runs through 4 of the modules, marked above the diagonal.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 OmniPages2 Scripts3 Tools4 Tools.agenteval5 Tools.agenteval.agenteval6 Tools.ane7 Tools.ane.modestress8 Tools.ane.modestress.load9 Tools.brand10 Tools.eval11 Tools.ocr.convert12 Tools.video13 Tools.video.launch14 Tools.video.launch.core15 Tools.video.launch.film16 Tools.video.linked17 Tools.video.render18 mutbench19 opentime20 profbench21 searchbench22 site.omni23 worker.src24 OmniLink25 Tools.ocr26 omni-verify27 worker28 linktool29 repository30 OmniKit31 OmniCLI32 crawlbench33 filterbench34 ocr-verify
1 OmniPages
2 Scripts
3 Tools
4 Tools.agenteval
5 Tools.agenteval.agenteval
6 Tools.ane
7 Tools.ane.modestress
8 Tools.ane.modestress.load
9 Tools.brand
10 Tools.eval
11 Tools.ocr.convert
12 Tools.video
13 Tools.video.launch
14 Tools.video.launch.core
15 Tools.video.launch.film
16 Tools.video.linked
17 Tools.video.render
18 mutbench
19 opentime
20 profbench
21 searchbench
22 site.omni
23 worker.src
24 OmniLink12
25 Tools.ocr1
26 omni-verify21
27 worker4
28 linktool3
29 repository151123
30 OmniKit1
31 OmniCLI1
32 crawlbench1
33 filterbench1
34 ocr-verify1
Uses a module listed above itPart of a loopThe module itself
1 OmniPages2 Scripts3 Tools4 Tools.agenteval5 Tools.agenteval.agenteval6 Tools.ane7 Tools.ane.modestress8 Tools.ane.modestress.load9 Tools.brand10 Tools.eval11 Tools.ocr.convert12 Tools.video13 Tools.video.launch14 Tools.video.launch.core15 Tools.video.launch.film16 Tools.video.linked17 Tools.video.render18 mutbench19 opentime20 profbench21 searchbench22 site.omni23 worker.src24 OmniLink25 Tools.ocr26 omni-verify27 worker28 linktool29 repository30 OmniKit31 OmniCLI32 crawlbench33 filterbench34 ocr-verifyOmniPages1Scripts2Tools3Tools.agenteval4Tools.agenteval.agenteval5Tools.ane6Tools.ane.modestress7Tools.ane.modestress.load8Tools.brand9Tools.eval10Tools.ocr.convert11Tools.video12Tools.video.launch13Tools.video.launch.core14Tools.video.launch.film15Tools.video.linked16Tools.video.render17mutbench18opentime19profbench20searchbench21site.omni22worker.src23OmniLink24Tools.ocr25omni-verify26worker27linktool28repository29OmniKit30OmniCLI31crawlbench32filterbench33ocr-verify34121214315112311111

At a glance — Code Health · 47.1 · Adequate · gated by D1, D2, X5 ·

At a glance — Architecture · 98.6 · Exemplary ·

At a glance — Maturity · 50.2 · Adequate · gated by D15, M2 ·

At a glance — Readiness · 57.5 · Adequate · gated by P3 ·

At a glance — Security · 65.7 · Checked 4 of 9 · gated by D29, D36 ·

At a glance — Event-Driven · 10.0 · Critical · gated by ED1 ·

At a glance — Performance · 60.0 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A05:2025 — Injection9High / Critical
A03:2025 — Software Supply Chain Failures6Medium

Roadmap

Top priorities: Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource; The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`); Resolve the 49 Hotspot finding(s) in Churn × Complexity Hotspots — start with main.swift (5), Indexer.swift, VectorStore.swift.

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

Do thisHelpsEffortDimension
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.+20.0 ptsMediumHandler temporal coupling
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Package.swift.+1.8 ptsLowADR Quality
Resolve the 1 `othersGPUNs` spells `Ns` where 34 names in the project spell it `NS` finding(s) in Naming Consistency — start with PaperSuite.swift.+1.2 ptsLowNaming Consistency
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).+2.3 ptsMediumNullable reference types
Resolve the 49 Hotspot finding(s) in Churn × Complexity Hotspots — start with main.swift (5), Indexer.swift, VectorStore.swift.+2.2 ptsHighChurn × Complexity Hotspots
Swallowed exception (caught, then discarded)+1.7 ptsMediumException handling
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.+1.6 ptsMediumArchitecture documentation
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.+1.0 ptsMediumAsync & latency hygiene

File quality

Per-file score 0–10 — a quality signature. Of 191 files carrying findings, judged against the Preview bar: 0% slop · 3% mixed · 97% near-clean.

FileScoreBandWorst signal
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
App/AppModel.swift4.8MixedCyclomatic Complexity: AppModel.search (cyclomatic 52)
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
App/SettingsView.swift5.5MixedCyclomatic Complexity: ActivityTab.body (cyclomatic 49)
App/OmniApp.swift5.6MixedCyclomatic Complexity: OmniCommands.body (cyclomatic 31)
Sources/omni-verify/main.swift7.0Near-cleanCyclomatic Complexity: main.swift.top-level code (cyclomatic 1729)
App/PerfScript.swift7.0Near-cleanCyclomatic Complexity: PerfScript.perform (cyclomatic 252)
Sources/OmniKit/Indexer.swift7.0Near-cleanCyclomatic Complexity: Indexer.index (cyclomatic 156)
App/Serving/MCPAdapter.swift7.0Near-cleanCyclomatic Complexity: MCPAdapter.callSearch (cyclomatic 82)
Sources/OmniKit/VectorStore.swift7.0Near-cleanCyclomatic Complexity: VectorStore.tryAdoptRowSidecarLocked (cyclomatic 79)
Sources/OmniKit/OCR/OCRBatched.swift7.0Near-cleanCyclomatic Complexity: OCRModel.decodeContinuous (cyclomatic 79)
App/OCRSession.swift7.0Near-cleanCyclomatic Complexity: OCRSession.run (cyclomatic 58)
Sources/OmniKit/Passages.swift7.0Near-cleanCyclomatic Complexity: TextSlice.read (cyclomatic 52)
Sources/omni-verify/ShotBench.swift7.0Near-cleanCyclomatic Complexity: ShotBench.run (cyclomatic 51)
App/Sidebar.swift7.0Near-cleanCyclomatic Complexity: Sidebar.body (cyclomatic 37)
Sources/OmniCLI/main.swift7.0Near-cleanCyclomatic Complexity: main.swift.arguments (cyclomatic 36)
Sources/OmniKit/OmniEngine.swift7.0Near-cleanCyclomatic Complexity: OmniEngine.setComputeUnit (cyclomatic 36)
Sources/OmniKit/OmniIgnore.swift7.0Near-cleanCyclomatic Complexity: OmniIgnore.inSet (cyclomatic 33)
Sources/OmniKit/ANETextBackend.swift7.0Near-cleanCyclomatic Complexity: ANETextBackend.encode (cyclomatic 31)
Sources/omni-verify/ANEQuery.swift7.0Near-cleanCyclomatic Complexity: ANEQuery.engine (cyclomatic 31)

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

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

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

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

Could not be resolved — 21

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 48 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 48 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D17D19D20D21D27D28D29D30D31D34D35D36D43AX10AX3AX4AX6AX8AX9ED1M1M2M3P1P10P2P3P4P6P8PF3X14X19X26X28X3X5

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

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1eb0a-d4d0-736f-a345-73620bc48a30.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.swift) and this repository declares a SwiftPM test suite (Omni), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 1215 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (118137 LoC, 810 module-visible types across 33 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `App/AppModel.swift`, `App/ContentKeys.swift`, `App/ContentView.swift`, `App/Link/RemoteFiles.swift`, `App/OCRSession.swift`, … (+18 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D44 Platform End-of-Life — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P1 CI/CD gates — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala, Kotlin, PHP and Go source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala, Kotlin, PHP or Go 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • 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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

285 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was main.swift.top-level code at 1729. A further 1 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 PerfScript.applySetting at 28 — they are counted neither in the figure above nor in this dimension's score.

Indexer.index::handleStream (cyclomatic 22) · ×3Sources/OmniKit/Indexer.swift:1832
main.swift.top-level code::arm (cyclomatic 37) · ×2Sources/omni-verify/main.swift:5166
main.swift.top-level code (cyclomatic 1729)Sources/omni-verify/main.swift:61
PerfScript.perform (cyclomatic 252)App/PerfScript.swift:83
main.swift.top-level code (cyclomatic 176)Sources/ocr-verify/main.swift:83

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with main.swift.top-level code (cyclomatic 1729), PerfScript.perform (cyclomatic 252), main.swift.top-level code (cyclomatic 176). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cyclomatic Complexity from 2.0 to about 2.7/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

406 method(s) exceeded the cognitive complexity threshold of 15; the worst was main.swift.top-level code at 3794.

main.swift.top-level code::arm (cognitive 62) · ×7Sources/omni-verify/main.swift:5166
Indexer.index::updateTimeLeft (cognitive 28) · ×4Sources/OmniKit/Indexer.swift:1649
OCRModel.transcribe (cognitive 16) · ×2Sources/OmniKit/OCR/OCRModel.swift:365
main.swift.top-level code (cognitive 3794)Sources/omni-verify/main.swift:61
main.swift.top-level code (cognitive 391)Sources/ocr-verify/main.swift:83

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

What to do

  1. Bring the 40 bodies over 60 down to 60 or less in Cognitive Complexity — start with main.swift.top-level code (cognitive 3794), main.swift.top-level code (cognitive 391), Indexer.index (cognitive 335). — 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 40 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes8.6 / 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.

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

77 god class(es) detected.

FileTooLong: OmniKit/VectorStore.swift · ×26Sources/OmniKit/VectorStore.swift
MethodTooLong: Indexer.index · ×22Sources/OmniKit/Indexer.swift:1118
ClassTooLong: AppModel · ×12App/AppModel.swift:252
TooManyMethods: VectorStore · ×10Sources/OmniKit/VectorStore.swift:771
FunctionTooLong: main.swift.top-level code · ×7Sources/omni-verify/main.swift:61

What to do

  1. Resolve the 26 FileTooLong finding(s) in God Classes — start with main.swift (2), VectorStore.swift, AppModel.swift. — One of this dimension's main actionable groups (26 warning-level).
  2. Resolve the 22 MethodTooLong finding(s) in God Classes — start with Indexer.swift (4), SettingsView.swift (3), OCRBatched.swift (2). — One of this dimension's main actionable groups (22 warning-level).
  3. Resolve the 12 ClassTooLong finding(s) in God Classes — start with AppModel.swift, Indexer.swift, OCRSession.swift. — One of this dimension's main actionable groups (12 warning-level).

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

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

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

152 duplicated block group(s) detected. 4.0 % of the production lines (4,776 of 118,137) are in a reported copy. A further 116 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 33 of the 268 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (5 lines × 2) · ×30App/OCRSession.swift:1995
Duplicated block (6 lines × 2) · ×19Sources/OmniKit/Indexer.swift:1983
Edited copy of a member (4 corresponding lines) · ×16App/ResultsList.swift:654
Duplicated block (7 lines × 2) · ×14App/FolderBrowser.swift:245
Duplicated block (8 lines × 2) · ×13Sources/OmniKit/OCR/OCRResize.swift:71

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

What to do

  1. Resolve the 30 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with main.swift (11), VectorStore.swift (5), Qwen3Backbone.swift (2). — One of this dimension's main actionable groups (30 warning-level).
  2. Resolve the 19 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with main.swift (8), VectorStore.swift (4), PaperCaseCatalog.swift (2). — One of this dimension's main actionable groups (19 warning-level).
  3. Resolve the 16 Edited copy of a member (4 corresponding lines) finding(s) in Code Duplication — start with ModelDownloader.swift (2), render.py (2), ResultsList.swift. — One of this dimension's main actionable groups (16 warning-level).

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

D5 · Coupling9.0 / 10Stronggated by 2 serious findings✓ 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.

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

16 production modules (SwiftPM+XcodeGen), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; an XcodeGen target's dependency on a local Swift package or on a target of another project is not visible there; 2 module(s) off the main sequence, with abstractness counted on 13 of the 16 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: OmniKit · ×2

What to do

  1. Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

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

2 of 125 classes have LCOM4 above 3.

Low cohesion: AppModel (LCOM4 13) · ×2App/AppModel.swift:252

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with AppModel.swift, OmniApp.swift. — One of this dimension's main actionable groups (2 warning-level).

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

D10 · Test Quality8.4 / 10Strong✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

48 skipped, 59 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1159 tests.

No assertions: testNanoWeightsAreTheOnesBuilt · ×59Tests/OmniKitTests/ANEProgramTests.swift:23
Skipped test: testHoldsAutomationModeOpen · ×48UITests/AutomationWindowUITests.swift:30

What to do

  1. Resolve the 59 No assertions finding(s) in Test Quality — start with FilteredSharedSearchTests.swift (8), ReduceEquivalenceTests.swift (6), ExclusionFilterTests.swift (5). — One of this dimension's main actionable groups (59 warning-level).
  2. Resolve the 48 Skipped test finding(s) in Test Quality — start with FileDragUITests.swift (6), AVEncoderTests.swift (5), EngineStateTests.swift (5). — One of this dimension's main actionable groups (48 warning-level).

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

D12 · Dependency Hygiene9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

2 outdated direct SwiftPM dependencies, 0 pinning defect(s). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.

Outdated: mlx-swift · ×2

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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.

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

0 of 3 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 3 of them read from the licence file the repository carries at the revision Package.resolved pins, and 0 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed Package.resolved pins, direct and transitive, and every declared dependency none pins.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots0.0 / 10Critical✓ Tool-verified

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

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

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

Top hotspots: Sources/omni-verify/main.swift (83×2085=173055); Sources/OmniKit/Indexer.swift (68×326=22168); Sources/OmniKit/VectorStore.swift (167×79=13193)

Hotspot: Sources/omni-verify/main.swift · ×49Sources/omni-verify/main.swift:61

What to do

  1. Resolve the 49 Hotspot finding(s) in Churn × Complexity Hotspots — start with main.swift (5), Indexer.swift, VectorStore.swift. — One of this dimension's main actionable groups (49 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

1 of 1 documentation facets pass in full. 11 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundPackage.swift:10

What to do

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

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

D21 · Naming Consistency7.1 / 10Strong✓ Tool-verified

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

1 naming inconsistencies among 35 declarations measured against a convention their peers follow.

`othersGPUNs` spells `Ns` where 34 names in the project spell it `NS`Sources/OmniKit/Paper/PaperSuite.swift:224

What to do

  1. Resolve the 1 `othersGPUNs` spells `Ns` where 34 names in the project spell it `NS` finding(s) in Naming Consistency — start with PaperSuite.swift. — One of this dimension's main actionable groups (1 recommendation-level).

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

D27 · Navigability9.9 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

0 % of calls cross a namespace and 3 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)3.8 / 10Weak✓ Tool-verified

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

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

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

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

10 finding(s): 0 critical, 8 high, 2 medium, 0 low. 3 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 15 file(s) — `App/AppModel.swift` (line 1679, lines 1680–1681, line 1682, …), `App/OCRSession.swift` (line 1013), `App/Serving/ServingController.swift` (line 298, line 299, line 300, …), `Scripts/build-app.sh` (lines 54–55), `Scripts/chaos-run.sh` (line 71, line 78), … (+10 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 3 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (3 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

No known-vulnerable dependencies in any ecosystem this repository declares.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

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

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

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

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

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

Strongest change-coupling: SettingsView.swift↔IndexSettings.swift 61%; ProfilingService.swift↔SettingsView.swift 60%; AppModel.swift↔OmniImageEncoder.swift 50%

Change coupling: SettingsView.swift ↔ IndexSettings.swift · ×2App/SettingsView.swift:1
Change-coupling hub: ProfilingService.swift → OmniApp.swift, SettingsView.swift, Sidebar.swiftApp/ProfilingService.swift

What to do

  1. Resolve the 2 Change coupling finding(s) in Change Coupling — start with SettingsView.swift, AppModel.swift. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with ProfilingService.swift. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

1/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

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

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

Frontend & cross-cutting dimensions

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

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

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

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

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

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

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

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

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

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

ED1 · Handler temporal coupling1.0 / 10Critical✓ Tool-verified

Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.

Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.

  • `VectorStore.onReader` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler. — Sources/OmniKit/VectorStore.swift:5459

What to do

  • Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
M1 · Documentation (README)6.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation2.0 / 10Weak✓ Tool-verified

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

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

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

What to do

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

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

P1 · CI/CD gates8.5 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

What to do

  • Run the test suite in CI via an explicit runner step (`xcodebuild test` for the toolchain this pipeline already uses) and gate merges on it.
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability8.0 / 10Strong✓ Tool-verified

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

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

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

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

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

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

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

  • 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.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

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

  • `moveDatabaseDir` is async and calls usleep — 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. — App/AppModel.swift:6498
  • `top-level code` 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. — Tools/video/recwin.swift:9
  • `top-level code` is async and calls usleep, .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. — Sources/linktool/main.swift:26
  • `run` is async and calls usleep — 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. — Sources/omni-verify/ANEQuery.swift:397
  • `videosegcheckRun` is async and calls usleep — 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. — Sources/omni-verify/main.swift:7413
  • `top-level code` is async and calls usleep, Thread.sleep, .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. — Sources/omni-verify/main.swift:61

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.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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

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

X19 · Unrestored process-global state4.8 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

  • `textBackend` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `k` environment variable (set at line 39, cleared at line 39) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Swift process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`Process.currentDirectoryURL`, `Process.environment`), or build absolute paths with `URL.appendingPathComponent`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every exit, thrown errors included. — Sources/omni-verify/ANEQuery.swift:31
  • `onDevice` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `k` environment variable (set at line 107, cleared at line 107) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Swift process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`Process.currentDirectoryURL`, `Process.environment`), or build absolute paths with `URL.appendingPathComponent`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every exit, thrown errors included. — Sources/omni-verify/ANEQuery.swift:99

What to do

  • Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment variable passed to the operation that needs it (the `cwd` and `env` options of `child_process`, or of `Deno.Command`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional. In Swift the same holds for `changeCurrentDirectoryPath` and `setenv`: give the child `Process.currentDirectoryURL`/`environment`, or `defer` the restore.
X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

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

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

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.3 / 10Adequate✓ Tool-verified

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

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

  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — worker/src/index.ts:562
  • `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. (×15) — Sources/omni-verify/main.swift:1252, Sources/omni-verify/main.swift:1256, Sources/omni-verify/main.swift:1266, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. — App/AppModel.swift:6608

What to do

  • Swallowed exception (caught, then discarded)
X5 · Nullable reference types1.8 / 10Critical✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.
  • ~2.9 `!` null assertions per 1k TypeScript source lines — 2 assertion(s) across the 680 source line(s) of the 1 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: worker/src/index.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

Reference — by lens

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

LensScoreRatingImpact
Code Health47.1Adequate — gated by D1, D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture98.6ExemplaryStrongest area.
Maturity50.2Adequate — gated by D15, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness57.5Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security65.7Checked 4 of 9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven10.0Critical — gated by ED1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 3 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 — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 64 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
  • D16 Bus Factor — single-contributor 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.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Swift surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .py, .swift source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 23 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — Swift suite
  • DM1 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, Scala, Rust and Java, 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 11 current-state document(s) make no claim of a kind M4 checks. 35 claim(s) of kinds M4 does not check were not checked (path 30, command argument 1, environment variable 4); M4 checks only links and versions and artefact counts.
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Swift source, so there is no service whose uptime a failing dependency could take down
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — X1 reached only 7% of this repository's production lines — swift (110,362 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X12 Unreachable branch — X12 reached only 7% of this repository's production lines — swift (110,362 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 1% of this repository's production lines — swift (110,362 lines), python (7,164 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — X21 reached only 7% of this repository's production lines — swift (110,362 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — X25 reached only 7% of this repository's production lines — swift (110,362 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 — X29 reached only 1% of this repository's production lines — swift (110,362 lines), python (7,164 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Swift was read, and it logs through none: `print` and `NSLog` take one finished line, and os's `Logger` keeps each interpolated value as its own argument, so an assembled message there loses nothing the API could have kept (as with log4net in C#). Calls through swift-log (`import Logging`) and `os_log` calls would be judged.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 9 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
ED1 · Handler temporal coupling · Blocking wait inside a handler · ×1
  • Blocking wait inside a handler: VectorStore.onReader Sources/OmniKit/VectorStore.swift:5459 — `VectorStore.onReader` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler.
Serious — 1227 finding(s)
D10 · Test Quality · No assertions · ×59
  • No assertions: testNanoWeightsAreTheOnesBuilt Tests/OmniKitTests/ANEProgramTests.swift:23 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSmallWeightsAreTheOnesBuilt Tests/OmniKitTests/ANEProgramTests.swift:24 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testTheWalkTerminatesOnAFolderWithNoChildren Tests/OmniKitTests/BrowseReaderTests.swift:312 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testEveryMutationShapeKeepsCoverageConsistent Tests/OmniKitTests/CoverageCRUDTests.swift:88 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testFolderDeleteAgreesWithSQLOnCombiningMarks Tests/OmniKitTests/CoverageCRUDTests.swift:562 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSymlinksAreNotFollowed Tests/OmniKitTests/CrawlerParityTests.swift:101 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testRangeOnTheFullBase Tests/OmniKitTests/DateRangeFilterTests.swift:53 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testRangeOnTheQuantizedReplica Tests/OmniKitTests/DateRangeFilterTests.swift:54 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDeadDeltaRowIsUnreachableInFullMode Tests/OmniKitTests/DeltaTombstoneTests.swift:86 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDeadDeltaRowIsUnreachableInQuantMode Tests/OmniKitTests/DeltaTombstoneTests.swift:95 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testFolderExclusionSmall Tests/OmniKitTests/ExclusionFilterTests.swift:104 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testFolderExclusionLarge Tests/OmniKitTests/ExclusionFilterTests.swift:109 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testExtensionExclusionLarge Tests/OmniKitTests/ExclusionFilterTests.swift:114 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testBothOnTheOneBitTier Tests/OmniKitTests/ExclusionFilterTests.swift:119 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testExclusionInsideAScope Tests/OmniKitTests/ExclusionFilterTests.swift:164 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testKindFilterOnASmallSharedIndex Tests/OmniKitTests/FilteredSharedSearchTests.swift:113 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testKindFilterOnALargeSharedIndex Tests/OmniKitTests/FilteredSharedSearchTests.swift:119 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDateFilterOnASmallSharedIndex Tests/OmniKitTests/FilteredSharedSearchTests.swift:126 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDateFilterOnALargeSharedIndex Tests/OmniKitTests/FilteredSharedSearchTests.swift:131 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testKindFilterOnTheOneBitTier Tests/OmniKitTests/FilteredSharedSearchTests.swift:136 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDateFilterOnTheOneBitTier Tests/OmniKitTests/FilteredSharedSearchTests.swift:141 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDateFilterOnTheFourBitTier Tests/OmniKitTests/FilteredSharedSearchTests.swift:146 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testKindAndDateTogetherOnTheOneBitTier Tests/OmniKitTests/FilteredSharedSearchTests.swift:151 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testRandomWritesContentKeyed Tests/OmniKitTests/FolderCountTests.swift:61 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testRandomWritesRowKeyed Tests/OmniKitTests/FolderCountTests.swift:62 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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.
  • + 34 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×49
  • Hotspot: Sources/omni-verify/main.swift Sources/omni-verify/main.swift:61 — Sources/omni-verify/main.swift changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 2085 in main.swift.top-level code at line 61. 5 of those changes were fix/bug commits, and the other 78 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/omni-verify/main.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/OmniKit/Indexer.swift Sources/OmniKit/Indexer.swift:1118 — Sources/OmniKit/Indexer.swift changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 326 in Indexer.index at line 1118. 6 of those changes were fix/bug commits, and the other 62 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/OmniKit/Indexer.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/OmniKit/VectorStore.swift Sources/OmniKit/VectorStore.swift:13384 — Sources/OmniKit/VectorStore.swift changed 167 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in VectorStore.tryAdoptRowSidecarLocked at line 13384. 13 of those changes were fix/bug commits, and the other 154 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/OmniKit/VectorStore.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: App/PerfScript.swift App/PerfScript.swift:83 — App/PerfScript.swift changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 252 in PerfScript.perform at line 83. 4 of those changes were fix/bug commits, and the other 37 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/PerfScript.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: App/AppModel.swift App/AppModel.swift:8183 — App/AppModel.swift changed 140 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in AppModel.search at line 8183. 9 of those changes were fix/bug commits, and the other 131 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/AppModel.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: App/Serving/MCPAdapter.swift App/Serving/MCPAdapter.swift:349 — App/Serving/MCPAdapter.swift changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in MCPAdapter.callSearch at line 349. 4 of those changes were fix/bug commits, and the other 40 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/Serving/MCPAdapter.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/ocr-verify/main.swift Sources/ocr-verify/main.swift:83 — Sources/ocr-verify/main.swift changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 176 in main.swift.top-level code at line 83. 4 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/ocr-verify/main.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: App/SettingsView.swift App/SettingsView.swift:308 — App/SettingsView.swift changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ActivityTab.body at line 308. 3 of those changes were fix/bug commits, and the other 59 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/SettingsView.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: App/OCRSession.swift App/OCRSession.swift:1494 — App/OCRSession.swift changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in OCRSession.run at line 1494. 5 of those changes were fix/bug commits, and the other 43 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/OCRSession.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: App/ContentView.swift App/ContentView.swift:64 — App/ContentView.swift changed 70 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in ContentView.body at line 64. 5 of those changes were fix/bug commits, and the other 65 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/ContentView.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: App/Sidebar.swift App/Sidebar.swift:271 — App/Sidebar.swift changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in Sidebar.body at line 271. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/Sidebar.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/OmniKit/OCR/OCRBatched.swift Sources/OmniKit/OCR/OCRBatched.swift:189 — Sources/OmniKit/OCR/OCRBatched.swift changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in OCRModel.decodeContinuous at line 189. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/OmniKit/OCR/OCRBatched.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/OmniKit/OmniEngine.swift Sources/OmniKit/OmniEngine.swift:873 — Sources/OmniKit/OmniEngine.swift changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in OmniEngine.setComputeUnit at line 873. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/OmniKit/OmniEngine.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: App/OmniApp.swift App/OmniApp.swift:400 — App/OmniApp.swift changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in OmniCommands.body at line 400. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/OmniApp.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: App/OCRView.swift App/OCRView.swift:1133 — App/OCRView.swift changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DocumentScroll.scroller at line 1133. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/OCRView.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: App/ResultsList.swift App/ResultsList.swift:784 — App/ResultsList.swift changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in ResultRow.cell at line 784. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/ResultsList.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: App/FolderBrowser.swift App/FolderBrowser.swift:566 — App/FolderBrowser.swift changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in FolderBrowser.reload at line 566. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/FolderBrowser.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: App/Serving/SchemaAdapters.swift App/Serving/SchemaAdapters.swift:778 — App/Serving/SchemaAdapters.swift changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in TagAdapter.handle at line 778. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/Serving/SchemaAdapters.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/omni-verify/Eval.swift Sources/omni-verify/Eval.swift:544 — Sources/omni-verify/Eval.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in EvalCommand.evaluate at line 544. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/omni-verify/Eval.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/mutbench/main.swift Sources/mutbench/main.swift:9 — Sources/mutbench/main.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 105 in main.swift.top-level code at line 9. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/mutbench/main.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/OmniKit/Passages.swift Sources/OmniKit/Passages.swift:418 — Sources/OmniKit/Passages.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in TextSlice.read at line 418. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/OmniKit/Passages.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: site/omni/index.html site/omni/index.html:830 — site/omni/index.html changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in index.html.renderTable at line 830. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- site/omni/index.html`: 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: App/Serving/ServingController.swift App/Serving/ServingController.swift:307 — App/Serving/ServingController.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in ServingController.startServer at line 307. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- App/Serving/ServingController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/OmniKit/FileCrawler.swift Sources/OmniKit/FileCrawler.swift:173 — Sources/OmniKit/FileCrawler.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in FileCrawler.walkBulk 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/OmniKit/FileCrawler.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Sources/OmniKit/Paper/PaperSuite.swift Sources/OmniKit/Paper/PaperSuite.swift:280 — Sources/OmniKit/Paper/PaperSuite.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in PaperSuite.run at line 280. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 22:09:49 -08:00' --until='2026-11-13 22:09:49 -08:00' --full-history --no-merges -- Sources/OmniKit/Paper/PaperSuite.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.
  • + 24 more in this group — see findings.md.
D10 · Test Quality · Skipped test · ×48
  • Skipped test: testHoldsAutomationModeOpen UITests/AutomationWindowUITests.swift:30 — Skipped — throws XCTSkip
  • Skipped test: testDraggingAResultDeliversTheFileAndNeverOffersMove UITests/FileDragUITests.swift:143 — Skipped — throws XCTSkip
  • Skipped test: testDraggingAGalleryCellDeliversTheFile UITests/FileDragUITests.swift:160 — Skipped — throws XCTSkip
  • Skipped test: testGrabbingASelectedResultDragsTheWholeSelection UITests/FileDragUITests.swift:172 — Skipped — throws XCTSkip
  • Skipped test: testOmniRefusesItsOwnDrag UITests/FileDragUITests.swift:187 — Skipped — throws XCTSkip
  • Skipped test: testADragFromARowsBlankAreaIsAMarquee UITests/FileDragUITests.swift:203 — Skipped — throws XCTSkip
  • Skipped test: testCommandCCopiesTheFilesWithTheirPathsAsText UITests/FileDragUITests.swift:220 — Skipped — throws XCTSkip
  • Skipped test: testOCRRunsWhileAnOldIndexMigrates UITests/MigrationChaosUITests.swift:183 — Skipped — throws XCTSkip
  • Skipped test: testAClickThatDriftsAFewPointsStillSelects UITests/ResultSelectionUITests.swift:115 — Skipped — throws XCTSkip
  • Skipped test: testTheFirstClickIntoAnInactiveWindowStillSelects UITests/ResultSelectionUITests.swift:163 — Skipped — throws XCTSkip
  • Skipped test: testClickingAResultSelectsIt UITests/ResultSelectionUITests.swift:189 — Skipped — throws XCTSkip
  • Skipped test: testSelectionSurvivesLiveResultRefreshes UITests/ResultSelectionUITests.swift:212 — Skipped — throws XCTSkip
  • Skipped test: testTranscriptSelectionBecomesTheNextQuery UITests/TranscribeHandoffUITests.swift:299 — Skipped — throws XCTSkip
  • Skipped test: testNeuralEngineModeReleasesTheGPUTowersAndKeepsTheSpace Tests/OmniKitTests/ANEModeTests.swift:34 — Skipped — throws XCTSkip
  • Skipped test: testEveryTextRouteInOneBatch Tests/OmniKitTests/ANEModeTests.swift:89 — Skipped — throws XCTSkip
  • Skipped test: testSwitchingUnderLoadNeverDropsAVector Tests/OmniKitTests/ANEModeTests.swift:112 — Skipped — throws XCTSkip
  • Skipped test: testVideoTowerParity Tests/OmniKitTests/AVEncoderTests.swift:42 — Skipped — throws XCTSkip
  • Skipped test: testVideoEndToEnd Tests/OmniKitTests/AVEncoderTests.swift:57 — Skipped — throws XCTSkip
  • Skipped test: testAudioEndToEnd Tests/OmniKitTests/AVEncoderTests.swift:76 — Skipped — throws XCTSkip
  • Skipped test: testAudioTowerParity Tests/OmniKitTests/AVEncoderTests.swift:89 — Skipped — throws XCTSkip
  • Skipped test: testAudioBatchParity Tests/OmniKitTests/AVEncoderTests.swift:107 — Skipped — throws XCTSkip
  • Skipped test: testFolderSwitchUnderContention Tests/OmniKitTests/BrowseReaderBenchTests.swift:17 — Skipped — throws XCTSkip
  • Skipped test: testASwitchToTheGPUDuringTheTowerReleaseLeavesTowers Tests/OmniKitTests/EngineStateTests.swift:12 — Skipped — throws XCTSkip
  • Skipped test: testASwitchRightAfterTheTextPhaseDoesNotStrandTheStoreOnTheCPU Tests/OmniKitTests/EngineStateTests.swift:169 — Skipped — throws XCTSkip
  • Skipped test: testARebuildThatDoesNotFinishLeavesNoStamp Tests/OmniKitTests/EngineStateTests.swift:192 — Skipped — throws XCTSkip
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×30
  • Duplicated block (5 lines × 2) App/OCRSession.swift:1995 — App/OCRSession.swift:1995-1999 | App/OCRSession.swift:2180-2184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/OCRSession.swift:1995` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) App/Sidebar.swift:936 — App/Sidebar.swift:936-940 | App/Sidebar.swift:993-997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/Sidebar.swift:936` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/OmniKit/OCR/OCRBatched.swift:715 — Sources/OmniKit/OCR/OCRBatched.swift:715-719 | Sources/OmniKit/OCR/OCRDocument.swift:153-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/OmniKit/OCR/OCRLanguage.swift:450 — Sources/OmniKit/OCR/OCRLanguage.swift:450-454 | Sources/OmniKit/OCR/OCRLanguage.swift:490-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Sources/OmniKit/Paper/PaperCorpus.swift:499 — Sources/OmniKit/Paper/PaperCorpus.swift:499-503 | Sources/omni-verify/main.swift:7425-7429 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Paper/PaperCorpus.swift:499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/OmniKit/VectorStore.swift:3931 — Sources/OmniKit/VectorStore.swift:3931-3935 | Sources/OmniKit/VectorStore.swift:3964-3968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:3931` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (5 lines × 2) Sources/OmniKit/VectorStore.swift:11344 — Sources/OmniKit/VectorStore.swift:11344-11348 | Sources/OmniKit/VectorStore.swift:18734-18738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:11344` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) Sources/OmniKit/VectorStore.swift:14011 — Sources/OmniKit/VectorStore.swift:14011-14015 | Sources/OmniKit/VectorStore.swift:14032-14036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:14011` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/omni-verify/main.swift:1031 — Sources/omni-verify/main.swift:1031-1035 | Sources/omni-verify/main.swift:1380-1384 — both copies are in the same file, so extract the 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) App/FolderBrowser.swift:317 — App/FolderBrowser.swift:317-327 | App/ResultsList.swift:306-310 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Sources/OmniKit/OmniAudioTower.swift:316 — Sources/OmniKit/OmniAudioTower.swift:316-320 | Sources/OmniKit/OmniVisionTower.swift:573-577 — 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) App/RecentsBrowser.swift:115 — App/RecentsBrowser.swift:115-119 | App/RecentsBrowser.swift:165-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/RecentsBrowser.swift:115` it begins part-way through the construct above it, so those 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) Sources/OmniKit/ANETextBackend.swift:235 — Sources/OmniKit/ANETextBackend.swift:235-239 | Sources/OmniKit/ANETextBackend.swift:264-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/ANETextBackend.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. 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 (5 lines × 2) Sources/OmniKit/Qwen3Backbone.swift:159 — Sources/OmniKit/Qwen3Backbone.swift:159-163 | Sources/OmniKit/Qwen3Backbone.swift:416-420 — both copies are in the same file, so extract the 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) Sources/OmniKit/Qwen3Backbone.swift:466 — Sources/OmniKit/Qwen3Backbone.swift:466-470 | Sources/OmniKit/Qwen3Backbone.swift:491-495 — both copies are in the same file, so extract the 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) Sources/OmniKit/VectorStore.swift:7863 — Sources/OmniKit/VectorStore.swift:7863-7867 | Sources/OmniKit/VectorStore.swift:8829-8833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:7863` 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) Sources/OmniKit/VectorStore.swift:11160 — Sources/OmniKit/VectorStore.swift:11160-11164 | Sources/OmniKit/VectorStore.swift:11178-11182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:11160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/mutbench/main.swift:353 — Sources/mutbench/main.swift:353-357 | Sources/mutbench/main.swift:407-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Sources/ocr-verify/main.swift:272 — Sources/ocr-verify/main.swift:272-276 | Sources/ocr-verify/main.swift:285-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/ocr-verify/main.swift:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/omni-verify/main.swift:1729 — Sources/omni-verify/main.swift:1729-1733 | Sources/omni-verify/main.swift:1824-1828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/omni-verify/main.swift:1821` calls `Int` and `Sources/omni-verify/main.swift:1727` 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) Sources/omni-verify/main.swift:2610 — Sources/omni-verify/main.swift:2610-2614 | Sources/omni-verify/main.swift:2685-2689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (5 lines × 2) Sources/omni-verify/main.swift:2847 — Sources/omni-verify/main.swift:2847-2851 | Sources/omni-verify/main.swift:3289-3293 — both copies are in the same file, so extract the 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) Sources/omni-verify/main.swift:2853 — Sources/omni-verify/main.swift:2853-2857 | Sources/omni-verify/main.swift:3294-3298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:2853` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Sources/omni-verify/main.swift:4674 — Sources/omni-verify/main.swift:4674-4678 | Sources/omni-verify/main.swift:4857-4861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/omni-verify/main.swift:4680` calls `mix`, `UInt64` and `Sources/omni-verify/main.swift:4862` 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) Sources/omni-verify/main.swift:6323 — Sources/omni-verify/main.swift:6323-6327 | Sources/omni-verify/main.swift:6481-6485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:6323` it begins part-way through the construct above it, so those 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.
  • + 5 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×26
  • FileTooLong: OmniKit/VectorStore.swift Sources/OmniKit/VectorStore.swift — FileTooLong — 9513 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 9013 over it, 19.03× 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: omni-verify/main.swift Sources/omni-verify/main.swift — FileTooLong — 7383 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6883 over it, 14.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: App/AppModel.swift App/AppModel.swift — FileTooLong — 5231 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: AppModel (254-9656). The bar is 500 significant lines; this is 4731 over it, 10.46× 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: OmniKit/Indexer.swift Sources/OmniKit/Indexer.swift — FileTooLong — 3112 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Indexer (299-5456). The bar is 500 significant lines; this is 2612 over it, 6.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: App/OCRSession.swift App/OCRSession.swift — FileTooLong — 1251 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: OCRSession (26-2246). The bar is 500 significant lines; this is 751 over it, 2.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Serving/MCPAdapter.swift App/Serving/MCPAdapter.swift — FileTooLong — 1164 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: MCPAdapter (21-1786). The bar is 500 significant lines; this is 664 over it, 2.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: App/SettingsView.swift App/SettingsView.swift — FileTooLong — 1050 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 550 over it, 2.10× 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: OmniKit/OmniEngine.swift Sources/OmniKit/OmniEngine.swift — FileTooLong — 999 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: OmniEngine (297-1959). The bar is 500 significant lines; this is 499 over it, 2.00× 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: OmniKit/ScreenHistory.swift Sources/OmniKit/ScreenHistory.swift — FileTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ScreenHistory (28-1489). The bar is 500 significant lines; this is 449 over it, 1.90× 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: App/OCRView.swift App/OCRView.swift — FileTooLong — 928 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 428 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: Paper/BenchCases.swift Sources/OmniKit/Paper/BenchCases.swift — FileTooLong — 867 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: BenchCases (103-1169). The bar is 500 significant lines; this is 367 over it, 1.73× 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: omni-verify/ShotBench.swift Sources/omni-verify/ShotBench.swift — FileTooLong — 794 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ShotBench (20-1045). The bar is 500 significant lines; this is 294 over it, 1.59× 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: App/Sidebar.swift App/Sidebar.swift — FileTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 280 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: App/ResultsList.swift App/ResultsList.swift — FileTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 267 over it, 1.53× 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: Paper/PaperCasesStore.swift Sources/OmniKit/Paper/PaperCasesStore.swift — FileTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: PaperCasesStore (37-1052). The bar is 500 significant lines; this is 231 over it, 1.46× 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: App/OmniApp.swift App/OmniApp.swift — FileTooLong — 691 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 191 over it, 1.38× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: App/ScreenTimeline.swift App/ScreenTimeline.swift — FileTooLong — 679 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 179 over it, 1.36× 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: ocr-verify/main.swift Sources/ocr-verify/main.swift — FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 159 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: OmniLink/LinkNode.swift Sources/OmniLink/LinkNode.swift — FileTooLong — 657 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: LinkNode (27-863). The bar is 500 significant lines; this is 157 over it, 1.31× 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: App/PerfScript.swift App/PerfScript.swift — FileTooLong — 629 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: PerfScript (21-634). 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: App/ContentView.swift App/ContentView.swift — FileTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 110 over it, 1.22× 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: omni-verify/Eval.swift Sources/omni-verify/Eval.swift — FileTooLong — 570 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: EvalCommand (82-776). The bar is 500 significant lines; this is 70 over it, 1.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: OCR/OCRBatched.swift Sources/OmniKit/OCR/OCRBatched.swift — FileTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 63 over it, 1.13× 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: OCR/OCRLanguage.swift Sources/OmniKit/OCR/OCRLanguage.swift — FileTooLong — 537 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 37 over it, 1.07× 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: Serving/SchemaAdapters.swift App/Serving/SchemaAdapters.swift — FileTooLong — 513 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 13 over it, 1.03× 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.
  • + 1 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×22
  • MethodTooLong: Indexer.index Sources/OmniKit/Indexer.swift:1118 — MethodTooLong — index runs 754 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 654 over it, 7.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: PerfScript.perform App/PerfScript.swift:83 — MethodTooLong — perform runs 423 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 323 over it, 4.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: OCRModel.decodeContinuous Sources/OmniKit/OCR/OCRBatched.swift:189 — MethodTooLong — decodeContinuous runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Indexer.update Sources/OmniKit/Indexer.swift:3856 — MethodTooLong — update runs 214 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppModel.bootstrap App/AppModel.swift:5838 — MethodTooLong — bootstrap runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× 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: OCRSession.run App/OCRSession.swift:1494 — MethodTooLong — run 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: OmniCommands.body App/OmniApp.swift:400 — MethodTooLong — body 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: MCPAdapter.callSearch App/Serving/MCPAdapter.swift:349 — MethodTooLong — callSearch runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EvalCommand.evaluate Sources/omni-verify/Eval.swift:544 — MethodTooLong — evaluate runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× 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: Indexer.decodeContent Sources/OmniKit/Indexer.swift:4482 — MethodTooLong — decodeContent runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppModel.search App/AppModel.swift:8183 — MethodTooLong — search runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ShotBench.run Sources/omni-verify/ShotBench.swift:895 — MethodTooLong — run runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ActivityTab.body App/SettingsView.swift:308 — MethodTooLong — body runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PerformanceTab.body App/SettingsView.swift:802 — MethodTooLong — body runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OCRModel.decodePrepared Sources/OmniKit/OCR/OCRSpeculative.swift:118 — MethodTooLong — decodePrepared runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ScreenHistory.takeInStills Sources/OmniKit/ScreenHistory.swift:1160 — MethodTooLong — takeInStills runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× 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: OCRModel.decodeGroup Sources/OmniKit/OCR/OCRBatched.swift:558 — MethodTooLong — decodeGroup runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× 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: IndexTab.body App/SettingsView.swift:1251 — MethodTooLong — body runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Indexer.recoverChunkTexts Sources/OmniKit/Indexer.swift:621 — MethodTooLong — recoverChunkTexts runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ProjectionEngine.project Sources/OmniKit/ProjectionEngine.swift:64 — MethodTooLong — project runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BitScanBench.run Sources/omni-verify/BitScanBench.swift:17 — MethodTooLong — run runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× 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: ChatOCRAdapter.handle App/Serving/OCRAdapters.swift:54 — MethodTooLong — handle runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×19
  • Duplicated block (6 lines × 2) Sources/OmniKit/Indexer.swift:1983 — Sources/OmniKit/Indexer.swift:1983-1988 | Sources/OmniKit/Indexer.swift:4090-4095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Indexer.swift:1983` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) Sources/OmniKit/OCR/OCRLanguage.swift:895 — Sources/OmniKit/OCR/OCRLanguage.swift:895-900 | Sources/OmniKit/OCR/OCRLanguage.swift:912-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 `Sources/OmniKit/OCR/OCRLanguage.swift:895` 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) Sources/OmniKit/Paper/PaperCaseCatalog.swift:408 — Sources/OmniKit/Paper/PaperCaseCatalog.swift:408-414 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:589-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Paper/PaperCaseCatalog.swift:408` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/OmniKit/VectorStore.swift:8782 — Sources/OmniKit/VectorStore.swift:8782-8787 | Sources/OmniKit/VectorStore.swift:8800-8805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:8782` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) Sources/OmniKit/VectorStore.swift:12891 — Sources/OmniKit/VectorStore.swift:12891-12896 | Sources/OmniKit/VectorStore.swift:13051-13056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:12891` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/OmniKit/VectorStore.swift:18741 — Sources/OmniKit/VectorStore.swift:18741-18746 | Sources/OmniKit/VectorStore.swift:18751-18756 — both copies are in the same file, so extract the 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 (6 lines × 2) Sources/omni-verify/main.swift:3720 — Sources/omni-verify/main.swift:3720-3730 | Sources/omni-verify/main.swift:5404-5409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:3720` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/omni-verify/main.swift:7937 — Sources/omni-verify/main.swift:7937-7942 | Sources/omni-verify/main.swift:8208-8213 — both copies are in the same file, so extract the 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 (6 lines × 2) Sources/omni-verify/main.swift:9247 — Sources/omni-verify/main.swift:9247-9252 | Sources/omni-verify/main.swift:9261-9266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) Sources/opentime/main.swift:90 — Sources/opentime/main.swift:90-100 | Sources/opentime/main.swift:115-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/opentime/main.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 (6 lines × 2) App/Design.swift:183 — App/Design.swift:183-188 | Sources/omni-verify/main.swift:8782-8787 — 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 `App/Design.swift:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/omni-verify/main.swift:8859 — Sources/omni-verify/main.swift:8859-8864 | Sources/omni-verify/main.swift:8878-8883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:8859` it begins part-way through the construct above it, so those exact lines 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) App/PerfScript.swift:199 — App/PerfScript.swift:199-204 | App/PerfScript.swift:229-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/PerfScript.swift:199` 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) Sources/OmniKit/Paper/PaperCaseCatalog.swift:644 — Sources/OmniKit/Paper/PaperCaseCatalog.swift:644-649 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:691-696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Paper/PaperCaseCatalog.swift:644` 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 (6 lines × 2) Sources/OmniKit/VectorStore.swift:6207 — Sources/OmniKit/VectorStore.swift:6207-6212 | Sources/OmniKit/VectorStore.swift:6380-6385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) Sources/ocr-verify/main.swift:296 — Sources/ocr-verify/main.swift:296-301 | Sources/ocr-verify/main.swift:328-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/ocr-verify/main.swift:296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Sources/omni-verify/ANEQuery.swift:484 — Sources/omni-verify/ANEQuery.swift:484-489 | Sources/omni-verify/ANEQuery.swift:552-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/ANEQuery.swift:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/omni-verify/ANEQuery.swift:490` calls `random` and `Sources/omni-verify/ANEQuery.swift:559` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) Sources/omni-verify/main.swift:8931 — Sources/omni-verify/main.swift:8931-8936 | Sources/omni-verify/main.swift:9452-9457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) Sources/omni-verify/main.swift:113 — Sources/omni-verify/main.swift:113-118 | Sources/omni-verify/main.swift:10329-10334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×16
  • Edited copy of a member (4 corresponding lines) App/ResultsList.swift:654 — App/ResultsList.swift:654-658 | App/ResultsList.swift:662-665 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/OmniKit/Paper/BenchTable.swift:33 — Sources/OmniKit/Paper/BenchTable.swift:33-36 | Sources/OmniKit/Paper/BenchTable.swift:37-40 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/OmniKit/PathTable.swift:82 — Sources/OmniKit/PathTable.swift:82-85 | Sources/OmniKit/PathTable.swift:131-134 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/OmniKit/OmniAudioEncoder.swift:24 — Sources/OmniKit/OmniAudioEncoder.swift:24-27 | Sources/OmniKit/OmniImageEncoder.swift:51-54 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) App/OCRSession.swift:489 — App/OCRSession.swift:489-492 | App/OCRSession.swift:494-497 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/OmniKit/ExtractionQuarantine.swift:133 — Sources/OmniKit/ExtractionQuarantine.swift:133-136 | Sources/OmniKit/StreamCursors.swift:70-73 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) App/PaperResultSheet.swift:192 — App/PaperResultSheet.swift:192-195 | Sources/OmniKit/Paper/PaperReport.swift:679-682 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) App/Sidebar.swift:738 — App/Sidebar.swift:738-741 | App/Sidebar.swift:744-748 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) App/FolderBrowser.swift:310 — App/FolderBrowser.swift:310-313 | App/RecentsBrowser.swift:206-209 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) App/ProfilingService.swift:153 — App/ProfilingService.swift:153-156 | App/OCRSession.swift:764-767 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) App/AppModel.swift:6737 — App/AppModel.swift:6737-6740 | Sources/OmniKit/RootScope.swift:84-87 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/OmniKit/HardwareProfiler.swift:58 — Sources/OmniKit/HardwareProfiler.swift:58-61 | Sources/OmniKit/Paper/SystemProbe.swift:442-445 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/OmniKit/ModelDownloader.swift:250 — Sources/OmniKit/ModelDownloader.swift:250-253 | Sources/OmniKit/OCR/OCRModelDownloader.swift:135-140 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Sources/OmniKit/ModelDownloader.swift:76 — Sources/OmniKit/ModelDownloader.swift:76-79 | Sources/OmniKit/OCR/OCRModelDownloader.swift:38-41 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Tools/video/launch/render.py:60 — Tools/video/launch/render.py:60-63 | Tools/video/linked/render.py:62-65 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Tools/video/launch/render.py:99 — Tools/video/launch/render.py:99-102 | Tools/video/linked/render.py:101-104 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×16
  • Swallowed exception (caught, then discarded) worker/src/index.ts:562 — `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) Sources/omni-verify/main.swift:1252 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/omni-verify/main.swift:1256 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/omni-verify/main.swift:1266 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniLink/LinkIdentity.swift:96 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniKit/Indexer.swift:2737 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniKit/Indexer.swift:2884 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniKit/Indexer.swift:3166 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniKit/Indexer.swift:4767 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniKit/OmniTagger.swift:184 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniKit/ScreenHistory.swift:922 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniKit/ScreenText.swift:25 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Sources/OmniCLI/main.swift:283 — `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) App/AppModel.swift:7785 — `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) App/Updater.swift:176 — `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) App/Link/RemoteFiles.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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×14
  • Duplicated block (7 lines × 2) App/FolderBrowser.swift:245 — App/FolderBrowser.swift:245-255 | App/PhotoSourceBrowser.swift:151-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `App/FolderBrowser.swift:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) App/PaperResultSheet.swift:121 — App/PaperResultSheet.swift:121-127 | App/Serving/ServingTab.swift:478-484 — 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 `App/PaperResultSheet.swift:121` it begins part-way through the construct above it, so those 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, `App/PaperResultSheet.swift:130` calls `footer` and `App/Serving/ServingTab.swift:485` 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) Sources/OmniKit/ANETextBackend.swift:329 — Sources/OmniKit/ANETextBackend.swift:329-335 | Sources/OmniKit/ANETextBackend.swift:374-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 `Sources/OmniKit/ANETextBackend.swift:329` 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) Sources/OmniKit/VectorStore.swift:11510 — Sources/OmniKit/VectorStore.swift:11510-11516 | Sources/OmniKit/VectorStore.swift:11569-11575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) Sources/omni-verify/main.swift:3900 — Sources/omni-verify/main.swift:3900-3910 | Sources/omni-verify/main.swift:4484-4490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:3900` it begins part-way through the construct above it, so those exact lines 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) App/Serving/MCPAdapter.swift:937 — App/Serving/MCPAdapter.swift:937-943 | App/Serving/MCPAdapter.swift:1087-1093 — both copies are in the same file, so extract the 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 (7 lines × 2) App/AppModel.swift:4643 — App/AppModel.swift:4643-4649 | App/AppModel.swift:4667-4673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/AppModel.swift:4643` 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) App/Serving/SchemaAdapters.swift:781 — App/Serving/SchemaAdapters.swift:781-787 | App/Serving/SchemaAdapters.swift:788-794 — both copies are in the same file, so extract the 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 (7 lines × 2) Sources/OmniKit/LexicalIndex.swift:278 — Sources/OmniKit/LexicalIndex.swift:278-284 | Sources/OmniKit/LexicalIndex.swift:293-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/LexicalIndex.swift:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) Sources/OmniKit/VectorStore.swift:14724 — Sources/OmniKit/VectorStore.swift:14724-14730 | Sources/OmniKit/VectorStore.swift:14734-14740 — both copies are in the same file, so extract the 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) Sources/OmniKit/Indexer.swift:2197 — Sources/OmniKit/Indexer.swift:2197-2203 | Sources/OmniKit/Indexer.swift:4145-4151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Indexer.swift:2197` 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 (7 lines × 2) Sources/omni-verify/ANEQuery.swift:146 — Sources/omni-verify/ANEQuery.swift:146-152 | Sources/omni-verify/ANEQuery.swift:299-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/ANEQuery.swift:146` it begins part-way through the construct above it, so those exact lines 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) Tools/gen_image_fixtures.py:170 — Tools/gen_image_fixtures.py:170-176 | Tools/gen_video_fixtures.py:209-215 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) Tools/ane/build_text_blocks.py:30 — Tools/ane/build_text_blocks.py:30-36 | Tools/ane/build_vision.py:36-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×13
  • Duplicated block (8 lines × 2) Sources/OmniKit/OCR/OCRResize.swift:71 — Sources/OmniKit/OCR/OCRResize.swift:71-78 | Sources/OmniKit/OCR/OCRResize.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 `Sources/OmniKit/OCR/OCRResize.swift:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/OmniKit/Paper/SystemProbe.swift:378 — Sources/OmniKit/Paper/SystemProbe.swift:378-385 | Sources/OmniKit/Paper/SystemProbe.swift:402-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Paper/SystemProbe.swift:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) Sources/OmniKit/Passages.swift:432 — Sources/OmniKit/Passages.swift:432-439 | Sources/OmniKit/Passages.swift:477-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Passages.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) Sources/OmniKit/VectorStore.swift:17809 — Sources/OmniKit/VectorStore.swift:17809-17816 | Sources/OmniKit/VectorStore.swift:17830-17837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:17809` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/omni-verify/main.swift:3818 — Sources/omni-verify/main.swift:3818-3827 | Sources/omni-verify/main.swift:7042-7049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:3818` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/omni-verify/main.swift:6105 — Sources/omni-verify/main.swift:6105-6112 | Sources/omni-verify/main.swift:6209-6216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:6105` it begins part-way through the construct above it, so those exact lines 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) App/Sidebar.swift:1161 — App/Sidebar.swift:1161-1168 | App/Sidebar.swift:1336-1343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/Sidebar.swift:1336` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Sources/OmniKit/ANEAudioBackend.swift:25 — Sources/OmniKit/ANEAudioBackend.swift:25-32 | Sources/OmniKit/ANEVisionBackend.swift:28-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Sources/OmniKit/HardwareProfiler.swift:63 — Sources/OmniKit/HardwareProfiler.swift:63-70 | Sources/OmniKit/Paper/SystemProbe.swift:447-454 — 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) Sources/omni-verify/main.swift:2829 — Sources/omni-verify/main.swift:2829-2836 | Sources/omni-verify/main.swift:2879-2886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) Sources/OmniKit/EnrichLedger.swift:84 — Sources/OmniKit/EnrichLedger.swift:84-91 | Sources/OmniKit/IDIndex.swift:74-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) Sources/omni-verify/ShotBench.swift:281 — Sources/omni-verify/ShotBench.swift:281-288 | Sources/omni-verify/ShotBench.swift:721-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/ShotBench.swift:281` 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) Tools/video/launch/render.py:50 — Tools/video/launch/render.py:50-57 | Tools/video/linked/render.py:52-59 — `Tools/video/launch/render.py` and `Tools/video/linked/render.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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.
D3 · God Classes · ClassTooLong · ×12
  • ClassTooLong: AppModel App/AppModel.swift:252 — ClassTooLong — 4997 significant lines (blank, comment-only and punctuation-only lines excluded), 396 methods. The bar is 400 significant lines; this is 4597 over it, 12.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: Indexer Sources/OmniKit/Indexer.swift:299 — ClassTooLong — 2949 significant lines (blank, comment-only and punctuation-only lines excluded), 109 methods. The bar is 400 significant lines; this is 2549 over it, 7.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: OCRSession App/OCRSession.swift:24 — ClassTooLong — 1201 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 400 significant lines; this is 801 over it, 3.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MCPAdapter App/Serving/MCPAdapter.swift:21 — ClassTooLong — 1158 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 758 over it, 2.90× 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: ScreenHistory Sources/OmniKit/ScreenHistory.swift:28 — ClassTooLong — 936 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 536 over it, 2.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: OmniEngine Sources/OmniKit/OmniEngine.swift:297 — ClassTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 492 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BenchCases Sources/OmniKit/Paper/BenchCases.swift:103 — ClassTooLong — 785 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 385 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: ShotBench Sources/omni-verify/ShotBench.swift:20 — ClassTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 384 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: PaperCasesStore Sources/OmniKit/Paper/PaperCasesStore.swift:37 — ClassTooLong — 649 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 249 over it, 1.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LinkNode Sources/OmniLink/LinkNode.swift:27 — ClassTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 179 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: PerfScript App/PerfScript.swift:20 — ClassTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 126 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: EvalCommand Sources/omni-verify/Eval.swift:82 — ClassTooLong — 525 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 125 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×11
  • Duplicated block (10 lines × 2) Sources/OmniKit/MigrationV5Runner.swift:71 — Sources/OmniKit/MigrationV5Runner.swift:71-80 | Sources/OmniKit/MigrationV5Runner.swift:203-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/MigrationV5Runner.swift:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) Sources/OmniKit/OCR/OCRPreprocess.swift:134 — Sources/OmniKit/OCR/OCRPreprocess.swift:134-143 | Sources/OmniKit/OCR/OCRPreprocess.swift:162-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/OCR/OCRPreprocess.swift:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/OmniKit/VectorStore.swift:9125 — Sources/OmniKit/VectorStore.swift:9125-9134 | Sources/OmniKit/VectorStore.swift:9189-9198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:9125` 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) Sources/mutbench/main.swift:34 — Sources/mutbench/main.swift:34-43 | Sources/opentime/main.swift:48-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) Sources/omni-verify/main.swift:3457 — Sources/omni-verify/main.swift:3457-3466 | Sources/omni-verify/main.swift:6602-6617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:3457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/omni-verify/main.swift:5483 — Sources/omni-verify/main.swift:5483-5492 | Sources/omni-verify/main.swift:7161-7172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:5483` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/OmniKit/OmniAudioTower.swift:258 — Sources/OmniKit/OmniAudioTower.swift:258-267 | Sources/OmniKit/OmniVisionTower.swift:410-419 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/OmniAudioTower.swift:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/omni-verify/ANEQuery.swift:57 — Sources/omni-verify/ANEQuery.swift:57-66 | Sources/omni-verify/ANEQuery.swift:120-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/ANEQuery.swift:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Sources/omni-verify/ShotBench.swift:325 — Sources/omni-verify/ShotBench.swift:325-334 | Sources/omni-verify/ShotBench.swift:732-741 — both copies are in the same file, so extract the 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) Sources/OmniKit/VectorStore.swift:6717 — Sources/OmniKit/VectorStore.swift:6717-6726 | Sources/OmniKit/VectorStore.swift:7247-7256 — both copies are in the same file, so extract the 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) Sources/omni-verify/main.swift:6123 — Sources/omni-verify/main.swift:6123-6132 | Sources/omni-verify/main.swift:6181-6190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:6123` 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.
D3 · God Classes · TooManyMethods · ×10
  • TooManyMethods: VectorStore Sources/OmniKit/VectorStore.swift:771 — TooManyMethods — 450 methods. The bar is 30 methods; this is 420 over it, 15.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppModel App/AppModel.swift:252 — TooManyMethods — 396 methods, declared across 3 files: App/AppModel.swift (376), Link/AppModel+Link.swift (16), App/PaperBenchmark.swift (4). The bar is 30 methods; this is 366 over it, 13.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Indexer Sources/OmniKit/Indexer.swift:299 — TooManyMethods — 109 methods. The bar is 30 methods; this is 79 over it, 3.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OCRSession App/OCRSession.swift:24 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× 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: ScreenHistory Sources/OmniKit/ScreenHistory.swift:28 — TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OmniEngine Sources/OmniKit/OmniEngine.swift:297 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LinkNode Sources/OmniLink/LinkNode.swift:27 — 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: LinkController App/Link/LinkController.swift:14 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaperCorpus Sources/OmniKit/Paper/PaperCorpus.swift:99 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaperReport Sources/OmniKit/Paper/PaperReport.swift:142 — 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.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×10
  • Edited copy of a member (6 corresponding lines) Sources/OmniKit/Qwen3Backbone.swift:465 — Sources/OmniKit/Qwen3Backbone.swift:465-470 | Sources/OmniKit/Qwen3Backbone.swift:490-495 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/OmniKit/ChunkKey.swift:86 — Sources/OmniKit/ChunkKey.swift:86-93 | Sources/OmniKit/ChunkKey.swift:97-102 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/OmniKit/OmniEngine.swift:1881 — Sources/OmniKit/OmniEngine.swift:1881-1886 | Sources/OmniKit/OmniEngine.swift:1888-1894 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) App/PhotoActions.swift:28 — App/PhotoActions.swift:28-33 | App/PhotoActions.swift:36-41 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/OmniKit/OCR/OCRLanguage.swift:742 — Sources/OmniKit/OCR/OCRLanguage.swift:742-747 | Sources/OmniKit/OCR/OCRLanguage.swift:752-757 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Sources/OmniKit/OCR/OCRLanguage.swift:647 — Sources/OmniKit/OCR/OCRLanguage.swift:647-653 | Sources/OmniKit/OCR/OCRLanguage.swift:679-684 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) App/Link/LinkResponder.swift:288 — App/Link/LinkResponder.swift:288-293 | App/Serving/MCPAdapter.swift:1333-1340 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) App/Serving/SchemaAdapters.swift:15 — App/Serving/SchemaAdapters.swift:15-20 | App/Serving/SourcesAdapter.swift:214-219 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) App/ContentView.swift:1190 — App/ContentView.swift:1190-1197 | App/PerfScript.swift:628-633 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Tools/video/launch/core.py:52 — Tools/video/launch/core.py:52-57 | Tools/video/launch/core.py:61-68 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×8
  • Edited copy of a member (3 corresponding lines) Sources/OmniKit/Paper/PaperCasesStore.swift:1126 — Sources/OmniKit/Paper/PaperCasesStore.swift:1126-1129 | Sources/omni-verify/main.swift:34-36 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/OmniKit/ClipboardHistory.swift:208 — Sources/OmniKit/ClipboardHistory.swift:208-210 | Sources/OmniLink/LinkIdentity.swift:46-48 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) App/PaperResultSheet.swift:113 — App/PaperResultSheet.swift:113-115 | App/SettingsView.swift:150-152 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/OmniKit/ModelDownloader.swift:271 — Sources/OmniKit/ModelDownloader.swift:271-273 | Sources/OmniKit/OCR/OCRModelDownloader.swift:161-163 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/OmniKit/OCR/OCRModel.swift:442 — Sources/OmniKit/OCR/OCRModel.swift:442-444 | Sources/ocr-verify/main.swift:76-79 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) App/AppModel.swift:7809 — App/AppModel.swift:7809-7811 | Sources/OmniKit/StoreSchema.swift:79-81 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Sources/OmniKit/ModelDownloader.swift:71 — Sources/OmniKit/ModelDownloader.swift:71-73 | Sources/OmniKit/OCR/OCRModelDownloader.swift:129-131 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Tools/ane/build_small_text.py:55 — Tools/ane/build_small_text.py:55-57 | Tools/ane/extract_recipe.py:39-41 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D2 · Cognitive Complexity · main.swift.top-level code · ×7
  • main.swift.top-level code::arm (cognitive 62) Sources/omni-verify/main.swift:5166 — main.swift.top-level code::arm has cognitive complexity 62 (threshold 15). Drivers by points: loops 15 (25 pts), if/else 10 (20 pts), ternaries 9 (16 pts), match/switch 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. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code, main.swift.top-level code::vec, main.swift.top-level code::digest, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • main.swift.top-level code::loadedPhase (cognitive 29) Sources/omni-verify/main.swift:3978 — main.swift.top-level code::loadedPhase has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (14 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code, main.swift.top-level code::vec, main.swift.top-level code::digest, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • main.swift.top-level code::gatherTexts (cognitive 22) Sources/omni-verify/main.swift:3637 — main.swift.top-level code::gatherTexts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code, main.swift.top-level code::vec, main.swift.top-level code::digest, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • main.swift.top-level code::appendToFiles (cognitive 19) Sources/omni-verify/main.swift:7203 — main.swift.top-level code::appendToFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, 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. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code, main.swift.top-level code::vec, main.swift.top-level code::digest, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • main.swift.top-level code::digest (cognitive 17) Sources/omni-verify/main.swift:1764 — main.swift.top-level code::digest has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 7). 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. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code, main.swift.top-level code::vec, main.swift.top-level code::compare, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • main.swift.top-level code::vec (cognitive 16) Sources/omni-verify/main.swift:1735 — main.swift.top-level code::vec has cognitive complexity 16 (threshold 15). Drivers by points: loops 11 (12 pts), ternaries 3, if/else 1 (nesting depth added 1). 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. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code, main.swift.top-level code::digest, main.swift.top-level code::compare, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • main.swift.top-level code::compare (cognitive 16) Sources/omni-verify/main.swift:3133 — main.swift.top-level code::compare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (5 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. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code, main.swift.top-level code::vec, main.swift.top-level code::digest, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D3 · God Classes · FunctionTooLong · ×7
  • FunctionTooLong: main.swift.top-level code Sources/omni-verify/main.swift:61 — FunctionTooLong — top-level code runs 5961 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5861 over it, 59.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.swift.top-level code Sources/ocr-verify/main.swift:83 — FunctionTooLong — top-level code runs 565 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 465 over it, 5.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.
  • FunctionTooLong: main.swift.top-level code Sources/mutbench/main.swift:9 — FunctionTooLong — top-level code runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.swift.rowwindowcheckRun Sources/omni-verify/main.swift:1030 — FunctionTooLong — rowwindowcheckRun runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.swift.top-level code Sources/crawlbench/main.swift:15 — FunctionTooLong — top-level code runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.swift.churnbenchRun Sources/omni-verify/main.swift:128 — FunctionTooLong — churnbenchRun runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: main.swift.tombstonecheckRun Sources/omni-verify/main.swift:863 — FunctionTooLong — tombstonecheckRun runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×7
  • Edited copy of a member (7 corresponding lines) Sources/OmniKit/Indexer.swift:4789 — Sources/OmniKit/Indexer.swift:4789-4795 | Sources/OmniKit/Indexer.swift:5275-5281 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/OmniKit/HardwareProfiler.swift:31 — Sources/OmniKit/HardwareProfiler.swift:31-37 | Sources/OmniKit/Paper/SystemProbe.swift:230-236 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/OmniKit/OCR/OCRCache.swift:146 — Sources/OmniKit/OCR/OCRCache.swift:146-152 | Sources/OmniKit/OCR/OCRCache.swift:155-162 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Sources/OmniKit/OmniAudioEncoder.swift:14 — Sources/OmniKit/OmniAudioEncoder.swift:14-20 | Sources/OmniKit/OmniImageEncoder.swift:41-47 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) App/PaperBenchmark.swift:245 — App/PaperBenchmark.swift:245-251 | App/Updater.swift:420-426 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) App/ResultsList.swift:1355 — App/ResultsList.swift:1355-1361 | App/Sidebar.swift:22-28 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Tools/ane/build_nano_text.py:34 — Tools/ane/build_nano_text.py:34-41 | Tools/ane/build_small_text.py:35-41 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×7
  • Duplicated block (9 lines × 2) App/Serving/MCPAdapter.swift:925 — App/Serving/MCPAdapter.swift:925-933 | App/Serving/MCPAdapter.swift:1072-1080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/Serving/MCPAdapter.swift:925` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Sources/OmniKit/Indexer.swift:2123 — Sources/OmniKit/Indexer.swift:2123-2131 | Sources/OmniKit/Indexer.swift:2207-2215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Indexer.swift:2123` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) Sources/OmniKit/OmniAudioTower.swift:245 — Sources/OmniKit/OmniAudioTower.swift:245-253 | Sources/OmniKit/OmniVisionTower.swift:377-385 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/OmniAudioTower.swift:245` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Sources/OmniKit/VectorStore.swift:11030 — Sources/OmniKit/VectorStore.swift:11030-11038 | Sources/OmniKit/VectorStore.swift:11224-11232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:11030` it begins part-way through the construct above it, so those 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 (9 lines × 2) Sources/mutbench/main.swift:139 — Sources/mutbench/main.swift:139-147 | Sources/mutbench/main.swift:493-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/mutbench/main.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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) Sources/omni-verify/main.swift:7661 — Sources/omni-verify/main.swift:7661-7669 | Sources/omni-verify/main.swift:7677-7685 — both copies are in the same file, so extract the 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) Tools/video/launch/mix.py:9 — Tools/video/launch/mix.py:9-18 | Tools/video/linked/mix.py:9-17 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×6
  • Edited copy of a member (13 corresponding lines) Sources/OmniKit/FileExtractor.swift:260 — Sources/OmniKit/FileExtractor.swift:260-275 | Sources/OmniPages/main.swift:60-72 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/OmniKit/OmniImageEncoder.swift:261 — Sources/OmniKit/OmniImageEncoder.swift:261-275 | Sources/OmniKit/OmniTextEncoder.swift:46-58 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Sources/OmniKit/OCR/OCRLanguage.swift:888 — Sources/OmniKit/OCR/OCRLanguage.swift:888-900 | Sources/OmniKit/OCR/OCRLanguage.swift:906-920 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) App/Link/LinkViews.swift:227 — App/Link/LinkViews.swift:227-240 | App/PhotoSourceBrowser.swift:36-48 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) App/AppModel.swift:5753 — App/AppModel.swift:5753-5765 | App/AppModel.swift:5770-5782 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Tools/video/launch/vo.py:29 — Tools/video/launch/vo.py:29-41 | Tools/video/linked/vo.py:23-40 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×6
  • Duplicated block (11 lines × 2) App/PhotoSourceBrowser.swift:87 — App/PhotoSourceBrowser.swift:87-97 | App/RecentsBrowser.swift:99-109 — before extracting anything, compare `App/PhotoSourceBrowser.swift` and `App/RecentsBrowser.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 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 `App/PhotoSourceBrowser.swift:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Sources/OmniKit/OCR/OCRWeights.swift:119 — Sources/OmniKit/OCR/OCRWeights.swift:119-129 | Sources/OmniKit/OCR/OCRWeights.swift:136-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/OCR/OCRWeights.swift:119` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) Sources/OmniKit/VectorStore.swift:6289 — Sources/OmniKit/VectorStore.swift:6289-6299 | Sources/OmniKit/VectorStore.swift:6466-6476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:6289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) Sources/OmniKit/OCR/OCRModel.swift:398 — Sources/OmniKit/OCR/OCRModel.swift:398-408 | Sources/OmniKit/OCR/OCRSpeculative.swift:262-272 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/OCR/OCRSpeculative.swift:262` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Sources/OmniKit/VectorStore.swift:17325 — Sources/OmniKit/VectorStore.swift:17325-17335 | Sources/OmniKit/VectorStore.swift:17599-17609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:17325` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) Sources/omni-verify/main.swift:4716 — Sources/omni-verify/main.swift:4716-4726 | Sources/omni-verify/main.swift:5349-5359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:4716` 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×6
  • Sync-over-async blocking App/AppModel.swift:6498 — `moveDatabaseDir` is async and calls usleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking Tools/video/recwin.swift:9 — `top-level code` 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.
  • Sync-over-async blocking Sources/linktool/main.swift:26 — `top-level code` is async and calls usleep, .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.
  • Sync-over-async blocking Sources/omni-verify/ANEQuery.swift:397 — `run` is async and calls usleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking Sources/omni-verify/main.swift:7413 — `videosegcheckRun` is async and calls usleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking Sources/omni-verify/main.swift:61 — `top-level code` is async and calls usleep, Thread.sleep, .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.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×5
  • Edited copy of a member (9 corresponding lines) Sources/OmniKit/VectorStore.swift:11340 — Sources/OmniKit/VectorStore.swift:11340-11348 | Sources/OmniKit/VectorStore.swift:18730-18738 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/OmniKit/OmniEngine.swift:1370 — Sources/OmniKit/OmniEngine.swift:1370-1378 | Sources/OmniKit/OmniEngine.swift:1380-1388 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) App/MarkdownBlock.swift:155 — App/MarkdownBlock.swift:155-166 | App/MarkdownSource.swift:114-122 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Sources/OmniKit/BulkDirWalker.swift:275 — Sources/OmniKit/BulkDirWalker.swift:275-283 | Sources/OmniKit/Indexer.swift:2638-2646 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) App/OCRView.swift:1550 — App/OCRView.swift:1550-1558 | App/OCRView.swift:1628-1637 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×5
  • Edited copy of a member (5 corresponding lines) App/AppModel.swift:4394 — App/AppModel.swift:4394-4398 | App/AppModel.swift:8780-8784 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/OmniKit/ModelDownloader.swift:36 — Sources/OmniKit/ModelDownloader.swift:36-40 | Sources/OmniKit/OCR/OCRModelCatalog.swift:99-107 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/OmniKit/OCR/OCRModel.swift:352 — Sources/OmniKit/OCR/OCRModel.swift:352-357 | Sources/OmniKit/OCR/OCRSpeculative.swift:82-86 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/OmniKit/ContentChunker.swift:199 — Sources/OmniKit/ContentChunker.swift:199-203 | Sources/OmniKit/Indexer.swift:775-779 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Sources/OmniKit/Gzip.swift:67 — Sources/OmniKit/Gzip.swift:67-75 | Sources/OmniKit/Paper/PaperCorpus.swift:767-771 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D2 · Cognitive Complexity · Indexer.index · ×4
  • Indexer.index::updateTimeLeft (cognitive 28) Sources/OmniKit/Indexer.swift:1649 — Indexer.index::updateTimeLeft has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (7 pts), boolean chains 6, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (Indexer.index, Indexer.index::takeWave, Indexer.index::handleStream, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • Indexer.index::handleStream (cognitive 28) Sources/OmniKit/Indexer.swift:1832 — Indexer.index::handleStream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (Indexer.index, Indexer.index::takeWave, Indexer.index::updateTimeLeft, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • Indexer.index::flushImages (cognitive 25) Sources/OmniKit/Indexer.swift:2164 — Indexer.index::flushImages has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (6 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (Indexer.index, Indexer.index::takeWave, Indexer.index::updateTimeLeft, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • Indexer.index::takeWave (cognitive 19) Sources/OmniKit/Indexer.swift:1439 — Indexer.index::takeWave has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 6, loops 4 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (Indexer.index, Indexer.index::updateTimeLeft, Indexer.index::handleStream, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×4
  • Edited copy of a member (12 corresponding lines) Sources/OmniKit/ANETextBackend.swift:324 — Sources/OmniKit/ANETextBackend.swift:324-335 | Sources/OmniKit/ANETextBackend.swift:369-380 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/OmniKit/PathTable.swift:262 — Sources/OmniKit/PathTable.swift:262-274 | Sources/OmniKit/PathTable.swift:299-310 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Sources/OmniKit/VectorStore.swift:8024 — Sources/OmniKit/VectorStore.swift:8024-8035 | Sources/OmniKit/VectorStore.swift:8056-8067 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Tools/video/launch/music.py:22 — Tools/video/launch/music.py:22-33 | Tools/video/linked/music.py:22-33 — These two members are one piece of code written twice and then edited apart: 12 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.
D1 · Cyclomatic Complexity · Indexer.index · ×3
  • Indexer.index::handleStream (cyclomatic 22) Sources/OmniKit/Indexer.swift:1832 — Indexer.index::handleStream 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. This shape REPEATS in the file: 3 other methods here (Indexer.index, Indexer.index::updateTimeLeft, Indexer.index::flushImages) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • Indexer.index::updateTimeLeft (cyclomatic 21) Sources/OmniKit/Indexer.swift:1649 — Indexer.index::updateTimeLeft has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (Indexer.index, Indexer.index::handleStream, Indexer.index::flushImages) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • Indexer.index::flushImages (cyclomatic 16) Sources/OmniKit/Indexer.swift:2164 — Indexer.index::flushImages 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. This shape REPEATS in the file: 3 other methods here (Indexer.index, Indexer.index::updateTimeLeft, Indexer.index::handleStream) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) App/FolderBrowser.swift:184 — App/FolderBrowser.swift:184-306 | App/Link/LinkViews.swift:323-368 | App/PhotoSourceBrowser.swift:132-177 | App/RecentsBrowser.swift:142-184 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/OmniKit/OCR/OCRBatched.swift:133 — Sources/OmniKit/OCR/OCRBatched.swift:133-170 | Sources/OmniKit/OCR/OCRBatched.swift:189-555 | Sources/OmniKit/OCR/OCRBatched.swift:801-832 | Sources/OmniKit/OCR/OCRBatched.swift:842-896 — 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) Tools/gen_audio_fixtures.py:176 — Tools/gen_audio_fixtures.py:176-183 | Tools/gen_fixtures.py:43-48 | Tools/gen_image_fixtures.py:221-228 | Tools/gen_video_fixtures.py:236-243 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×3
  • Edited copy of a member (14 corresponding lines) Sources/OmniKit/OCR/OCRWeights.swift:114 — Sources/OmniKit/OCR/OCRWeights.swift:114-129 | Sources/OmniKit/OCR/OCRWeights.swift:133-146 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Sources/OmniKit/VectorStore.swift:17801 — Sources/OmniKit/VectorStore.swift:17801-17816 | Sources/OmniKit/VectorStore.swift:17824-17837 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Tools/gen_image_fixtures.py:110 — Tools/gen_image_fixtures.py:110-123 | Tools/gen_video_fixtures.py:139-155 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×3
  • Edited copy of a member (10 corresponding lines) App/AppModel.swift:4640 — App/AppModel.swift:4640-4649 | App/AppModel.swift:4664-4673 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/OmniKit/Paper/PaperCasesCompute.swift:646 — Sources/OmniKit/Paper/PaperCasesCompute.swift:646-655 | Sources/OmniKit/Paper/PaperCasesCompute.swift:659-668 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Sources/OmniKit/OmniAudioPreprocess.swift:409 — Sources/OmniKit/OmniAudioPreprocess.swift:409-418 | Sources/OmniKit/OmniAudioPreprocess.swift:420-429 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) Sources/OmniKit/VectorStore.swift:14723 — Sources/OmniKit/VectorStore.swift:14723-14730 | Sources/OmniKit/VectorStore.swift:14732-14741 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) App/Link/LinkController.swift:112 — App/Link/LinkController.swift:112-119 | App/Serving/ServingController.swift:196-203 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) App/SettingsView.swift:710 — App/SettingsView.swift:710-717 | App/AppModel.swift:2110-2117 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×3
  • Edited copy of a member (11 corresponding lines) Sources/OmniKit/VectorStore.swift:15798 — Sources/OmniKit/VectorStore.swift:15798-15808 | Sources/OmniKit/VectorStore.swift:15812-15826 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) App/OCRSession.swift:2013 — App/OCRSession.swift:2013-2026 | App/OCRSession.swift:2179-2189 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Tools/video/launch/film.py:702 — Tools/video/launch/film.py:702-713 | Tools/video/linked/film.py:471-481 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×3
  • Edited copy of a member (1 corresponding lines) Sources/OmniCLI/main.swift:24 — Sources/OmniCLI/main.swift:24-27 | Sources/linktool/main.swift:24-24 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) Tools/video/launch/core.py:23 — Tools/video/launch/core.py:23-23 | Tools/video/render.py:24-24 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) Tools/video/launch/core.py:27 — Tools/video/launch/core.py:27-27 | Tools/video/render.py:25-25 — These two members are one piece of code written twice and then edited apart: 1 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 · Duplicated block (9 lines × 3) · ×3
  • Duplicated block (9 lines × 3) Sources/OmniKit/VectorStore.swift:9130 — Sources/OmniKit/VectorStore.swift:9130-9138 | Sources/OmniKit/VectorStore.swift:9194-9202 | Sources/OmniKit/VectorStore.swift:13339-13347 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:9130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/OmniKit/VectorStore.swift:9203` calls `write` and `Sources/OmniKit/VectorStore.swift:9139` 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 × 3) Sources/omni-verify/main.swift:2668 — Sources/omni-verify/main.swift:2668-2683 | Sources/omni-verify/main.swift:5361-5369 | Sources/omni-verify/main.swift:9024-9035 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:2668` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) Sources/omni-verify/main.swift:7923 — Sources/omni-verify/main.swift:7923-7931 | Sources/omni-verify/main.swift:8534-8543 | Sources/omni-verify/main.swift:10159-10178 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:7923` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/omni-verify/main.swift:7920` calls `String`, `close` and `Sources/omni-verify/main.swift:10158` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) App/Design.swift:197 — App/Design.swift:197-209 | Sources/omni-verify/main.swift:8767-8779 — 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 (13 lines × 2) App/PhotoSourceBrowser.swift:194 — App/PhotoSourceBrowser.swift:194-206 | App/RecentsBrowser.swift:225-237 — before extracting anything, compare `App/PhotoSourceBrowser.swift` and `App/RecentsBrowser.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) Tools/video/launch/render.py:35 — Tools/video/launch/render.py:35-47 | Tools/video/linked/render.py:37-49 — `Tools/video/launch/render.py` and `Tools/video/linked/render.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×3
  • Edited copy of a member (2 corresponding lines) Tools/video/launch/film.py:12 — Tools/video/launch/film.py:12-13 | Tools/video/linked/film.py:22-23 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) Tools/video/launch/film.py:748 — Tools/video/launch/film.py:748-749 | Tools/video/linked/film.py:520-521 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) Tools/video/launch/timeline.py:34 — Tools/video/launch/timeline.py:34-35 | Tools/video/linked/clock.py:19-20 — These two members are one piece of code written twice and then edited apart: 2 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.
D1 · Cyclomatic Complexity · main.swift.top-level code · ×2
  • main.swift.top-level code::arm (cyclomatic 37) Sources/omni-verify/main.swift:5166 — main.swift.top-level code::arm has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (main.swift.top-level code, main.swift.top-level code::vec) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • main.swift.top-level code::vec (cyclomatic 16) Sources/omni-verify/main.swift:1735 — main.swift.top-level code::vec has cyclomatic complexity 16 (threshold 15). 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. This shape REPEATS in the file: 2 other methods here (main.swift.top-level code, main.swift.top-level code::arm) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D2 · Cognitive Complexity · OCRModel.transcribe (cognitive 16) · ×2
  • OCRModel.transcribe (cognitive 16) Sources/OmniKit/OCR/OCRModel.swift:365 — OCRModel.transcribe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, loops 2 (4 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.
  • OCRModel.transcribe (cognitive 16) Sources/OmniKit/OCR/OCRDocument.swift:149 — OCRModel.transcribe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: SettingsView.swift ↔ IndexSettings.swift App/SettingsView.swift:1 — `App/SettingsView.swift` and `Sources/OmniKit/IndexSettings.swift` change together 61% of the time (11 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `0d244ea3` Search results in columns; kind from the query vector; one ignore policy; `67b5ac58` Skip training-data folders, list them in Settings; `660a59ce` iCloud: index then remove download; full shortcuts list; Finder folde… — run `git show` on any of them.
  • Change coupling: AppModel.swift ↔ OmniImageEncoder.swift App/AppModel.swift:1 — `App/AppModel.swift` and `Sources/OmniKit/OmniImageEncoder.swift` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `58456920` History without a cap, fewer renders, and searches that wait less; `9186f7c7` A query no longer waits out the indexing hold; the engine keeps query…; `b8881357` feat(tags): on-device open-vocabulary tags for images, video, and scans — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) Sources/omni-verify/ANEQuery.swift:31 — Sources/omni-verify/ANEQuery.swift:31-66 | Sources/omni-verify/ANEQuery.swift:99-129 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) Tools/video/launch/render.py:66 — Tools/video/launch/render.py:66-96 | Tools/video/linked/render.py:68-98 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) Sources/OmniKit/Paper/PaperCorpus.swift:538 — Sources/OmniKit/Paper/PaperCorpus.swift:538-553 | Sources/OmniKit/Paper/PaperCorpus.swift:559-585 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Sources/OmniKit/Paper/SystemProbe.swift:377 — Sources/OmniKit/Paper/SystemProbe.swift:377-392 | Sources/OmniKit/Paper/SystemProbe.swift:401-416 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) Sources/OmniKit/OmniVideoPreprocess.swift:154 — Sources/OmniKit/OmniVideoPreprocess.swift:154-183 | Sources/OmniKit/OmniVisionPreprocess.swift:127-151 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) Sources/OmniKit/OCR/OCRVision.swift:116 — Sources/OmniKit/OCR/OCRVision.swift:116-148 | Sources/OmniKit/OCR/OCRVision.swift:378-402 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/OmniKit/Paper/SystemProbe.swift:196 — Sources/OmniKit/Paper/SystemProbe.swift:196-205 | Sources/OmniKit/Paper/SystemProbe.swift:253-262 | Sources/omni-verify/main.swift:112-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) Sources/OmniKit/VectorStore.swift:11332 — Sources/OmniKit/VectorStore.swift:11332-11338 | Sources/OmniKit/VectorStore.swift:18740-18746 | Sources/OmniKit/VectorStore.swift:18750-18756 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/OmniKit/OmniEngine.swift:1576 — Sources/OmniKit/OmniEngine.swift:1576-1580 | Sources/OmniKit/OmniEngine.swift:1822-1826 | Sources/OmniKit/OmniEngine.swift:1828-1832 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 5+ corresponding lines) Sources/OmniKit/OmniIgnore.swift:62 — Sources/OmniKit/OmniIgnore.swift:62-66 | Sources/OmniKit/PathTable.swift:536-540 | Sources/OmniKit/ScreenHistory.swift:1060-1064 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 3+ corresponding lines) App/AppModel.swift:684 — App/AppModel.swift:684-686 | App/Serving/MCPAdapter.swift:170-172 | Sources/OmniKit/Indexer.swift:5452-5455 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Tools/video/launch/core.py:91 — Tools/video/launch/core.py:91-95 | Tools/video/launch/film.py:48-54 | Tools/video/launch/film.py:63-65 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) Sources/omni-verify/main.swift:5088 — Sources/omni-verify/main.swift:5088-5110 | Sources/omni-verify/main.swift:5293-5311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:5088` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) Sources/OmniKit/VectorStore.swift:4907 — Sources/OmniKit/VectorStore.swift:4907-4925 | Sources/OmniKit/VectorStore.swift:14644-14662 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) Sources/OmniKit/OCR/OCRBatched.swift:439 — Sources/OmniKit/OCR/OCRBatched.swift:439-455 | Sources/OmniKit/OCR/OCRBatched.swift:631-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/OCR/OCRBatched.swift:439` it begins part-way through the construct above it, so those exact lines 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) Tools/video/launch/render.py:15 — Tools/video/launch/render.py:15-31 | Tools/video/linked/render.py:17-33 — `Tools/video/launch/render.py` and `Tools/video/linked/render.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) Sources/OmniKit/MigrationV5Runner.swift:76 — Sources/OmniKit/MigrationV5Runner.swift:76-82 | Sources/OmniKit/MigrationV5Runner.swift:208-214 | Sources/OmniKit/VectorStore.swift:17336-17342 — 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 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 (7 lines × 3) Sources/omni-verify/main.swift:621 — Sources/omni-verify/main.swift:621-627 | Sources/omni-verify/main.swift:672-678 | Sources/omni-verify/main.swift:817-823 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:621` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) Sources/omni-verify/main.swift:765 — Sources/omni-verify/main.swift:765-769 | Sources/omni-verify/main.swift:864-868 | Sources/omni-verify/main.swift:1481-1485 — 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 (5 lines × 3) Sources/OmniKit/ProjectionEngine.swift:356 — Sources/OmniKit/ProjectionEngine.swift:356-360 | Sources/OmniKit/ProjectionEngine.swift:361-365 | Sources/OmniKit/ProjectionEngine.swift:366-370 — 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.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: OmniKit — OmniKit: abstractness 0.01, instability 0.00, distance 0.99 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
  • Off the main sequence: OmniLink — OmniLink: abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: AppModel (LCOM4 13) App/AppModel.swift:252 — AppModel's methods fall into 13 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 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AppDelegate (LCOM4 6) App/OmniApp.swift:14 — AppDelegate's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×2
  • Process-global state is restored only on the happy path Sources/omni-verify/ANEQuery.swift:31 — `textBackend` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `k` environment variable (set at line 39, cleared at line 39) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Swift process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`Process.currentDirectoryURL`, `Process.environment`), or build absolute paths with `URL.appendingPathComponent`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every exit, thrown errors included.
  • Process-global state is restored only on the happy path Sources/omni-verify/ANEQuery.swift:99 — `onDevice` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `k` environment variable (set at line 107, cleared at line 107) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Swift process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`Process.currentDirectoryURL`, `Process.environment`), or build absolute paths with `URL.appendingPathComponent`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every exit, thrown errors included.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 1729) · ×1
  • main.swift.top-level code (cyclomatic 1729) Sources/omni-verify/main.swift:61 — main.swift.top-level code has cyclomatic complexity 1729 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (main.swift.top-level code::vec, main.swift.top-level code::arm) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · PerfScript.perform (cyclomatic 252) · ×1
  • PerfScript.perform (cyclomatic 252) App/PerfScript.swift:83 — PerfScript.perform has cyclomatic complexity 252 (threshold 15). Of this number, 248 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 176) · ×1
  • main.swift.top-level code (cyclomatic 176) Sources/ocr-verify/main.swift:83 — main.swift.top-level code has cyclomatic complexity 176 (threshold 15). Of this number, 168 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · Indexer.index (cyclomatic 156) · ×1
  • Indexer.index (cyclomatic 156) Sources/OmniKit/Indexer.swift:1118 — Indexer.index has cyclomatic complexity 156 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (Indexer.index::updateTimeLeft, Indexer.index::handleStream, Indexer.index::flushImages) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 105) · ×1
  • main.swift.top-level code (cyclomatic 105) Sources/mutbench/main.swift:9 — main.swift.top-level code has cyclomatic complexity 105 (threshold 15). Of this number, 91 points are the body's own statements and 14 belong to 8 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.
D1 · Cyclomatic Complexity · MCPAdapter.callSearch (cyclomatic 82) · ×1
  • MCPAdapter.callSearch (cyclomatic 82) App/Serving/MCPAdapter.swift:349 — MCPAdapter.callSearch has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.decodeContent (cyclomatic 79) · ×1
  • Indexer.decodeContent (cyclomatic 79) Sources/OmniKit/Indexer.swift:4482 — Indexer.decodeContent has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.tryAdoptRowSidecarLocked (cyclomatic 79) · ×1
  • VectorStore.tryAdoptRowSidecarLocked (cyclomatic 79) Sources/OmniKit/VectorStore.swift:13384 — VectorStore.tryAdoptRowSidecarLocked has cyclomatic complexity 79 (threshold 15). Of this number, 74 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OCRModel.decodeContinuous (cyclomatic 79) · ×1
  • OCRModel.decodeContinuous (cyclomatic 79) Sources/OmniKit/OCR/OCRBatched.swift:189 — OCRModel.decodeContinuous has cyclomatic complexity 79 (threshold 15). Of this number, 60 points are the body's own statements and 19 belong to 4 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.
D1 · Cyclomatic Complexity · VectorStore.tryAdoptQuantReplicaLocked (cyclomatic 72) · ×1
  • VectorStore.tryAdoptQuantReplicaLocked (cyclomatic 72) Sources/OmniKit/VectorStore.swift:9221 — VectorStore.tryAdoptQuantReplicaLocked has cyclomatic complexity 72 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Indexer.update (cyclomatic 68) · ×1
  • Indexer.update (cyclomatic 68) Sources/OmniKit/Indexer.swift:3856 — Indexer.update has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (Indexer.update::flushImagesU) 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.
D1 · Cyclomatic Complexity · VectorStore.reduceTopK (cyclomatic 67) · ×1
  • VectorStore.reduceTopK (cyclomatic 67) Sources/OmniKit/VectorStore.swift:8741 — VectorStore.reduceTopK has cyclomatic complexity 67 (threshold 15). Of this number, 58 points are the body's own statements and 9 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.
D1 · Cyclomatic Complexity · Indexer.recoverChunkTexts (cyclomatic 64) · ×1
  • Indexer.recoverChunkTexts (cyclomatic 64) Sources/OmniKit/Indexer.swift:621 — Indexer.recoverChunkTexts has cyclomatic complexity 64 (threshold 15). Of this number, 46 points are the body's own statements and 18 belong to 4 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.
D1 · Cyclomatic Complexity · Indexer.enrichOne (cyclomatic 62) · ×1
  • Indexer.enrichOne (cyclomatic 62) Sources/OmniKit/Indexer.swift:3296 — Indexer.enrichOne has cyclomatic complexity 62 (threshold 15). Of this number, 57 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScreenText.recognize (cyclomatic 61) · ×1
  • ScreenText.recognize (cyclomatic 61) Sources/OmniKit/ScreenText.swift:111 — ScreenText.recognize has cyclomatic complexity 61 (threshold 15). Of this number, 57 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.loadBySlotLocked (cyclomatic 60) · ×1
  • VectorStore.loadBySlotLocked (cyclomatic 60) Sources/OmniKit/VectorStore.swift:10752 — VectorStore.loadBySlotLocked has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OCRSession.run (cyclomatic 58) · ×1
  • OCRSession.run (cyclomatic 58) App/OCRSession.swift:1494 — OCRSession.run has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.loadIntoMemory (cyclomatic 57) · ×1
  • VectorStore.loadIntoMemory (cyclomatic 57) Sources/OmniKit/VectorStore.swift:15861 — VectorStore.loadIntoMemory has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.listMatching (cyclomatic 56) · ×1
  • VectorStore.listMatching (cyclomatic 56) Sources/OmniKit/VectorStore.swift:4586 — VectorStore.listMatching has cyclomatic complexity 56 (threshold 15). Of this number, 44 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.
D1 · Cyclomatic Complexity · VectorStore.rebuildBaseLocked (cyclomatic 56) · ×1
  • VectorStore.rebuildBaseLocked (cyclomatic 56) Sources/OmniKit/VectorStore.swift:14084 — VectorStore.rebuildBaseLocked has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvalCommand.evaluate (cyclomatic 56) · ×1
  • EvalCommand.evaluate (cyclomatic 56) Sources/omni-verify/Eval.swift:544 — EvalCommand.evaluate has cyclomatic complexity 56 (threshold 15). Of this number, 55 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TextSlice.read (cyclomatic 52) · ×1
  • TextSlice.read (cyclomatic 52) Sources/OmniKit/Passages.swift:418 — TextSlice.read has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.search (cyclomatic 52) · ×1
  • AppModel.search (cyclomatic 52) App/AppModel.swift:8183 — AppModel.search has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.init (cyclomatic 51) · ×1
  • VectorStore.init (cyclomatic 51) Sources/OmniKit/VectorStore.swift:2522 — VectorStore.init has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShotBench.run (cyclomatic 51) · ×1
  • ShotBench.run (cyclomatic 51) Sources/omni-verify/ShotBench.swift:895 — ShotBench.run has cyclomatic complexity 51 (threshold 15). Of this number, 48 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.html.renderHistory (cyclomatic 50) · ×1
  • index.html.renderHistory (cyclomatic 50) site/omni/index.html:923 — index.html.renderHistory has cyclomatic complexity 50 (threshold 15). Of this number, 21 points are the body's own statements and 29 belong to 12 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ActivityTab.body (cyclomatic 49) · ×1
  • ActivityTab.body (cyclomatic 49) App/SettingsView.swift:308 — ActivityTab.body has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.searchCandidatesLocked (cyclomatic 47) · ×1
  • VectorStore.searchCandidatesLocked (cyclomatic 47) Sources/OmniKit/VectorStore.swift:7602 — VectorStore.searchCandidatesLocked has cyclomatic complexity 47 (threshold 15). Of this number, 29 points are the body's own statements and 18 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PaperSuite.run (cyclomatic 47) · ×1
  • PaperSuite.run (cyclomatic 47) Sources/OmniKit/Paper/PaperSuite.swift:280 — PaperSuite.run has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OCRSession.runGroup (cyclomatic 45) · ×1
  • OCRSession.runGroup (cyclomatic 45) App/OCRSession.swift:1761 — OCRSession.runGroup has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VectorStore.reduceTopKGPULocked (cyclomatic 44) · ×1
  • VectorStore.reduceTopKGPULocked (cyclomatic 44) Sources/OmniKit/VectorStore.swift:8569 — VectorStore.reduceTopKGPULocked has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.relocateTailSliceLocked (cyclomatic 44) · ×1
  • VectorStore.relocateTailSliceLocked (cyclomatic 44) Sources/OmniKit/VectorStore.swift:12539 — VectorStore.relocateTailSliceLocked has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.stampVectorCoverageLocked (cyclomatic 44) · ×1
  • VectorStore.stampVectorCoverageLocked (cyclomatic 44) Sources/OmniKit/VectorStore.swift:13075 — VectorStore.stampVectorCoverageLocked has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.catchUpPendingRoots (cyclomatic 44) · ×1
  • AppModel.catchUpPendingRoots (cyclomatic 44) App/AppModel.swift:7249 — AppModel.catchUpPendingRoots has cyclomatic complexity 44 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.streamedVectorsUnderFolder (cyclomatic 43) · ×1
  • VectorStore.streamedVectorsUnderFolder (cyclomatic 43) Sources/OmniKit/VectorStore.swift:6363 — VectorStore.streamedVectorsUnderFolder has cyclomatic complexity 43 (threshold 15). Of this number, 19 points are the body's own statements and 24 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.
D1 · Cyclomatic Complexity · Indexer.mediaTurn (cyclomatic 42) · ×1
  • Indexer.mediaTurn (cyclomatic 42) Sources/OmniKit/Indexer.swift:2815 — Indexer.mediaTurn has cyclomatic complexity 42 (threshold 15). Of this number, 36 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · Indexer.pipeline (cyclomatic 42) · ×1
  • Indexer.pipeline (cyclomatic 42) Sources/OmniKit/Indexer.swift:4263 — Indexer.pipeline has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.searchDense (cyclomatic 42) · ×1
  • VectorStore.searchDense (cyclomatic 42) Sources/OmniKit/VectorStore.swift:7133 — VectorStore.searchDense has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (VectorStore.searchDense::coarseFastPathLocked) 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.
D1 · Cyclomatic Complexity · AppModel.applyParsedQuery (cyclomatic 42) · ×1
  • AppModel.applyParsedQuery (cyclomatic 42) App/AppModel.swift:5050 — AppModel.applyParsedQuery has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 41) · ×1
  • main.swift.top-level code (cyclomatic 41) Sources/crawlbench/main.swift:15 — main.swift.top-level code has cyclomatic complexity 41 (threshold 15). Of this number, 40 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.churnbenchRun (cyclomatic 41) · ×1
  • main.swift.churnbenchRun (cyclomatic 41) Sources/omni-verify/main.swift:128 — main.swift.churnbenchRun has cyclomatic complexity 41 (threshold 15). Of this number, 40 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.anchorStarts (cyclomatic 40) · ×1
  • Indexer.anchorStarts (cyclomatic 40) Sources/OmniKit/Indexer.swift:820 — Indexer.anchorStarts has cyclomatic complexity 40 (threshold 15). Of this number, 22 points are the body's own statements and 18 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.storeStreamedText (cyclomatic 40) · ×1
  • Indexer.storeStreamedText (cyclomatic 40) Sources/OmniKit/Indexer.swift:3674 — Indexer.storeStreamedText has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.rerankLocked (cyclomatic 40) · ×1
  • VectorStore.rerankLocked (cyclomatic 40) Sources/OmniKit/VectorStore.swift:7831 — VectorStore.rerankLocked has cyclomatic complexity 40 (threshold 15). Of this number, 32 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.recomputeResults (cyclomatic 40) · ×1
  • AppModel.recomputeResults (cyclomatic 40) App/AppModel.swift:4077 — AppModel.recomputeResults has cyclomatic complexity 40 (threshold 15). Of this number, 38 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchArgs.filter (cyclomatic 40) · ×1
  • SearchArgs.filter (cyclomatic 40) App/Serving/SearchArgs.swift:20 — SearchArgs.filter has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.bootstrap (cyclomatic 38) · ×1
  • AppModel.bootstrap (cyclomatic 38) App/AppModel.swift:5838 — AppModel.bootstrap has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.migrateScanKind (cyclomatic 37) · ×1
  • VectorStore.migrateScanKind (cyclomatic 37) Sources/OmniKit/VectorStore.swift:2915 — VectorStore.migrateScanKind has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Sidebar.body (cyclomatic 37) · ×1
  • Sidebar.body (cyclomatic 37) App/Sidebar.swift:271 — Sidebar.body has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatOCRAdapter.handle (cyclomatic 37) · ×1
  • ChatOCRAdapter.handle (cyclomatic 37) App/Serving/OCRAdapters.swift:54 — ChatOCRAdapter.handle has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.arguments (cyclomatic 36) · ×1
  • main.swift.arguments (cyclomatic 36) Sources/OmniCLI/main.swift:320 — main.swift.arguments has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OmniEngine.setComputeUnit (cyclomatic 36) · ×1
  • OmniEngine.setComputeUnit (cyclomatic 36) Sources/OmniKit/OmniEngine.swift:873 — OmniEngine.setComputeUnit has cyclomatic complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · VectorStore.loadFromCoverageLocked (cyclomatic 36) · ×1
  • VectorStore.loadFromCoverageLocked (cyclomatic 36) Sources/OmniKit/VectorStore.swift:11075 — VectorStore.loadFromCoverageLocked has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.migrateToV4Locked (cyclomatic 36) · ×1
  • VectorStore.migrateToV4Locked (cyclomatic 36) Sources/OmniKit/VectorStore.swift:18301 — VectorStore.migrateToV4Locked has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShotBench.stillSize (cyclomatic 36) · ×1
  • ShotBench.stillSize (cyclomatic 36) Sources/omni-verify/ShotBench.swift:263 — ShotBench.stillSize has cyclomatic complexity 36 (threshold 15). Of this number, 35 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.deleteProvenOrphanTwins (cyclomatic 35) · ×1
  • VectorStore.deleteProvenOrphanTwins (cyclomatic 35) Sources/OmniKit/VectorStore.swift:11369 — VectorStore.deleteProvenOrphanTwins has cyclomatic complexity 35 (threshold 15). Of this number, 32 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.drainPendingFSChanges (cyclomatic 35) · ×1
  • AppModel.drainPendingFSChanges (cyclomatic 35) App/AppModel.swift:9413 — AppModel.drainPendingFSChanges has cyclomatic complexity 35 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ANEAudioBackend.encode (cyclomatic 34) · ×1
  • ANEAudioBackend.encode (cyclomatic 34) Sources/OmniKit/ANEAudioBackend.swift:87 — ANEAudioBackend.encode has cyclomatic complexity 34 (threshold 15). 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.
D1 · Cyclomatic Complexity · VectorStore.vectorsUnderFolder (cyclomatic 34) · ×1
  • VectorStore.vectorsUnderFolder (cyclomatic 34) Sources/OmniKit/VectorStore.swift:6187 — VectorStore.vectorsUnderFolder has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.startIndexing (cyclomatic 34) · ×1
  • AppModel.startIndexing (cyclomatic 34) App/AppModel.swift:8855 — AppModel.startIndexing has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OmniIgnore.inSet (cyclomatic 33) · ×1
  • OmniIgnore.inSet (cyclomatic 33) Sources/OmniKit/OmniIgnore.swift:547 — OmniIgnore.inSet 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.
D1 · Cyclomatic Complexity · MCPAdapter.callReadFile (cyclomatic 33) · ×1
  • MCPAdapter.callReadFile (cyclomatic 33) App/Serving/MCPAdapter.swift:767 — MCPAdapter.callReadFile 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.
D1 · Cyclomatic Complexity · Indexer.sameVectorSpace (cyclomatic 32) · ×1
  • Indexer.sameVectorSpace (cyclomatic 32) Sources/OmniKit/Indexer.swift:2449 — Indexer.sameVectorSpace has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.embed (cyclomatic 32) · ×1
  • Indexer.embed (cyclomatic 32) Sources/OmniKit/Indexer.swift:4844 — Indexer.embed has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.reclaimVectorHolesBodyLocked (cyclomatic 32) · ×1
  • VectorStore.reclaimVectorHolesBodyLocked (cyclomatic 32) Sources/OmniKit/VectorStore.swift:12709 — VectorStore.reclaimVectorHolesBodyLocked has cyclomatic complexity 32 (threshold 15). Of this number, 29 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.
D1 · Cyclomatic Complexity · MarkdownBlock.parseUncached (cyclomatic 32) · ×1
  • MarkdownBlock.parseUncached (cyclomatic 32) App/MarkdownBlock.swift:226 — MarkdownBlock.parseUncached has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPAdapter.invalidArgument (cyclomatic 32) · ×1
  • MCPAdapter.invalidArgument (cyclomatic 32) App/Serving/MCPAdapter.swift:1356 — MCPAdapter.invalidArgument has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 32) · ×1
  • main.swift.top-level code (cyclomatic 32) Sources/opentime/main.swift:7 — main.swift.top-level code has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ANETextBackend.encode (cyclomatic 31) · ×1
  • ANETextBackend.encode (cyclomatic 31) Sources/OmniKit/ANETextBackend.swift:214 — ANETextBackend.encode has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OmniCommands.body (cyclomatic 31) · ×1
  • OmniCommands.body (cyclomatic 31) App/OmniApp.swift:400 — OmniCommands.body has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ANEQuery.engine (cyclomatic 31) · ×1
  • ANEQuery.engine (cyclomatic 31) Sources/omni-verify/ANEQuery.swift:207 — ANEQuery.engine has cyclomatic complexity 31 (threshold 15). Of this number, 26 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · main.swift.rowwindowcheckRun (cyclomatic 31) · ×1
  • main.swift.rowwindowcheckRun (cyclomatic 31) Sources/omni-verify/main.swift:1030 — main.swift.rowwindowcheckRun has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 3 function items inside it that branch (run, observe, reopen). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Indexer.chunk (cyclomatic 30) · ×1
  • Indexer.chunk (cyclomatic 30) Sources/OmniKit/Indexer.swift:5338 — Indexer.chunk has cyclomatic complexity 30 (threshold 15). Of this number, 24 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.repairIndex (cyclomatic 30) · ×1
  • VectorStore.repairIndex (cyclomatic 30) Sources/OmniKit/VectorStore.swift:11563 — VectorStore.repairIndex has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentView.body (cyclomatic 30) · ×1
  • ContentView.body (cyclomatic 30) App/ContentView.swift:64 — ContentView.body has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.swift.audiosegcheckRun (cyclomatic 30) · ×1
  • main.swift.audiosegcheckRun (cyclomatic 30) Sources/omni-verify/main.swift:7276 — main.swift.audiosegcheckRun has cyclomatic complexity 30 (threshold 15). Of this number, 23 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 29) · ×1
  • main.swift.top-level code (cyclomatic 29) Sources/OmniCLI/main.swift:14 — main.swift.top-level code 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.
D1 · Cyclomatic Complexity · IWorkText.storages (cyclomatic 29) · ×1
  • IWorkText.storages (cyclomatic 29) Sources/OmniKit/IWorkText.swift:73 — IWorkText.storages 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.
D1 · Cyclomatic Complexity · OmniImageEncoder.encodeChunk (cyclomatic 29) · ×1
  • OmniImageEncoder.encodeChunk (cyclomatic 29) Sources/OmniKit/OmniImageEncoder.swift:125 — OmniImageEncoder.encodeChunk 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.
D1 · Cyclomatic Complexity · PagePhrase.unique (cyclomatic 29) · ×1
  • PagePhrase.unique (cyclomatic 29) Sources/OmniKit/PagePhrase.swift:107 — PagePhrase.unique has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.restoreCoveredBlobsLocked (cyclomatic 29) · ×1
  • VectorStore.restoreCoveredBlobsLocked (cyclomatic 29) Sources/OmniKit/VectorStore.swift:10617 — VectorStore.restoreCoveredBlobsLocked has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VectorStore.compactRowsLocked (cyclomatic 29) · ×1
  • VectorStore.compactRowsLocked (cyclomatic 29) Sources/OmniKit/VectorStore.swift:15582 — VectorStore.compactRowsLocked 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.
D1 · Cyclomatic Complexity · WeightStore.init (cyclomatic 29) · ×1
  • WeightStore.init (cyclomatic 29) Sources/OmniKit/WeightStore.swift:24 — WeightStore.init has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AppModel.scheduleTagBackfill (cyclomatic 29) · ×1
  • AppModel.scheduleTagBackfill (cyclomatic 29) App/AppModel.swift:9327 — AppModel.scheduleTagBackfill has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Coordinator.handle (cyclomatic 29) · ×1
  • Coordinator.handle (cyclomatic 29) App/ContentKeys.swift:100 — Coordinator.handle has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MCPAdapter.readPicture (cyclomatic 29) · ×1
  • MCPAdapter.readPicture (cyclomatic 29) App/Serving/MCPAdapter.swift:824 — MCPAdapter.readPicture has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Indexer.embedGroupsReusing (cyclomatic 28) · ×1
  • Indexer.embedGroupsReusing (cyclomatic 28) Sources/OmniKit/Indexer.swift:467 — Indexer.embedGroupsReusing has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProjectionEngine.project (cyclomatic 28) · ×1
  • ProjectionEngine.project (cyclomatic 28) Sources/OmniKit/ProjectionEngine.swift:64 — ProjectionEngine.project has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.rankChunksAcross (cyclomatic 28) · ×1
  • VectorStore.rankChunksAcross (cyclomatic 28) Sources/OmniKit/VectorStore.swift:14601 — VectorStore.rankChunksAcross has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OCRModel.decodeGroup (cyclomatic 28) · ×1
  • OCRModel.decodeGroup (cyclomatic 28) Sources/OmniKit/OCR/OCRBatched.swift:558 — OCRModel.decodeGroup has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FolderRow.body (cyclomatic 28) · ×1
  • FolderRow.body (cyclomatic 28) App/Sidebar.swift:1087 — FolderRow.body has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · index.validate (cyclomatic 28) · ×1
  • index.validate (cyclomatic 28) worker/src/index.ts:237 — index.validate has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TextSlice.find (cyclomatic 27) · ×1
  • TextSlice.find (cyclomatic 27) Sources/OmniKit/Passages.swift:568 — TextSlice.find has cyclomatic complexity 27 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScreenHistory.takeInStills · ×1
  • ScreenHistory.takeInStills::pass (cyclomatic 27) Sources/OmniKit/ScreenHistory.swift:1222 — ScreenHistory.takeInStills::pass 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.
D1 · Cyclomatic Complexity · VectorStore.searchGraphDense (cyclomatic 27) · ×1
  • VectorStore.searchGraphDense (cyclomatic 27) Sources/OmniKit/VectorStore.swift:6677 — VectorStore.searchGraphDense has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.persistQuantReplicaLocked (cyclomatic 27) · ×1
  • VectorStore.persistQuantReplicaLocked (cyclomatic 27) Sources/OmniKit/VectorStore.swift:9152 — VectorStore.persistQuantReplicaLocked has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PerfScript.ocrStep (cyclomatic 27) · ×1
  • PerfScript.ocrStep (cyclomatic 27) App/PerfScript.swift:654 — PerfScript.ocrStep has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: PerfScript.applySetting (cyclomatic 28) 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.
D1 · Cyclomatic Complexity · LexicalIndex.refreshIncrementally (cyclomatic 26) · ×1
  • LexicalIndex.refreshIncrementally (cyclomatic 26) Sources/OmniKit/LexicalIndex.swift:229 — LexicalIndex.refreshIncrementally has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaDuration.isoMovie (cyclomatic 26) · ×1
  • MediaDuration.isoMovie (cyclomatic 26) Sources/OmniKit/MediaDuration.swift:31 — MediaDuration.isoMovie has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 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.
D1 · Cyclomatic Complexity · VectorStore.selectMaskLocked (cyclomatic 26) · ×1
  • VectorStore.selectMaskLocked (cyclomatic 26) Sources/OmniKit/VectorStore.swift:8334 — VectorStore.selectMaskLocked has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.measureSlotOffset (cyclomatic 26) · ×1
  • VectorStore.measureSlotOffset (cyclomatic 26) Sources/OmniKit/VectorStore.swift:11675 — VectorStore.measureSlotOffset has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.reloadEngine (cyclomatic 26) · ×1
  • AppModel.reloadEngine (cyclomatic 26) App/AppModel.swift:4866 — AppModel.reloadEngine has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FolderEmbeddingVisualization.rebuildPoints (cyclomatic 26) · ×1
  • FolderEmbeddingVisualization.rebuildPoints (cyclomatic 26) App/FolderEmbeddingVisualization.swift:393 — FolderEmbeddingVisualization.rebuildPoints has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScreenRecorder.capture (cyclomatic 26) · ×1
  • ScreenRecorder.capture (cyclomatic 26) App/ScreenRecorder.swift:299 — ScreenRecorder.capture has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Router.handle (cyclomatic 26) · ×1
  • Router.handle (cyclomatic 26) App/Serving/Router.swift:22 — Router.handle has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · TagAdapter.handle (cyclomatic 26) · ×1
  • TagAdapter.handle (cyclomatic 26) App/Serving/SchemaAdapters.swift:778 — TagAdapter.handle has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FileCrawler.walkBulk (cyclomatic 25) · ×1
  • FileCrawler.walkBulk (cyclomatic 25) Sources/OmniKit/FileCrawler.swift:173 — FileCrawler.walkBulk has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OmniTagger.finalize (cyclomatic 25) · ×1
  • OmniTagger.finalize (cyclomatic 25) Sources/OmniKit/OmniTagger.swift:275 — OmniTagger.finalize 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.
D1 · Cyclomatic Complexity · PassageWindow.best (cyclomatic 25) · ×1
  • PassageWindow.best (cyclomatic 25) Sources/OmniKit/Passages.swift:57 — PassageWindow.best has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchQueryParser.parse (cyclomatic 25) · ×1
  • SearchQueryParser.parse (cyclomatic 25) Sources/OmniKit/SearchQueryParser.swift:98 — SearchQueryParser.parse 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.
D1 · Cyclomatic Complexity · VectorStore.deleteFilesInSlices (cyclomatic 25) · ×1
  • VectorStore.deleteFilesInSlices (cyclomatic 25) Sources/OmniKit/VectorStore.swift:3744 — VectorStore.deleteFilesInSlices 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.
D1 · Cyclomatic Complexity · VectorStore.acceptedFilesLocked (cyclomatic 25) · ×1
  • VectorStore.acceptedFilesLocked (cyclomatic 25) Sources/OmniKit/VectorStore.swift:8141 — VectorStore.acceptedFilesLocked has cyclomatic complexity 25 (threshold 15). 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.
D1 · Cyclomatic Complexity · VectorStore.dropV4TablesLocked (cyclomatic 25) · ×1
  • VectorStore.dropV4TablesLocked (cyclomatic 25) Sources/OmniKit/VectorStore.swift:17317 — VectorStore.dropV4TablesLocked has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · AppModel.applyResults (cyclomatic 25) · ×1
  • AppModel.applyResults (cyclomatic 25) App/AppModel.swift:8081 — AppModel.applyResults 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.
D1 · Cyclomatic Complexity · FolderEmbeddingVisualization.body (cyclomatic 25) · ×1
  • FolderEmbeddingVisualization.body (cyclomatic 25) App/FolderEmbeddingVisualization.swift:58 — FolderEmbeddingVisualization.body has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPAdapter.notIndexedWhy (cyclomatic 25) · ×1
  • MCPAdapter.notIndexedWhy (cyclomatic 25) App/Serving/MCPAdapter.swift:994 — MCPAdapter.notIndexedWhy 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.
D1 · Cyclomatic Complexity · Indexer.streamWindow (cyclomatic 24) · ×1
  • Indexer.streamWindow (cyclomatic 24) Sources/OmniKit/Indexer.swift:3471 — Indexer.streamWindow has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Indexer.embedPagePictures (cyclomatic 24) · ×1
  • Indexer.embedPagePictures (cyclomatic 24) Sources/OmniKit/Indexer.swift:5164 — Indexer.embedPagePictures has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProjectionEngine.gridify (cyclomatic 24) · ×1
  • ProjectionEngine.gridify (cyclomatic 24) Sources/OmniKit/ProjectionEngine.swift:509 — ProjectionEngine.gridify has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScreenHistory.walk (cyclomatic 24) · ×1
  • ScreenHistory.walk (cyclomatic 24) Sources/OmniKit/ScreenHistory.swift:421 — ScreenHistory.walk has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.fileFactsToCorrectLocked (cyclomatic 24) · ×1
  • VectorStore.fileFactsToCorrectLocked (cyclomatic 24) Sources/OmniKit/VectorStore.swift:13665 — VectorStore.fileFactsToCorrectLocked has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.buildChunkSplitLocked (cyclomatic 24) · ×1
  • VectorStore.buildChunkSplitLocked (cyclomatic 24) Sources/OmniKit/VectorStore.swift:17527 — VectorStore.buildChunkSplitLocked has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OCRModel.decodePrepared (cyclomatic 24) · ×1
  • OCRModel.decodePrepared (cyclomatic 24) Sources/OmniKit/OCR/OCRSpeculative.swift:118 — OCRModel.decodePrepared has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.applyComputeUnit (cyclomatic 24) · ×1
  • AppModel.applyComputeUnit (cyclomatic 24) App/AppModel.swift:2908 — AppModel.applyComputeUnit has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ScreenRecorder.tick (cyclomatic 24) · ×1
  • ScreenRecorder.tick (cyclomatic 24) App/ScreenRecorder.swift:217 — ScreenRecorder.tick has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SearchToolbar.toolbar (cyclomatic 24) · ×1
  • SearchToolbar.toolbar (cyclomatic 24) App/SearchToolbar.swift:103 — SearchToolbar.toolbar has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DocumentOCRAdapter.handle (cyclomatic 24) · ×1
  • DocumentOCRAdapter.handle (cyclomatic 24) App/Serving/OCRAdapters.swift:195 — DocumentOCRAdapter.handle has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · OCRServing.parsePages (cyclomatic 24) · ×1
  • OCRServing.parsePages (cyclomatic 24) App/Serving/OCRServing.swift:140 — OCRServing.parsePages has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchAdapter.handle (cyclomatic 24) · ×1
  • SearchAdapter.handle (cyclomatic 24) App/Serving/SchemaAdapters.swift:365 — SearchAdapter.handle has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OmniEngine.embedFileQuery (cyclomatic 23) · ×1
  • OmniEngine.embedFileQuery (cyclomatic 23) Sources/OmniKit/OmniEngine.swift:1907 — OmniEngine.embedFileQuery has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.bestChunkScoreLocked (cyclomatic 23) · ×1
  • VectorStore.bestChunkScoreLocked (cyclomatic 23) Sources/OmniKit/VectorStore.swift:4880 — VectorStore.bestChunkScoreLocked has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.stampRowSidecarLocked (cyclomatic 23) · ×1
  • VectorStore.stampRowSidecarLocked (cyclomatic 23) Sources/OmniKit/VectorStore.swift:13251 — VectorStore.stampRowSidecarLocked has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OCRWeights.init (cyclomatic 23) · ×1
  • OCRWeights.init (cyclomatic 23) Sources/OmniKit/OCR/OCRWeights.swift:170 — OCRWeights.init has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LinkNode.pairingHandler (cyclomatic 23) · ×1
  • LinkNode.pairingHandler (cyclomatic 23) Sources/OmniLink/LinkNode.swift:776 — LinkNode.pairingHandler has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.refreshIndexStats (cyclomatic 23) · ×1
  • AppModel.refreshIndexStats (cyclomatic 23) App/AppModel.swift:6371 — AppModel.refreshIndexStats has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScreenTimeline.body (cyclomatic 23) · ×1
  • ScreenTimeline.body (cyclomatic 23) App/ScreenTimeline.swift:515 — ScreenTimeline.body has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IndexStatusRow.body (cyclomatic 23) · ×1
  • IndexStatusRow.body (cyclomatic 23) App/SettingsView.swift:178 — IndexStatusRow.body has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvalCommand.matches (cyclomatic 23) · ×1
  • EvalCommand.matches (cyclomatic 23) Sources/omni-verify/Eval.swift:738 — EvalCommand.matches has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShotBench.reader (cyclomatic 23) · ×1
  • ShotBench.reader (cyclomatic 23) Sources/omni-verify/ShotBench.swift:641 — ShotBench.reader has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ANEVisionBackend.encode (cyclomatic 22) · ×1
  • ANEVisionBackend.encode (cyclomatic 22) Sources/OmniKit/ANEVisionBackend.swift:92 — ANEVisionBackend.encode has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Indexer.pdfTextTurn (cyclomatic 22) · ×1
  • Indexer.pdfTextTurn (cyclomatic 22) Sources/OmniKit/Indexer.swift:3588 — Indexer.pdfTextTurn 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.
D1 · Cyclomatic Complexity · CompiledPathFilter.accepts (cyclomatic 22) · ×1
  • CompiledPathFilter.accepts (cyclomatic 22) Sources/OmniKit/PathTable.swift:592 — CompiledPathFilter.accepts has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProjectionEngine.pca2DBasis (cyclomatic 22) · ×1
  • ProjectionEngine.pca2DBasis (cyclomatic 22) Sources/OmniKit/ProjectionEngine.swift:311 — ProjectionEngine.pca2DBasis has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · ScreenHistory.record (cyclomatic 22) · ×1
  • ScreenHistory.record (cyclomatic 22) Sources/OmniKit/ScreenHistory.swift:170 — ScreenHistory.record has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VectorStore.folderAggregates (cyclomatic 22) · ×1
  • VectorStore.folderAggregates (cyclomatic 22) Sources/OmniKit/VectorStore.swift:5861 — VectorStore.folderAggregates 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.
D1 · Cyclomatic Complexity · VectorStore.repointSurvivorsOfReleasedLocked (cyclomatic 22) · ×1
  • VectorStore.repointSurvivorsOfReleasedLocked (cyclomatic 22) Sources/OmniKit/VectorStore.swift:10437 — VectorStore.repointSurvivorsOfReleasedLocked 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.
D1 · Cyclomatic Complexity · VectorStore.pooledVectors (cyclomatic 22) · ×1
  • VectorStore.pooledVectors (cyclomatic 22) Sources/OmniKit/VectorStore.swift:15043 — VectorStore.pooledVectors 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.
D1 · Cyclomatic Complexity · VectorStore.backfillSlotsLocked (cyclomatic 22) · ×1
  • VectorStore.backfillSlotsLocked (cyclomatic 22) Sources/OmniKit/VectorStore.swift:17873 — VectorStore.backfillSlotsLocked 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.
D1 · Cyclomatic Complexity · FolderBrowser.reload (cyclomatic 22) · ×1
  • FolderBrowser.reload (cyclomatic 22) App/FolderBrowser.swift:566 — FolderBrowser.reload 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.
D1 · Cyclomatic Complexity · OCRSession.open (cyclomatic 22) · ×1
  • OCRSession.open (cyclomatic 22) App/OCRSession.swift:875 — OCRSession.open 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.
D1 · Cyclomatic Complexity · IndexTab.body (cyclomatic 22) · ×1
  • IndexTab.body (cyclomatic 22) App/SettingsView.swift:1251 — IndexTab.body has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 22) · ×1
  • main.swift.top-level code (cyclomatic 22) Sources/searchbench/main.swift:11 — main.swift.top-level code 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.
D1 · Cyclomatic Complexity · index.html.renderTable (cyclomatic 22) · ×1
  • index.html.renderTable (cyclomatic 22) site/omni/index.html:830 — index.html.renderTable has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ANETextBackend.runLayers (cyclomatic 21) · ×1
  • ANETextBackend.runLayers (cyclomatic 21) Sources/OmniKit/ANETextBackend.swift:406 — ANETextBackend.runLayers 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.
D1 · Cyclomatic Complexity · Zip.entries (cyclomatic 21) · ×1
  • Zip.entries (cyclomatic 21) Sources/OmniKit/IWorkText.swift:251 — Zip.entries 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.
D1 · Cyclomatic Complexity · OmniIgnore.parseSet (cyclomatic 21) · ×1
  • OmniIgnore.parseSet (cyclomatic 21) Sources/OmniKit/OmniIgnore.swift:510 — OmniIgnore.parseSet 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.
D1 · Cyclomatic Complexity · ScreenHistory.wallSeconds (cyclomatic 21) · ×1
  • ScreenHistory.wallSeconds (cyclomatic 21) Sources/OmniKit/ScreenHistory.swift:757 — ScreenHistory.wallSeconds has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.replaceManyLocked (cyclomatic 21) · ×1
  • VectorStore.replaceManyLocked (cyclomatic 21) Sources/OmniKit/VectorStore.swift:3300 — VectorStore.replaceManyLocked 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.
D1 · Cyclomatic Complexity · VectorStore.pooledFilesLocked (cyclomatic 21) · ×1
  • VectorStore.pooledFilesLocked (cyclomatic 21) Sources/OmniKit/VectorStore.swift:6117 — VectorStore.pooledFilesLocked 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.
D1 · Cyclomatic Complexity · VectorStore.fuseLexical (cyclomatic 21) · ×1
  • VectorStore.fuseLexical (cyclomatic 21) Sources/OmniKit/VectorStore.swift:7054 — VectorStore.fuseLexical 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.
D1 · Cyclomatic Complexity · VectorStore.placeVectorLocked (cyclomatic 21) · ×1
  • VectorStore.placeVectorLocked (cyclomatic 21) Sources/OmniKit/VectorStore.swift:9629 — VectorStore.placeVectorLocked has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VectorStore.commitReclaimLocked (cyclomatic 21) · ×1
  • VectorStore.commitReclaimLocked (cyclomatic 21) Sources/OmniKit/VectorStore.swift:12842 — VectorStore.commitReclaimLocked has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.persistSlotsLocked (cyclomatic 21) · ×1
  • VectorStore.persistSlotsLocked (cyclomatic 21) Sources/OmniKit/VectorStore.swift:17981 — VectorStore.persistSlotsLocked 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.
D1 · Cyclomatic Complexity · VectorStore.internPathsLocked (cyclomatic 21) · ×1
  • VectorStore.internPathsLocked (cyclomatic 21) Sources/OmniKit/VectorStore.swift:18575 — VectorStore.internPathsLocked has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Drawer.run (cyclomatic 21) · ×1
  • Drawer.run (cyclomatic 21) Sources/OmniPages/main.swift:165 — Drawer.run 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.
D1 · Cyclomatic Complexity · AppModel.perfSeam (cyclomatic 21) · ×1
  • AppModel.perfSeam (cyclomatic 21) App/AppModel.swift:9709 — AppModel.perfSeam has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AppModel.runPaperBenchmark (cyclomatic 21) · ×1
  • AppModel.runPaperBenchmark (cyclomatic 21) App/PaperBenchmark.swift:33 — AppModel.runPaperBenchmark has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DocumentScroll.scroller (cyclomatic 21) · ×1
  • DocumentScroll.scroller (cyclomatic 21) App/OCRView.swift:1133 — DocumentScroll.scroller has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ResultRow.cell (cyclomatic 21) · ×1
  • ResultRow.cell (cyclomatic 21) App/ResultsList.swift:784 — ResultRow.cell has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PerformanceTab.body (cyclomatic 21) · ×1
  • PerformanceTab.body (cyclomatic 21) App/SettingsView.swift:802 — PerformanceTab.body has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Sidebar.reconcileSelection (cyclomatic 21) · ×1
  • Sidebar.reconcileSelection (cyclomatic 21) App/Sidebar.swift:427 — Sidebar.reconcileSelection has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhotoSourceRow.body (cyclomatic 21) · ×1
  • PhotoSourceRow.body (cyclomatic 21) App/Sidebar.swift:849 — PhotoSourceRow.body has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MCPAdapter.callOCR (cyclomatic 21) · ×1
  • MCPAdapter.callOCR (cyclomatic 21) App/Serving/MCPAdapter.swift:1163 — MCPAdapter.callOCR has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MCPAdapter.callTool (cyclomatic 21) · ×1
  • MCPAdapter.callTool (cyclomatic 21) App/Serving/MCPAdapter.swift:1417 — MCPAdapter.callTool 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.
D1 · Cyclomatic Complexity · main.swift.videosegcheckRun (cyclomatic 21) · ×1
  • main.swift.videosegcheckRun (cyclomatic 21) Sources/omni-verify/main.swift:7413 — main.swift.videosegcheckRun has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.rpc (cyclomatic 20) · ×1
  • main.swift.rpc (cyclomatic 20) Sources/OmniCLI/main.swift:202 — main.swift.rpc has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Snappy.decodeBlock (cyclomatic 20) · ×1
  • Snappy.decodeBlock (cyclomatic 20) Sources/OmniKit/IWorkText.swift:202 — Snappy.decodeBlock has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.readIdentifiers (cyclomatic 20) · ×1
  • Indexer.readIdentifiers (cyclomatic 20) Sources/OmniKit/Indexer.swift:2956 — Indexer.readIdentifiers has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.pieceTurn (cyclomatic 20) · ×1
  • Indexer.pieceTurn (cyclomatic 20) Sources/OmniKit/Indexer.swift:3515 — Indexer.pieceTurn has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OmniAudioTower.forwardImpl (cyclomatic 20) · ×1
  • OmniAudioTower.forwardImpl (cyclomatic 20) Sources/OmniKit/OmniAudioTower.swift:84 — OmniAudioTower.forwardImpl has cyclomatic complexity 20 (threshold 15). 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.
D1 · Cyclomatic Complexity · ScreenHistory.rewrite (cyclomatic 20) · ×1
  • ScreenHistory.rewrite (cyclomatic 20) Sources/OmniKit/ScreenHistory.swift:1406 — ScreenHistory.rewrite has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.modalityScoreProfile (cyclomatic 20) · ×1
  • VectorStore.modalityScoreProfile (cyclomatic 20) Sources/OmniKit/VectorStore.swift:6485 — VectorStore.modalityScoreProfile has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · VectorStore.coverageAudit (cyclomatic 20) · ×1
  • VectorStore.coverageAudit (cyclomatic 20) Sources/OmniKit/VectorStore.swift:10130 — VectorStore.coverageAudit has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.advanceCoverageLocked (cyclomatic 20) · ×1
  • VectorStore.advanceCoverageLocked (cyclomatic 20) Sources/OmniKit/VectorStore.swift:12047 — VectorStore.advanceCoverageLocked has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VectorStore.rankChunks (cyclomatic 20) · ×1
  • VectorStore.rankChunks (cyclomatic 20) Sources/OmniKit/VectorStore.swift:14476 — VectorStore.rankChunks has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.writeChunksLocked (cyclomatic 20) · ×1
  • VectorStore.writeChunksLocked (cyclomatic 20) Sources/OmniKit/VectorStore.swift:16809 — VectorStore.writeChunksLocked has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResultGrouping.group (cyclomatic 20) · ×1
  • ResultGrouping.group (cyclomatic 20) App/ResultGrouping.swift:55 — ResultGrouping.group has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResultsList.menu (cyclomatic 20) · ×1
  • ResultsList.menu (cyclomatic 20) App/ResultsList.swift:481 — ResultsList.menu has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Coordinator.install (cyclomatic 20) · ×1
  • Coordinator.install (cyclomatic 20) App/ScreenTimeline.swift:936 — Coordinator.install has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MCPAdapter.callFileStatus (cyclomatic 20) · ×1
  • MCPAdapter.callFileStatus (cyclomatic 20) App/Serving/MCPAdapter.swift:935 — MCPAdapter.callFileStatus has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServingController.startServer (cyclomatic 20) · ×1
  • ServingController.startServer (cyclomatic 20) App/Serving/ServingController.swift:307 — ServingController.startServer has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.swift.top-level code (cyclomatic 20) · ×1
  • main.swift.top-level code (cyclomatic 20) Sources/linktool/main.swift:26 — main.swift.top-level code has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShotBench.frameEmbed (cyclomatic 20) · ×1
  • ShotBench.frameEmbed (cyclomatic 20) Sources/omni-verify/ShotBench.swift:703 — ShotBench.frameEmbed has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (video, cos, line). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ANETextBackend.packedInputs (cyclomatic 19) · ×1
  • ANETextBackend.packedInputs (cyclomatic 19) Sources/OmniKit/ANETextBackend.swift:294 — ANETextBackend.packedInputs has cyclomatic complexity 19 (threshold 15). 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.
D1 · Cyclomatic Complexity · PDFPagePictures.imageShare (cyclomatic 19) · ×1
  • PDFPagePictures.imageShare (cyclomatic 19) Sources/OmniKit/DocumentPictures.swift:75 — PDFPagePictures.imageShare has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · IWorkText.extract (cyclomatic 19) · ×1
  • IWorkText.extract (cyclomatic 19) Sources/OmniKit/IWorkText.swift:26 — IWorkText.extract has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchFilter.accepts (cyclomatic 19) · ×1
  • SearchFilter.accepts (cyclomatic 19) Sources/OmniKit/VectorStore.swift:350 — SearchFilter.accepts has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.keepReleasedLocked (cyclomatic 19) · ×1
  • VectorStore.keepReleasedLocked (cyclomatic 19) Sources/OmniKit/VectorStore.swift:17240 — VectorStore.keepReleasedLocked has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.serializeSearch (cyclomatic 19) · ×1
  • AppModel.serializeSearch (cyclomatic 19) App/AppModel.swift:5201 — AppModel.serializeSearch 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.
D1 · Cyclomatic Complexity · AppModel.lookAtQueue (cyclomatic 19) · ×1
  • AppModel.lookAtQueue (cyclomatic 19) App/AppModel.swift:8705 — AppModel.lookAtQueue has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileMenuItems.body (cyclomatic 19) · ×1
  • FileMenuItems.body (cyclomatic 19) App/FileMenu.swift:123 — FileMenuItems.body 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.
D1 · Cyclomatic Complexity · ANEQuery.vision (cyclomatic 19) · ×1
  • ANEQuery.vision (cyclomatic 19) Sources/omni-verify/ANEQuery.swift:134 — ANEQuery.vision has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ANEHintAB.pair (cyclomatic 19) · ×1
  • ANEHintAB.pair (cyclomatic 19) Sources/omni-verify/ANEQuery.swift:543 — ANEHintAB.pair has cyclomatic complexity 19 (threshold 15). 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.
D1 · Cyclomatic Complexity · ShotBench.reference (cyclomatic 19) · ×1
  • ShotBench.reference (cyclomatic 19) Sources/omni-verify/ShotBench.swift:482 — ShotBench.reference has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.tombstonecheckRun (cyclomatic 19) · ×1
  • main.swift.tombstonecheckRun (cyclomatic 19) Sources/omni-verify/main.swift:863 — main.swift.tombstonecheckRun has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · ContentChunker.cutPoints (cyclomatic 18) · ×1
  • ContentChunker.cutPoints (cyclomatic 18) Sources/OmniKit/ContentChunker.swift:126 — ContentChunker.cutPoints has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileCrawler.walkLegacy (cyclomatic 18) · ×1
  • FileCrawler.walkLegacy (cyclomatic 18) Sources/OmniKit/FileCrawler.swift:245 — FileCrawler.walkLegacy has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IDTokens.tokens (cyclomatic 18) · ×1
  • IDTokens.tokens (cyclomatic 18) Sources/OmniKit/IDTokens.swift:19 — IDTokens.tokens has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Indexer.enrichMedia (cyclomatic 18) · ×1
  • Indexer.enrichMedia (cyclomatic 18) Sources/OmniKit/Indexer.swift:3256 — Indexer.enrichMedia has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OmniEngine.embedImagesTaggedHQ (cyclomatic 18) · ×1
  • OmniEngine.embedImagesTaggedHQ (cyclomatic 18) Sources/OmniKit/OmniEngine.swift:1694 — OmniEngine.embedImagesTaggedHQ has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PassageRecovery.texts (cyclomatic 18) · ×1
  • PassageRecovery.texts (cyclomatic 18) Sources/OmniKit/Passages.swift:316 — PassageRecovery.texts has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.rowWindowAuditLocked (cyclomatic 18) · ×1
  • VectorStore.rowWindowAuditLocked (cyclomatic 18) Sources/OmniKit/VectorStore.swift:2262 — VectorStore.rowWindowAuditLocked has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.chunkVectors (cyclomatic 18) · ×1
  • VectorStore.chunkVectors (cyclomatic 18) Sources/OmniKit/VectorStore.swift:3458 — VectorStore.chunkVectors has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.chunksForCurrentPathLocked (cyclomatic 18) · ×1
  • VectorStore.chunksForCurrentPathLocked (cyclomatic 18) Sources/OmniKit/VectorStore.swift:3616 — VectorStore.chunksForCurrentPathLocked has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.pathAllowGPULocked (cyclomatic 18) · ×1
  • VectorStore.pathAllowGPULocked (cyclomatic 18) Sources/OmniKit/VectorStore.swift:8183 — VectorStore.pathAllowGPULocked 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.
D1 · Cyclomatic Complexity · AppModel.fillPassages (cyclomatic 18) · ×1
  • AppModel.fillPassages (cyclomatic 18) App/AppModel.swift:630 — AppModel.fillPassages 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.
D1 · Cyclomatic Complexity · AppModel.finishPass (cyclomatic 18) · ×1
  • AppModel.finishPass (cyclomatic 18) App/AppModel.swift:8998 — AppModel.finishPass 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.
D1 · Cyclomatic Complexity · EmptyResults.body (cyclomatic 18) · ×1
  • EmptyResults.body (cyclomatic 18) App/ContentView.swift:770 — EmptyResults.body 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.
D1 · Cyclomatic Complexity · PassagesView.body (cyclomatic 18) · ×1
  • PassagesView.body (cyclomatic 18) App/ResultsList.swift:860 — PassagesView.body 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.
D1 · Cyclomatic Complexity · ScreenRecorder.frontWindows (cyclomatic 18) · ×1
  • ScreenRecorder.frontWindows (cyclomatic 18) App/ScreenRecorder.swift:434 — ScreenRecorder.frontWindows has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ANEQuery.parallel (cyclomatic 18) · ×1
  • ANEQuery.parallel (cyclomatic 18) Sources/omni-verify/ANEQuery.swift:286 — ANEQuery.parallel has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShotBench.neighbour (cyclomatic 18) · ×1
  • ShotBench.neighbour (cyclomatic 18) Sources/omni-verify/ShotBench.swift:579 — ShotBench.neighbour has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShotBench.state (cyclomatic 18) · ×1
  • ShotBench.state (cyclomatic 18) Sources/omni-verify/ShotBench.swift:794 — ShotBench.state has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.validateTable (cyclomatic 18) · ×1
  • index.validateTable (cyclomatic 18) worker/src/index.ts:286 — index.validateTable has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BulkDirWalker.walk (cyclomatic 17) · ×1
  • BulkDirWalker.walk (cyclomatic 17) Sources/OmniKit/BulkDirWalker.swift:190 — BulkDirWalker.walk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.extraChunks (cyclomatic 17) · ×1
  • Indexer.extraChunks (cyclomatic 17) Sources/OmniKit/Indexer.swift:3012 — Indexer.extraChunks has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.streamedAudio (cyclomatic 17) · ×1
  • Indexer.streamedAudio (cyclomatic 17) Sources/OmniKit/Indexer.swift:5064 — Indexer.streamedAudio has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OfficeDocument.slides (cyclomatic 17) · ×1
  • OfficeDocument.slides (cyclomatic 17) Sources/OmniKit/OfficeDocument.swift:46 — OfficeDocument.slides has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OmniEngine.run (cyclomatic 17) · ×1
  • OmniEngine.run (cyclomatic 17) Sources/OmniKit/OmniEngine.swift:637 — OmniEngine.run has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OmniEngine.embedTextBatches (cyclomatic 17) · ×1
  • OmniEngine.embedTextBatches (cyclomatic 17) Sources/OmniKit/OmniEngine.swift:1415 — OmniEngine.embedTextBatches has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PassageRecovery.passages (cyclomatic 17) · ×1
  • PassageRecovery.passages (cyclomatic 17) Sources/OmniKit/Passages.swift:198 — PassageRecovery.passages has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ScreenHistory.readCatalog (cyclomatic 17) · ×1
  • ScreenHistory.readCatalog (cyclomatic 17) Sources/OmniKit/ScreenHistory.swift:1066 — ScreenHistory.readCatalog has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchHit.matchReason (cyclomatic 17) · ×1
  • SearchHit.matchReason (cyclomatic 17) App/ResultsList.swift:1387 — SearchHit.matchReason has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Vec16Buffer.mapPersistent (cyclomatic 17) · ×1
  • Vec16Buffer.mapPersistent (cyclomatic 17) Sources/OmniKit/VectorStore.swift:680 — Vec16Buffer.mapPersistent has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VectorStore.orphanSlotsLocked (cyclomatic 17) · ×1
  • VectorStore.orphanSlotsLocked (cyclomatic 17) Sources/OmniKit/VectorStore.swift:1663 — VectorStore.orphanSlotsLocked has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.replaceMany (cyclomatic 17) · ×1
  • VectorStore.replaceMany (cyclomatic 17) Sources/OmniKit/VectorStore.swift:3235 — VectorStore.replaceMany has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.vectorsForContentKeys (cyclomatic 17) · ×1
  • VectorStore.vectorsForContentKeys (cyclomatic 17) Sources/OmniKit/VectorStore.swift:3547 — VectorStore.vectorsForContentKeys has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.deriveUnownedPositionsAsHolesLocked (cyclomatic 17) · ×1
  • VectorStore.deriveUnownedPositionsAsHolesLocked (cyclomatic 17) Sources/OmniKit/VectorStore.swift:11762 — VectorStore.deriveUnownedPositionsAsHolesLocked has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VectorStore.releaseHolesOwnedByLiveContentsLocked (cyclomatic 17) · ×1
  • VectorStore.releaseHolesOwnedByLiveContentsLocked (cyclomatic 17) Sources/OmniKit/VectorStore.swift:11826 — VectorStore.releaseHolesOwnedByLiveContentsLocked has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.finishTailReclaimLocked (cyclomatic 17) · ×1
  • VectorStore.finishTailReclaimLocked (cyclomatic 17) Sources/OmniKit/VectorStore.swift:12670 — VectorStore.finishTailReclaimLocked has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BenchTable.rows (cyclomatic 17) · ×1
  • BenchTable.rows (cyclomatic 17) Sources/OmniKit/Paper/BenchTable.swift:90 — BenchTable.rows has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaperLevers.applying (cyclomatic 17) · ×1
  • PaperLevers.applying (cyclomatic 17) Sources/OmniKit/Paper/PaperLevers.swift:173 — PaperLevers.applying has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PaperReport.appendCases (cyclomatic 17) · ×1
  • PaperReport.appendCases (cyclomatic 17) Sources/OmniKit/Paper/PaperReport.swift:384 — PaperReport.appendCases has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.pickPage (cyclomatic 17) · ×1
  • AppModel.pickPage (cyclomatic 17) App/AppModel.swift:572 — AppModel.pickPage has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AppModel.reloadFolderPolicies (cyclomatic 17) · ×1
  • AppModel.reloadFolderPolicies (cyclomatic 17) App/AppModel.swift:4440 — AppModel.reloadFolderPolicies has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResultGridItem.body (cyclomatic 17) · ×1
  • ResultGridItem.body (cyclomatic 17) App/ResultsList.swift:935 — ResultGridItem.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.
D1 · Cyclomatic Complexity · ScreenTimelineState.apply (cyclomatic 17) · ×1
  • ScreenTimelineState.apply (cyclomatic 17) App/ScreenTimeline.swift:182 — ScreenTimelineState.apply has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ScreenshotsRow.body (cyclomatic 17) · ×1
  • ScreenshotsRow.body (cyclomatic 17) App/Sidebar.swift:985 — ScreenshotsRow.body has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · LinkController.refresh (cyclomatic 17) · ×1
  • LinkController.refresh (cyclomatic 17) App/Link/LinkController.swift:202 — LinkController.refresh has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · HTTPParse.parseHead (cyclomatic 17) · ×1
  • HTTPParse.parseHead (cyclomatic 17) App/Serving/HTTPMessage.swift:85 — HTTPParse.parseHead has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPAdapter.callPhrase (cyclomatic 17) · ×1
  • MCPAdapter.callPhrase (cyclomatic 17) App/Serving/MCPAdapter.swift:708 — MCPAdapter.callPhrase has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.swift.unixExchange (cyclomatic 16) · ×1
  • main.swift.unixExchange (cyclomatic 16) Sources/OmniCLI/main.swift:81 — main.swift.unixExchange has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ANETextBackend.mapLayers (cyclomatic 16) · ×1
  • ANETextBackend.mapLayers (cyclomatic 16) Sources/OmniKit/ANETextBackend.swift:98 — ANETextBackend.mapLayers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ANETextBackend.inputs (cyclomatic 16) · ×1
  • ANETextBackend.inputs (cyclomatic 16) Sources/OmniKit/ANETextBackend.swift:339 — ANETextBackend.inputs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IDIndex.drain (cyclomatic 16) · ×1
  • IDIndex.drain (cyclomatic 16) Sources/OmniKit/IDIndex.swift:98 — IDIndex.drain has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Indexer.update · ×1
  • Indexer.update::flushImagesU (cyclomatic 16) Sources/OmniKit/Indexer.swift:4115 — Indexer.update::flushImagesU 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. This shape REPEATS in the file: one other method here (Indexer.update) 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.
D1 · Cyclomatic Complexity · OmniAudioEncoder.encodeBatch (cyclomatic 16) · ×1
  • OmniAudioEncoder.encodeBatch (cyclomatic 16) Sources/OmniKit/OmniAudioEncoder.swift:74 — OmniAudioEncoder.encodeBatch has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AudioSegmentReader.nextSegment (cyclomatic 16) · ×1
  • AudioSegmentReader.nextSegment (cyclomatic 16) Sources/OmniKit/OmniAudioPreprocess.swift:224 — AudioSegmentReader.nextSegment has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OmniEngine.installTowers (cyclomatic 16) · ×1
  • OmniEngine.installTowers (cyclomatic 16) Sources/OmniKit/OmniEngine.swift:1020 — OmniEngine.installTowers 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.
D1 · Cyclomatic Complexity · PDFPagePick.page (cyclomatic 16) · ×1
  • PDFPagePick.page (cyclomatic 16) Sources/OmniKit/PDFPagePick.swift:18 — PDFPagePick.page has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScreenHistory.read (cyclomatic 16) · ×1
  • ScreenHistory.read (cyclomatic 16) Sources/OmniKit/ScreenHistory.swift:575 — ScreenHistory.read has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorStore.searchDense · ×1
  • VectorStore.searchDense::coarseFastPathLocked (cyclomatic 16) Sources/OmniKit/VectorStore.swift:7160 — VectorStore.searchDense::coarseFastPathLocked 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. This shape REPEATS in the file: one other method here (VectorStore.searchDense) 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.
D1 · Cyclomatic Complexity · VectorStore.correctSplitCoverageClaim (cyclomatic 16) · ×1
  • VectorStore.correctSplitCoverageClaim (cyclomatic 16) Sources/OmniKit/VectorStore.swift:11509 — VectorStore.correctSplitCoverageClaim has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.retireContentsSharingAPositionOnceLocked (cyclomatic 16) · ×1
  • VectorStore.retireContentsSharingAPositionOnceLocked (cyclomatic 16) Sources/OmniKit/VectorStore.swift:11880 — VectorStore.retireContentsSharingAPositionOnceLocked has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.shouldReclaimHolesLocked (cyclomatic 16) · ×1
  • VectorStore.shouldReclaimHolesLocked (cyclomatic 16) Sources/OmniKit/VectorStore.swift:12354 — VectorStore.shouldReclaimHolesLocked has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VectorStore.bitScanCPU (cyclomatic 16) · ×1
  • VectorStore.bitScanCPU (cyclomatic 16) Sources/OmniKit/VectorStore.swift:13974 — VectorStore.bitScanCPU has cyclomatic complexity 16 (threshold 15). 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.
D1 · Cyclomatic Complexity · AppModel.loadPerf (cyclomatic 16) · ×1
  • AppModel.loadPerf (cyclomatic 16) App/AppModel.swift:4970 — AppModel.loadPerf 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.
D1 · Cyclomatic Complexity · AppModel.vectorSpaceDiffers (cyclomatic 16) · ×1
  • AppModel.vectorSpaceDiffers (cyclomatic 16) App/AppModel.swift:6265 — AppModel.vectorSpaceDiffers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppModel.drainIdleUpkeep (cyclomatic 16) · ×1
  • AppModel.drainIdleUpkeep (cyclomatic 16) App/AppModel.swift:7563 — AppModel.drainIdleUpkeep has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DropIntake.read (cyclomatic 16) · ×1
  • DropIntake.read (cyclomatic 16) App/DropIntake.swift:94 — DropIntake.read has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppDelegate.dumpUIDebug (cyclomatic 16) · ×1
  • AppDelegate.dumpUIDebug (cyclomatic 16) App/OmniApp.swift:227 — AppDelegate.dumpUIDebug has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PerfScript.runIfRequested (cyclomatic 16) · ×1
  • PerfScript.runIfRequested (cyclomatic 16) App/PerfScript.swift:22 — PerfScript.runIfRequested 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. This is NOT this file's highest cyclomatic complexity: PerfScript.applySetting (cyclomatic 28) 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.
D1 · Cyclomatic Complexity · RemoteFiles.downloadOnce (cyclomatic 16) · ×1
  • RemoteFiles.downloadOnce (cyclomatic 16) App/Link/RemoteFiles.swift:143 — RemoteFiles.downloadOnce has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPAdapter.callSearchInline (cyclomatic 16) · ×1
  • MCPAdapter.callSearchInline (cyclomatic 16) App/Serving/MCPAdapter.swift:642 — MCPAdapter.callSearchInline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPAdapter.handleModern (cyclomatic 16) · ×1
  • MCPAdapter.handleModern (cyclomatic 16) App/Serving/MCPAdapter.swift:1482 — MCPAdapter.handleModern has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPAdapter.callSources (cyclomatic 16) · ×1
  • MCPAdapter.callSources (cyclomatic 16) App/Serving/MCPAdapter.swift:1653 — MCPAdapter.callSources has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Job.decode (cyclomatic 16) · ×1
  • Job.decode (cyclomatic 16) App/Serving/OCRServing.swift:280 — Job.decode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchAdapter.rows (cyclomatic 16) · ×1
  • SearchAdapter.rows (cyclomatic 16) App/Serving/SchemaAdapters.swift:471 — SearchAdapter.rows 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.
D1 · Cyclomatic Complexity · ANEHintAB.run (cyclomatic 16) · ×1
  • ANEHintAB.run (cyclomatic 16) Sources/omni-verify/ANEQuery.swift:473 — ANEHintAB.run has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · main.swift.pathbenchRun (cyclomatic 16) · ×1
  • main.swift.pathbenchRun (cyclomatic 16) Sources/omni-verify/main.swift:1578 — main.swift.pathbenchRun has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 3794) · ×1
  • main.swift.top-level code (cognitive 3794) Sources/omni-verify/main.swift:61 — main.swift.top-level code has cognitive complexity 3794 (threshold 15). Drivers by points: if/else 730 (1780 pts), loops 609 (1570 pts), ternaries 374 (883 pts), boolean chains 365, match/switch 14 (37 pts), error handling 1 (2 pts) (nesting depth added 2544). 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. This shape REPEATS in the file: 7 other methods here (main.swift.top-level code::vec, main.swift.top-level code::digest, main.swift.top-level code::compare, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 391) · ×1
  • main.swift.top-level code (cognitive 391) Sources/ocr-verify/main.swift:83 — main.swift.top-level code has cognitive complexity 391 (threshold 15). Drivers by points: if/else 75 (177 pts), loops 45 (125 pts), ternaries 19 (59 pts), boolean chains 28, match/switch 1 (2 pts) (nesting depth added 223). Of this number, 371 points are the body's own statements and 20 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Indexer.index (cognitive 335) · ×1
  • Indexer.index (cognitive 335) Sources/OmniKit/Indexer.swift:1118 — Indexer.index has cognitive complexity 335 (threshold 15). Drivers by points: if/else 167 (395 pts), loops 46 (113 pts), boolean chains 94, ternaries 18 (58 pts), error handling 2 (6 pts), match/switch 2 (5 pts) (nesting depth added 342). To reduce it, split the body into named stages: move each independent 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: 4 other methods here (Indexer.index::takeWave, Indexer.index::updateTimeLeft, Indexer.index::handleStream, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
D2 · Cognitive Complexity · PerfScript.perform (cognitive 241) · ×1
  • PerfScript.perform (cognitive 241) App/PerfScript.swift:83 — PerfScript.perform has cognitive complexity 241 (threshold 15). Drivers by points: if/else 55 (111 pts), ternaries 29 (66 pts), boolean chains 48, loops 6 (12 pts), error handling 1 (3 pts), match/switch 1 (nesting depth added 101). Of this number, 232 points are the body's own statements and 9 belong to one function item inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 228) · ×1
  • main.swift.top-level code (cognitive 228) Sources/mutbench/main.swift:9 — main.swift.top-level code has cognitive complexity 228 (threshold 15). Drivers by points: loops 34 (86 pts), if/else 35 (71 pts), ternaries 27 (65 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 127). Of this number, 199 points are the body's own statements and 29 belong to 8 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.
D2 · Cognitive Complexity · MCPAdapter.callSearch (cognitive 177) · ×1
  • MCPAdapter.callSearch (cognitive 177) App/Serving/MCPAdapter.swift:349 — MCPAdapter.callSearch has cognitive complexity 177 (threshold 15). Drivers by points: if/else 42 (86 pts), ternaries 21 (62 pts), boolean chains 14, loops 5 (14 pts), match/switch 1 (nesting depth added 94). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OCRModel.decodeContinuous (cognitive 146) · ×1
  • OCRModel.decodeContinuous (cognitive 146) Sources/OmniKit/OCR/OCRBatched.swift:189 — OCRModel.decodeContinuous has cognitive complexity 146 (threshold 15). Drivers by points: if/else 33 (74 pts), loops 16 (39 pts), boolean chains 27, ternaries 3 (6 pts) (nesting depth added 67). Of this number, 117 points are the body's own statements and 29 belong to 4 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.
D2 · Cognitive Complexity · OCRSession.run (cognitive 124) · ×1
  • OCRSession.run (cognitive 124) App/OCRSession.swift:1494 — OCRSession.run has cognitive complexity 124 (threshold 15). Drivers by points: if/else 33 (79 pts), boolean chains 18, ternaries 5 (16 pts), loops 4 (10 pts), error handling 1 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.recoverChunkTexts (cognitive 117) · ×1
  • Indexer.recoverChunkTexts (cognitive 117) Sources/OmniKit/Indexer.swift:621 — Indexer.recoverChunkTexts has cognitive complexity 117 (threshold 15). Drivers by points: if/else 23 (52 pts), loops 14 (31 pts), boolean chains 19, ternaries 5 (14 pts), match/switch 1 (nesting depth added 55). Of this number, 83 points are the body's own statements and 34 belong to 4 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ScreenText.recognize (cognitive 116) · ×1
  • ScreenText.recognize (cognitive 116) Sources/OmniKit/ScreenText.swift:111 — ScreenText.recognize has cognitive complexity 116 (threshold 15). Drivers by points: if/else 22 (66 pts), boolean chains 33, loops 7 (17 pts) (nesting depth added 54). Of this number, 110 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.reduceTopK (cognitive 116) · ×1
  • VectorStore.reduceTopK (cognitive 116) Sources/OmniKit/VectorStore.swift:8741 — VectorStore.reduceTopK has cognitive complexity 116 (threshold 15). Drivers by points: if/else 35 (79 pts), boolean chains 22, loops 6 (9 pts), ternaries 4 (6 pts) (nesting depth added 49). Of this number, 103 points are the body's own statements and 13 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VectorStore.loadIntoMemory (cognitive 114) · ×1
  • VectorStore.loadIntoMemory (cognitive 114) Sources/OmniKit/VectorStore.swift:15861 — VectorStore.loadIntoMemory has cognitive complexity 114 (threshold 15). Drivers by points: if/else 41 (93 pts), boolean chains 14, ternaries 2 (5 pts), loops 1 (2 pts) (nesting depth added 56). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · EvalCommand.evaluate (cognitive 107) · ×1
  • EvalCommand.evaluate (cognitive 107) Sources/omni-verify/Eval.swift:544 — EvalCommand.evaluate has cognitive complexity 107 (threshold 15). Drivers by points: if/else 33 (64 pts), ternaries 14 (26 pts), loops 8 (15 pts), boolean chains 2 (nesting depth added 50). Of this number, 106 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.listMatching (cognitive 106) · ×1
  • VectorStore.listMatching (cognitive 106) Sources/OmniKit/VectorStore.swift:4586 — VectorStore.listMatching has cognitive complexity 106 (threshold 15). Drivers by points: if/else 27 (70 pts), boolean chains 19, loops 7 (15 pts), ternaries 2 (nesting depth added 51). Of this number, 88 points are the body's own statements and 18 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.
D2 · Cognitive Complexity · VectorStore.rebuildBaseLocked (cognitive 106) · ×1
  • VectorStore.rebuildBaseLocked (cognitive 106) Sources/OmniKit/VectorStore.swift:14084 — VectorStore.rebuildBaseLocked has cognitive complexity 106 (threshold 15). Drivers by points: if/else 23 (49 pts), ternaries 12 (33 pts), boolean chains 21, loops 1 (3 pts) (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VectorStore.loadBySlotLocked (cognitive 105) · ×1
  • VectorStore.loadBySlotLocked (cognitive 105) Sources/OmniKit/VectorStore.swift:10752 — VectorStore.loadBySlotLocked has cognitive complexity 105 (threshold 15). Drivers by points: if/else 34 (62 pts), loops 8 (23 pts), boolean chains 16, ternaries 3 (4 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.decodeContent (cognitive 101) · ×1
  • Indexer.decodeContent (cognitive 101) Sources/OmniKit/Indexer.swift:4482 — Indexer.decodeContent has cognitive complexity 101 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 31, ternaries 3 (7 pts), match/switch 3 (6 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.tryAdoptRowSidecarLocked (cognitive 101) · ×1
  • VectorStore.tryAdoptRowSidecarLocked (cognitive 101) Sources/OmniKit/VectorStore.swift:13384 — VectorStore.tryAdoptRowSidecarLocked has cognitive complexity 101 (threshold 15). Drivers by points: if/else 29 (43 pts), boolean chains 37, ternaries 7 (12 pts), loops 6 (9 pts) (nesting depth added 22). Of this number, 95 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.update (cognitive 97) · ×1
  • Indexer.update (cognitive 97) Sources/OmniKit/Indexer.swift:3856 — Indexer.update has cognitive complexity 97 (threshold 15). Drivers by points: if/else 51 (83 pts), boolean chains 29, loops 14 (21 pts), ternaries 8 (15 pts), match/switch 2 (4 pts), error handling 1 (nesting depth added 48). To reduce it, split the body into named stages: move each independent 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 (Indexer.update::flushImagesU) 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.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 94) · ×1
  • main.swift.top-level code (cognitive 94) Sources/crawlbench/main.swift:15 — main.swift.top-level code has cognitive complexity 94 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 13 (31 pts), ternaries 6 (22 pts), boolean chains 8 (nesting depth added 52). Of this number, 92 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · TextSlice.read (cognitive 93) · ×1
  • TextSlice.read (cognitive 93) Sources/OmniKit/Passages.swift:418 — TextSlice.read has cognitive complexity 93 (threshold 15). Drivers by points: if/else 21 (46 pts), ternaries 9 (22 pts), boolean chains 15, loops 4 (9 pts), match/switch 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.enrichOne (cognitive 89) · ×1
  • Indexer.enrichOne (cognitive 89) Sources/OmniKit/Indexer.swift:3296 — Indexer.enrichOne has cognitive complexity 89 (threshold 15). Drivers by points: if/else 30 (56 pts), boolean chains 24, loops 2 (4 pts), ternaries 2 (3 pts), error handling 1, match/switch 1 (nesting depth added 29). Of this number, 84 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.applyParsedQuery (cognitive 83) · ×1
  • AppModel.applyParsedQuery (cognitive 83) App/AppModel.swift:5050 — AppModel.applyParsedQuery has cognitive complexity 83 (threshold 15). Drivers by points: if/else 25 (54 pts), ternaries 3 (11 pts), loops 3 (10 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShotBench.stillSize (cognitive 81) · ×1
  • ShotBench.stillSize (cognitive 81) Sources/omni-verify/ShotBench.swift:263 — ShotBench.stillSize has cognitive complexity 81 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 7 (19 pts), ternaries 4 (13 pts), boolean chains 10 (nesting depth added 44). Of this number, 80 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 79) · ×1
  • main.swift.top-level code (cognitive 79) Sources/OmniCLI/main.swift:14 — main.swift.top-level code has cognitive complexity 79 (threshold 15). Drivers by points: if/else 21 (60 pts), loops 2 (7 pts), ternaries 1 (5 pts), boolean chains 3, error handling 2, match/switch 1 (2 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenHistory.takeInStills · ×1
  • ScreenHistory.takeInStills::pass (cognitive 79) Sources/OmniKit/ScreenHistory.swift:1222 — ScreenHistory.takeInStills::pass has cognitive complexity 79 (threshold 15). Drivers by points: if/else 14 (48 pts), loops 4 (14 pts), ternaries 2 (8 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 51). 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. This shape REPEATS in the file: one other method here (ScreenHistory.takeInStills) 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.
D2 · Cognitive Complexity · AppModel.search (cognitive 79) · ×1
  • AppModel.search (cognitive 79) App/AppModel.swift:8183 — AppModel.search has cognitive complexity 79 (threshold 15). Drivers by points: if/else 34 (56 pts), boolean chains 13, ternaries 5 (10 pts) (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.
D2 · Cognitive Complexity · ShotBench.run (cognitive 78) · ×1
  • ShotBench.run (cognitive 78) Sources/omni-verify/ShotBench.swift:895 — ShotBench.run has cognitive complexity 78 (threshold 15). Drivers by points: if/else 23 (34 pts), loops 14 (24 pts), ternaries 5 (12 pts), boolean chains 4, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 30). Of this number, 75 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.tryAdoptQuantReplicaLocked (cognitive 77) · ×1
  • VectorStore.tryAdoptQuantReplicaLocked (cognitive 77) Sources/OmniKit/VectorStore.swift:9221 — VectorStore.tryAdoptQuantReplicaLocked has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 50, if/else 20 (25 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PaperSuite.run (cognitive 77) · ×1
  • PaperSuite.run (cognitive 77) Sources/OmniKit/Paper/PaperSuite.swift:280 — PaperSuite.run has cognitive complexity 77 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 12, error handling 4 (12 pts), ternaries 6 (9 pts), match/switch 1 (2 pts), loops 1 (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.
D2 · Cognitive Complexity · Indexer.pipeline (cognitive 75) · ×1
  • Indexer.pipeline (cognitive 75) Sources/OmniKit/Indexer.swift:4263 — Indexer.pipeline has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 18, loops 4 (6 pts), ternaries 1 (3 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.
D2 · Cognitive Complexity · VectorStore.init (cognitive 72) · ×1
  • VectorStore.init (cognitive 72) Sources/OmniKit/VectorStore.swift:2522 — VectorStore.init has cognitive complexity 72 (threshold 15). Drivers by points: if/else 27 (45 pts), boolean chains 19, loops 2 (4 pts), ternaries 3 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownBlock.parseUncached (cognitive 71) · ×1
  • MarkdownBlock.parseUncached (cognitive 71) App/MarkdownBlock.swift:226 — MarkdownBlock.parseUncached has cognitive complexity 71 (threshold 15). Drivers by points: if/else 18 (47 pts), loops 6 (16 pts), boolean chains 8 (nesting depth added 39). Of this number, 70 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchArgs.filter (cognitive 68) · ×1
  • SearchArgs.filter (cognitive 68) App/Serving/SearchArgs.swift:20 — SearchArgs.filter has cognitive complexity 68 (threshold 15). Drivers by points: if/else 30 (56 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.bootstrap (cognitive 66) · ×1
  • AppModel.bootstrap (cognitive 66) App/AppModel.swift:5838 — AppModel.bootstrap has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (46 pts), ternaries 5 (10 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts), error handling 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.storeStreamedText (cognitive 63) · ×1
  • Indexer.storeStreamedText (cognitive 63) Sources/OmniKit/Indexer.swift:3674 — Indexer.storeStreamedText has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 11, ternaries 5 (10 pts), loops 4 (8 pts), match/switch 1 (3 pts), error handling 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.migrateScanKind (cognitive 61) · ×1
  • VectorStore.migrateScanKind (cognitive 61) Sources/OmniKit/VectorStore.swift:2915 — VectorStore.migrateScanKind has cognitive complexity 61 (threshold 15). Drivers by points: if/else 24 (39 pts), boolean chains 8, ternaries 4 (8 pts), loops 3 (6 pts) (nesting depth added 22). Of this number, 58 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.reduceTopKGPULocked (cognitive 61) · ×1
  • VectorStore.reduceTopKGPULocked (cognitive 61) Sources/OmniKit/VectorStore.swift:8569 — VectorStore.reduceTopKGPULocked has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 13, loops 5 (8 pts), ternaries 4, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.stampVectorCoverageLocked (cognitive 61) · ×1
  • VectorStore.stampVectorCoverageLocked (cognitive 61) Sources/OmniKit/VectorStore.swift:13075 — VectorStore.stampVectorCoverageLocked has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 21, ternaries 4 (8 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.recomputeResults (cognitive 60) · ×1
  • AppModel.recomputeResults (cognitive 60) App/AppModel.swift:4077 — AppModel.recomputeResults has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 5 (12 pts), boolean chains 7, ternaries 3 (6 pts), match/switch 2 (nesting depth added 22). Of this number, 58 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.churnbenchRun (cognitive 60) · ×1
  • main.swift.churnbenchRun (cognitive 60) Sources/omni-verify/main.swift:128 — main.swift.churnbenchRun has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (29 pts), loops 12 (17 pts), boolean chains 7, ternaries 5 (7 pts) (nesting depth added 18). Of this number, 58 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · main.swift.arguments (cognitive 59) · ×1
  • main.swift.arguments (cognitive 59) Sources/OmniCLI/main.swift:320 — main.swift.arguments has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (37 pts), ternaries 4 (10 pts), boolean chains 6, match/switch 2 (4 pts), loops 2 (nesting depth added 26). Of this number, 50 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniIgnore.inSet (cognitive 59) · ×1
  • OmniIgnore.inSet (cognitive 59) Sources/OmniKit/OmniIgnore.swift:547 — OmniIgnore.inSet has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (47 pts), boolean chains 6, match/switch 2 (5 pts), loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.searchCandidatesLocked (cognitive 59) · ×1
  • VectorStore.searchCandidatesLocked (cognitive 59) Sources/OmniKit/VectorStore.swift:7602 — VectorStore.searchCandidatesLocked has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 13, loops 6 (10 pts), ternaries 6 (nesting depth added 10). Of this number, 41 points are the body's own statements and 18 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VectorStore.rerankLocked (cognitive 59) · ×1
  • VectorStore.rerankLocked (cognitive 59) Sources/OmniKit/VectorStore.swift:7831 — VectorStore.rerankLocked has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 12, loops 7 (8 pts) (nesting depth added 19). Of this number, 47 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IWorkText.storages (cognitive 58) · ×1
  • IWorkText.storages (cognitive 58) Sources/OmniKit/IWorkText.swift:73 — IWorkText.storages has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 5 (12 pts), boolean chains 9 (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.
D2 · Cognitive Complexity · VectorStore.relocateTailSliceLocked (cognitive 58) · ×1
  • VectorStore.relocateTailSliceLocked (cognitive 58) Sources/OmniKit/VectorStore.swift:12539 — VectorStore.relocateTailSliceLocked has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 14, loops 9 (12 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OCRModel.decodeGroup (cognitive 58) · ×1
  • OCRModel.decodeGroup (cognitive 58) Sources/OmniKit/OCR/OCRBatched.swift:558 — OCRModel.decodeGroup has cognitive complexity 58 (threshold 15). Drivers by points: loops 10 (25 pts), if/else 10 (23 pts), boolean chains 5, ternaries 2 (5 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.
D2 · Cognitive Complexity · ActivityTab.body (cognitive 57) · ×1
  • ActivityTab.body (cognitive 57) App/SettingsView.swift:308 — ActivityTab.body has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 24, if/else 16 (18 pts), ternaries 8 (15 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.
D2 · Cognitive Complexity · Indexer.embedGroupsReusing (cognitive 56) · ×1
  • Indexer.embedGroupsReusing (cognitive 56) Sources/OmniKit/Indexer.swift:467 — Indexer.embedGroupsReusing has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 9 (19 pts), boolean chains 5 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VectorStore.vectorsUnderFolder (cognitive 56) · ×1
  • VectorStore.vectorsUnderFolder (cognitive 56) Sources/OmniKit/VectorStore.swift:6187 — VectorStore.vectorsUnderFolder has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 10 (17 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 22). Of this number, 55 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.searchDense (cognitive 56) · ×1
  • VectorStore.searchDense (cognitive 56) Sources/OmniKit/VectorStore.swift:7133 — VectorStore.searchDense has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 27, ternaries 7 (9 pts), loops 1 (2 pts) (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. This shape REPEATS in the file: one other method here (VectorStore.searchDense::coarseFastPathLocked) 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.
D2 · Cognitive Complexity · OCRSession.runGroup (cognitive 55) · ×1
  • OCRSession.runGroup (cognitive 55) App/OCRSession.swift:1761 — OCRSession.runGroup has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (28 pts), boolean chains 15, loops 5 (7 pts), ternaries 2 (5 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ANETextBackend.encode (cognitive 54) · ×1
  • ANETextBackend.encode (cognitive 54) Sources/OmniKit/ANETextBackend.swift:214 — ANETextBackend.encode has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 8 (18 pts), boolean chains 10 (nesting depth added 23). Of this number, 53 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniEngine.setComputeUnit (cognitive 54) · ×1
  • OmniEngine.setComputeUnit (cognitive 54) Sources/OmniKit/OmniEngine.swift:873 — OmniEngine.setComputeUnit has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (36 pts), ternaries 5 (7 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 21). Of this number, 50 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · Indexer.chunk (cognitive 53) · ×1
  • Indexer.chunk (cognitive 53) Sources/OmniKit/Indexer.swift:5338 — Indexer.chunk has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 5 (12 pts), ternaries 3 (9 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 30). Of this number, 45 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.compactRowsLocked (cognitive 53) · ×1
  • VectorStore.compactRowsLocked (cognitive 53) Sources/OmniKit/VectorStore.swift:15582 — VectorStore.compactRowsLocked has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 5 (10 pts), boolean chains 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPAdapter.invalidArgument (cognitive 53) · ×1
  • MCPAdapter.invalidArgument (cognitive 53) App/Serving/MCPAdapter.swift:1356 — MCPAdapter.invalidArgument has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 14, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 24). Of this number, 50 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 53) · ×1
  • main.swift.top-level code (cognitive 53) Sources/opentime/main.swift:7 — main.swift.top-level code has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 9 (17 pts), loops 6 (11 pts), boolean chains 5 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaDuration.isoMovie (cognitive 52) · ×1
  • MediaDuration.isoMovie (cognitive 52) Sources/OmniKit/MediaDuration.swift:31 — MediaDuration.isoMovie has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 4 (20 pts), boolean chains 7, loops 3 (5 pts) (nesting depth added 27). Of this number, 40 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · AppModel.catchUpPendingRoots (cognitive 52) · ×1
  • AppModel.catchUpPendingRoots (cognitive 52) App/AppModel.swift:7249 — AppModel.catchUpPendingRoots has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 27, if/else 13 (20 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ANEQuery.engine (cognitive 52) · ×1
  • ANEQuery.engine (cognitive 52) Sources/omni-verify/ANEQuery.swift:207 — ANEQuery.engine has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 6 (9 pts), boolean chains 7, ternaries 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 23). Of this number, 44 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · main.swift.rpc (cognitive 51) · ×1
  • main.swift.rpc (cognitive 51) Sources/OmniCLI/main.swift:202 — main.swift.rpc has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (27 pts), error handling 3 (10 pts), ternaries 3 (9 pts), loops 1 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · ShotBench.neighbour (cognitive 50) · ×1
  • ShotBench.neighbour (cognitive 50) Sources/omni-verify/ShotBench.swift:579 — ShotBench.neighbour has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 5 (20 pts), loops 4 (9 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.audiosegcheckRun (cognitive 50) · ×1
  • main.swift.audiosegcheckRun (cognitive 50) Sources/omni-verify/main.swift:7276 — main.swift.audiosegcheckRun has cognitive complexity 50 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 14 (20 pts), boolean chains 5, ternaries 3 (nesting depth added 19). Of this number, 38 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · ANEAudioBackend.encode (cognitive 49) · ×1
  • ANEAudioBackend.encode (cognitive 49) Sources/OmniKit/ANEAudioBackend.swift:87 — ANEAudioBackend.encode has cognitive complexity 49 (threshold 15). Drivers by points: loops 14 (25 pts), boolean chains 10, if/else 7 (8 pts), ternaries 2 (6 pts) (nesting depth added 16). 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.
D2 · Cognitive Complexity · Indexer.embedPagePictures (cognitive 49) · ×1
  • Indexer.embedPagePictures (cognitive 49) Sources/OmniKit/Indexer.swift:5164 — Indexer.embedPagePictures has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 5 (12 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 24). Of this number, 42 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.loadFromCoverageLocked (cognitive 49) · ×1
  • VectorStore.loadFromCoverageLocked (cognitive 49) Sources/OmniKit/VectorStore.swift:11075 — VectorStore.loadFromCoverageLocked has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 14, ternaries 3 (6 pts), loops 3 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.sameVectorSpace (cognitive 48) · ×1
  • Indexer.sameVectorSpace (cognitive 48) Sources/OmniKit/Indexer.swift:2449 — Indexer.sameVectorSpace has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (11 pts), ternaries 7 (11 pts), boolean chains 8 (nesting depth added 17). Of this number, 47 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.mediaTurn (cognitive 48) · ×1
  • Indexer.mediaTurn (cognitive 48) Sources/OmniKit/Indexer.swift:2815 — Indexer.mediaTurn has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 20, if/else 16 (20 pts), ternaries 3 (5 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 7). Of this number, 41 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SearchQueryParser.parse (cognitive 48) · ×1
  • SearchQueryParser.parse (cognitive 48) Sources/OmniKit/SearchQueryParser.swift:98 — SearchQueryParser.parse has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 6 (15 pts), boolean chains 11 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.acceptedFilesLocked (cognitive 48) · ×1
  • VectorStore.acceptedFilesLocked (cognitive 48) Sources/OmniKit/VectorStore.swift:8141 — VectorStore.acceptedFilesLocked has cognitive complexity 48 (threshold 15). Drivers by points: loops 13 (29 pts), if/else 10 (16 pts), boolean chains 3 (nesting depth added 22). 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.
D2 · Cognitive Complexity · VectorStore.rankChunksAcross (cognitive 48) · ×1
  • VectorStore.rankChunksAcross (cognitive 48) Sources/OmniKit/VectorStore.swift:14601 — VectorStore.rankChunksAcross has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 8, loops 5 (8 pts), ternaries 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Indexer.embed (cognitive 47) · ×1
  • Indexer.embed (cognitive 47) Sources/OmniKit/Indexer.swift:4844 — Indexer.embed has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (22 pts), ternaries 5 (14 pts), loops 4 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · VectorStore.deleteProvenOrphanTwins (cognitive 47) · ×1
  • VectorStore.deleteProvenOrphanTwins (cognitive 47) Sources/OmniKit/VectorStore.swift:11369 — VectorStore.deleteProvenOrphanTwins has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 11, loops 7 (10 pts), ternaries 1 (nesting depth added 13). Of this number, 43 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Snappy.decodeBlock (cognitive 46) · ×1
  • Snappy.decodeBlock (cognitive 46) Sources/OmniKit/IWorkText.swift:202 — Snappy.decodeBlock has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 3 (8 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenRecorder.capture (cognitive 46) · ×1
  • ScreenRecorder.capture (cognitive 46) App/ScreenRecorder.swift:299 — ScreenRecorder.capture has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 5 (13 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · PagePhrase.unique (cognitive 45) · ×1
  • PagePhrase.unique (cognitive 45) Sources/OmniKit/PagePhrase.swift:107 — PagePhrase.unique has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 8, loops 4 (8 pts), ternaries 3 (5 pts) (nesting depth added 17). Of this number, 37 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.migrateToV4Locked (cognitive 45) · ×1
  • VectorStore.migrateToV4Locked (cognitive 45) Sources/OmniKit/VectorStore.swift:18301 — VectorStore.migrateToV4Locked has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 10 (12 pts), boolean chains 9 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPAdapter.callReadFile (cognitive 45) · ×1
  • MCPAdapter.callReadFile (cognitive 45) App/Serving/MCPAdapter.swift:767 — MCPAdapter.callReadFile has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 9 (13 pts), boolean chains 11, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectionEngine.pca2DBasis (cognitive 44) · ×1
  • ProjectionEngine.pca2DBasis (cognitive 44) Sources/OmniKit/ProjectionEngine.swift:311 — ProjectionEngine.pca2DBasis has cognitive complexity 44 (threshold 15). Drivers by points: loops 17 (35 pts), if/else 5 (9 pts) (nesting depth added 22). Of this number, 41 points are the body's own statements and 3 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.
D2 · Cognitive Complexity · VectorStore.deleteFilesInSlices (cognitive 44) · ×1
  • VectorStore.deleteFilesInSlices (cognitive 44) Sources/OmniKit/VectorStore.swift:3744 — VectorStore.deleteFilesInSlices has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 8, ternaries 2 (5 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FolderEmbeddingVisualization.rebuildPoints (cognitive 44) · ×1
  • FolderEmbeddingVisualization.rebuildPoints (cognitive 44) App/FolderEmbeddingVisualization.swift:393 — FolderEmbeddingVisualization.rebuildPoints has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 7 (13 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OCRServing.parsePages (cognitive 44) · ×1
  • OCRServing.parsePages (cognitive 44) App/Serving/OCRServing.swift:140 — OCRServing.parsePages has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 3 (8 pts), boolean chains 6, ternaries 3 (4 pts) (nesting depth added 19). Of this number, 39 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShotBench.reader (cognitive 44) · ×1
  • ShotBench.reader (cognitive 44) Sources/omni-verify/ShotBench.swift:641 — ShotBench.reader has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 7 (13 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaperReport.appendCases (cognitive 43) · ×1
  • PaperReport.appendCases (cognitive 43) Sources/OmniKit/Paper/PaperReport.swift:384 — PaperReport.appendCases has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 6 (15 pts), ternaries 3 (8 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResultsList.menu (cognitive 42) · ×1
  • ResultsList.menu (cognitive 42) App/ResultsList.swift:481 — ResultsList.menu has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 3 (11 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatOCRAdapter.handle (cognitive 42) · ×1
  • ChatOCRAdapter.handle (cognitive 42) App/Serving/OCRAdapters.swift:54 — ChatOCRAdapter.handle has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (26 pts), match/switch 5 (8 pts), boolean chains 3, ternaries 2 (3 pts), loops 2 (nesting depth added 12). Of this number, 41 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.measureSlotOffset (cognitive 41) · ×1
  • VectorStore.measureSlotOffset (cognitive 41) Sources/OmniKit/VectorStore.swift:11675 — VectorStore.measureSlotOffset has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 7, loops 3 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ANEHintAB.pair (cognitive 41) · ×1
  • ANEHintAB.pair (cognitive 41) Sources/omni-verify/ANEQuery.swift:543 — ANEHintAB.pair has cognitive complexity 41 (threshold 15). Drivers by points: loops 11 (23 pts), ternaries 2 (9 pts), if/else 4 (8 pts), boolean chains 1 (nesting depth added 23). 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.
D2 · Cognitive Complexity · OmniImageEncoder.encodeChunk (cognitive 40) · ×1
  • OmniImageEncoder.encodeChunk (cognitive 40) Sources/OmniKit/OmniImageEncoder.swift:125 — OmniImageEncoder.encodeChunk has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 12 (13 pts), loops 3 (4 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.
D2 · Cognitive Complexity · VectorStore.writeChunksLocked (cognitive 40) · ×1
  • VectorStore.writeChunksLocked (cognitive 40) Sources/OmniKit/VectorStore.swift:16809 — VectorStore.writeChunksLocked has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PassageWindow.best (cognitive 39) · ×1
  • PassageWindow.best (cognitive 39) Sources/OmniKit/Passages.swift:57 — PassageWindow.best has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 9 (13 pts), boolean chains 4 (nesting depth added 14). Of this number, 29 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextSlice.find (cognitive 39) · ×1
  • TextSlice.find (cognitive 39) Sources/OmniKit/Passages.swift:568 — TextSlice.find has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 4 (8 pts), boolean chains 4, ternaries 2 (4 pts), match/switch 2 (nesting depth added 13). Of this number, 31 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniEngine.embedFileQuery (cognitive 38) · ×1
  • OmniEngine.embedFileQuery (cognitive 38) Sources/OmniKit/OmniEngine.swift:1907 — OmniEngine.embedFileQuery has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 8 (23 pts), if/else 3 (9 pts), loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · IndexStatusRow.body (cognitive 38) · ×1
  • IndexStatusRow.body (cognitive 38) App/SettingsView.swift:178 — IndexStatusRow.body has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (25 pts), ternaries 3 (8 pts), boolean chains 4, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Sidebar.body (cognitive 38) · ×1
  • Sidebar.body (cognitive 38) App/Sidebar.swift:271 — Sidebar.body has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 6, match/switch 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LexicalIndex.refreshIncrementally (cognitive 37) · ×1
  • LexicalIndex.refreshIncrementally (cognitive 37) Sources/OmniKit/LexicalIndex.swift:229 — LexicalIndex.refreshIncrementally has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 7 (10 pts), boolean chains 6, ternaries 1 (nesting depth added 10). Of this number, 33 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.
D2 · Cognitive Complexity · ProjectionEngine.project (cognitive 37) · ×1
  • ProjectionEngine.project (cognitive 37) Sources/OmniKit/ProjectionEngine.swift:64 — ProjectionEngine.project has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (26 pts), loops 3 (5 pts), boolean chains 3, ternaries 3 (nesting depth added 10). Of this number, 30 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OCRModel.decodePrepared (cognitive 37) · ×1
  • OCRModel.decodePrepared (cognitive 37) Sources/OmniKit/OCR/OCRSpeculative.swift:118 — OCRModel.decodePrepared has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 5 (10 pts), boolean chains 6, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.drainPendingFSChanges (cognitive 37) · ×1
  • AppModel.drainPendingFSChanges (cognitive 37) App/AppModel.swift:9413 — AppModel.drainPendingFSChanges has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 21, if/else 14 (16 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FolderEmbeddingVisualization.body (cognitive 37) · ×1
  • FolderEmbeddingVisualization.body (cognitive 37) App/FolderEmbeddingVisualization.swift:58 — FolderEmbeddingVisualization.body has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 5 (10 pts), boolean chains 6, loops 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · ContentChunker.cutPoints (cognitive 36) · ×1
  • ContentChunker.cutPoints (cognitive 36) Sources/OmniKit/ContentChunker.swift:126 — ContentChunker.cutPoints has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.reclaimVectorHolesBodyLocked (cognitive 36) · ×1
  • VectorStore.reclaimVectorHolesBodyLocked (cognitive 36) Sources/OmniKit/VectorStore.swift:12709 — VectorStore.reclaimVectorHolesBodyLocked has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 7, loops 4 (nesting depth added 5). Of this number, 33 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · VectorStore.persistSlotsLocked (cognitive 36) · ×1
  • VectorStore.persistSlotsLocked (cognitive 36) Sources/OmniKit/VectorStore.swift:17981 — VectorStore.persistSlotsLocked has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3 (9 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.startIndexing (cognitive 36) · ×1
  • AppModel.startIndexing (cognitive 36) App/AppModel.swift:8855 — AppModel.startIndexing has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 10, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · OCRSession.open (cognitive 36) · ×1
  • OCRSession.open (cognitive 36) App/OCRSession.swift:875 — OCRSession.open has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 2 (4 pts), boolean chains 3, match/switch 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.
D2 · Cognitive Complexity · index.html.renderHistory (cognitive 36) · ×1
  • index.html.renderHistory (cognitive 36) site/omni/index.html:923 — index.html.renderHistory has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 16, if/else 8 (10 pts), ternaries 7, loops 3 (nesting depth added 2). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 1018, yVal, a function literal at line 950, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PathTable.folders (cognitive 35) · ×1
  • PathTable.folders (cognitive 35) Sources/OmniKit/PathTable.swift:91 — PathTable.folders has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 5 (14 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectionEngine.gridify (cognitive 35) · ×1
  • ProjectionEngine.gridify (cognitive 35) Sources/OmniKit/ProjectionEngine.swift:509 — ProjectionEngine.gridify has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 10, loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenHistory.walk (cognitive 35) · ×1
  • ScreenHistory.walk (cognitive 35) Sources/OmniKit/ScreenHistory.swift:421 — ScreenHistory.walk has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 7, loops 3 (4 pts), ternaries 1 (nesting depth added 12). Of this number, 30 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.repointSurvivorsOfReleasedLocked (cognitive 35) · ×1
  • VectorStore.repointSurvivorsOfReleasedLocked (cognitive 35) Sources/OmniKit/VectorStore.swift:10437 — VectorStore.repointSurvivorsOfReleasedLocked has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (8 pts), boolean chains 7 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.bitScanCPU (cognitive 35) · ×1
  • VectorStore.bitScanCPU (cognitive 35) Sources/OmniKit/VectorStore.swift:13974 — VectorStore.bitScanCPU has cognitive complexity 35 (threshold 15). Drivers by points: loops 8 (23 pts), ternaries 1 (5 pts), boolean chains 4, if/else 3 (nesting depth added 19). 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.
D2 · Cognitive Complexity · WeightStore.init (cognitive 35) · ×1
  • WeightStore.init (cognitive 35) Sources/OmniKit/WeightStore.swift:24 — WeightStore.init has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 11, loops 6 (7 pts), ternaries 2 (3 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.applyResults (cognitive 35) · ×1
  • AppModel.applyResults (cognitive 35) App/AppModel.swift:8081 — AppModel.applyResults has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelAB.measureQueryWait (cognitive 35) · ×1
  • KernelAB.measureQueryWait (cognitive 35) Sources/omni-verify/KernelAB.swift:149 — KernelAB.measureQueryWait has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileCrawler.walkLegacy (cognitive 34) · ×1
  • FileCrawler.walkLegacy (cognitive 34) Sources/OmniKit/FileCrawler.swift:245 — FileCrawler.walkLegacy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenHistory.rewrite (cognitive 34) · ×1
  • ScreenHistory.rewrite (cognitive 34) Sources/OmniKit/ScreenHistory.swift:1406 — ScreenHistory.rewrite has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.restoreCoveredBlobsLocked (cognitive 34) · ×1
  • VectorStore.restoreCoveredBlobsLocked (cognitive 34) Sources/OmniKit/VectorStore.swift:10617 — VectorStore.restoreCoveredBlobsLocked has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 10, ternaries 4 (5 pts), loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VectorStore.repairIndex (cognitive 34) · ×1
  • VectorStore.repairIndex (cognitive 34) Sources/OmniKit/VectorStore.swift:11563 — VectorStore.repairIndex has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 8, ternaries 3 (5 pts), match/switch 2 (nesting depth added 8). Of this number, 32 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPAdapter.readPicture (cognitive 34) · ×1
  • MCPAdapter.readPicture (cognitive 34) App/Serving/MCPAdapter.swift:824 — MCPAdapter.readPicture has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.swift.rowwindowcheckRun (cognitive 34) · ×1
  • main.swift.rowwindowcheckRun (cognitive 34) Sources/omni-verify/main.swift:1030 — main.swift.rowwindowcheckRun has cognitive complexity 34 (threshold 15). Drivers by points: loops 9 (13 pts), ternaries 6 (8 pts), boolean chains 7, if/else 4, match/switch 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 10 of the 34 points are its own statements and the rest belongs to 3 function items inside it that branch (observe, run, reopen). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Indexer.anchorStarts (cognitive 33) · ×1
  • Indexer.anchorStarts (cognitive 33) Sources/OmniKit/Indexer.swift:820 — Indexer.anchorStarts has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 20, loops 4 (8 pts) (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. This shape REPEATS in the file: one other method here (Indexer.anchorStarts::matches) 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.
D2 · Cognitive Complexity · OmniAudioTower.forwardImpl (cognitive 33) · ×1
  • OmniAudioTower.forwardImpl (cognitive 33) Sources/OmniKit/OmniAudioTower.swift:84 — OmniAudioTower.forwardImpl has cognitive complexity 33 (threshold 15). Drivers by points: loops 11 (17 pts), if/else 6 (10 pts), ternaries 3 (6 pts) (nesting depth added 13). 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.
D2 · Cognitive Complexity · VectorStore.fileFactsToCorrectLocked (cognitive 33) · ×1
  • VectorStore.fileFactsToCorrectLocked (cognitive 33) Sources/OmniKit/VectorStore.swift:13665 — VectorStore.fileFactsToCorrectLocked has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 11, loops 3, match/switch 1 (2 pts) (nesting depth added 9). Of this number, 31 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkNode.pairingHandler (cognitive 33) · ×1
  • LinkNode.pairingHandler (cognitive 33) Sources/OmniLink/LinkNode.swift:776 — LinkNode.pairingHandler has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, error handling 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.readIdentifiers (cognitive 32) · ×1
  • Indexer.readIdentifiers (cognitive 32) Sources/OmniKit/Indexer.swift:2956 — Indexer.readIdentifiers has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 6 (10 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.selectMaskLocked (cognitive 32) · ×1
  • VectorStore.selectMaskLocked (cognitive 32) Sources/OmniKit/VectorStore.swift:8334 — VectorStore.selectMaskLocked has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 9, loops 1 (2 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.scheduleTagBackfill (cognitive 32) · ×1
  • AppModel.scheduleTagBackfill (cognitive 32) App/AppModel.swift:9327 — AppModel.scheduleTagBackfill has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 20, if/else 9 (12 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OmniCommands.body (cognitive 32) · ×1
  • OmniCommands.body (cognitive 32) App/OmniApp.swift:400 — OmniCommands.body has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, ternaries 10 (12 pts), if/else 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · IWorkText.extract (cognitive 31) · ×1
  • IWorkText.extract (cognitive 31) Sources/OmniKit/IWorkText.swift:26 — IWorkText.extract has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniIgnore.parseSet (cognitive 31) · ×1
  • OmniIgnore.parseSet (cognitive 31) Sources/OmniKit/OmniIgnore.swift:510 — OmniIgnore.parseSet has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 11, loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniTagger.finalize (cognitive 31) · ×1
  • OmniTagger.finalize (cognitive 31) Sources/OmniKit/OmniTagger.swift:275 — OmniTagger.finalize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 5 (8 pts), boolean chains 4, ternaries 3 (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.
D2 · Cognitive Complexity · OmniVideoPreprocess.preprocessRaw (cognitive 31) · ×1
  • OmniVideoPreprocess.preprocessRaw (cognitive 31) Sources/OmniKit/OmniVideoPreprocess.swift:58 — OmniVideoPreprocess.preprocessRaw has cognitive complexity 31 (threshold 15). Drivers by points: loops 8 (24 pts), ternaries 1 (5 pts), if/else 2 (nesting depth added 20). 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.
D2 · Cognitive Complexity · VectorStore.folderAggregates (cognitive 31) · ×1
  • VectorStore.folderAggregates (cognitive 31) Sources/OmniKit/VectorStore.swift:5861 — VectorStore.folderAggregates has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 8, ternaries 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.pooledFilesLocked (cognitive 31) · ×1
  • VectorStore.pooledFilesLocked (cognitive 31) Sources/OmniKit/VectorStore.swift:6117 — VectorStore.pooledFilesLocked has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 7 (10 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TagAdapter.handle (cognitive 31) · ×1
  • TagAdapter.handle (cognitive 31) App/Serving/SchemaAdapters.swift:778 — TagAdapter.handle has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 4, ternaries 2 (3 pts), loops 2 (nesting depth added 6). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ShotBench.frameEmbed (cognitive 31) · ×1
  • ShotBench.frameEmbed (cognitive 31) Sources/omni-verify/ShotBench.swift:703 — ShotBench.frameEmbed has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 6 (12 pts), boolean chains 6 (nesting depth added 11). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 3 function items inside it that branch (video, cos, line). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · index.benchAggregate (cognitive 31) · ×1
  • index.benchAggregate (cognitive 31) worker/src/index.ts:545 — index.benchAggregate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (9 pts), loops 3 (6 pts), error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PassageRecovery.texts (cognitive 30) · ×1
  • PassageRecovery.texts (cognitive 30) Sources/OmniKit/Passages.swift:316 — PassageRecovery.texts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 6 (10 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.orphanSlotsLocked (cognitive 30) · ×1
  • VectorStore.orphanSlotsLocked (cognitive 30) Sources/OmniKit/VectorStore.swift:1663 — VectorStore.orphanSlotsLocked has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 2 (4 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · VectorStore.bestChunkScoreLocked (cognitive 30) · ×1
  • VectorStore.bestChunkScoreLocked (cognitive 30) Sources/OmniKit/VectorStore.swift:4880 — VectorStore.bestChunkScoreLocked has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 8, loops 5 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.rankChunks (cognitive 30) · ×1
  • VectorStore.rankChunks (cognitive 30) Sources/OmniKit/VectorStore.swift:14476 — VectorStore.rankChunks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 8, loops 2 (4 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.backfillSlotsLocked (cognitive 30) · ×1
  • VectorStore.backfillSlotsLocked (cognitive 30) Sources/OmniKit/VectorStore.swift:17873 — VectorStore.backfillSlotsLocked has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 5, loops 2 (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.
D2 · Cognitive Complexity · OCRWeights.init (cognitive 30) · ×1
  • OCRWeights.init (cognitive 30) Sources/OmniKit/OCR/OCRWeights.swift:170 — OCRWeights.init has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 6 (7 pts), boolean chains 6, match/switch 1 (2 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentView.searchSuggestions (cognitive 30) · ×1
  • ContentView.searchSuggestions (cognitive 30) App/ContentView.swift:487 — ContentView.searchSuggestions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (12 pts), loops 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FolderRow.body (cognitive 30) · ×1
  • FolderRow.body (cognitive 30) App/Sidebar.swift:1087 — FolderRow.body has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, if/else 8 (10 pts), ternaries 3 (4 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MCPAdapter.callFileStatus (cognitive 30) · ×1
  • MCPAdapter.callFileStatus (cognitive 30) App/Serving/MCPAdapter.swift:935 — MCPAdapter.callFileStatus has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 4 (10 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 30) · ×1
  • main.swift.top-level code (cognitive 30) Sources/searchbench/main.swift:11 — main.swift.top-level code has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 9 (11 pts), ternaries 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ANETextBackend.inputs (cognitive 29) · ×1
  • ANETextBackend.inputs (cognitive 29) Sources/OmniKit/ANETextBackend.swift:339 — ANETextBackend.inputs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (9 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.storedTags (cognitive 29) · ×1
  • VectorStore.storedTags (cognitive 29) Sources/OmniKit/VectorStore.swift:4501 — VectorStore.storedTags has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (10 pts), ternaries 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · VectorStore.streamedVectorsUnderFolder (cognitive 29) · ×1
  • VectorStore.streamedVectorsUnderFolder (cognitive 29) Sources/OmniKit/VectorStore.swift:6363 — VectorStore.streamedVectorsUnderFolder has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (37 pts), loops 7 (11 pts), boolean chains 10, ternaries 5 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent 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 (VectorStore.streamedVectorsUnderFolder::walk::stepLocked) 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.
D2 · Cognitive Complexity · VectorStore.persistQuantReplicaLocked (cognitive 29) · ×1
  • VectorStore.persistQuantReplicaLocked (cognitive 29) Sources/OmniKit/VectorStore.swift:9152 — VectorStore.persistQuantReplicaLocked has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, if/else 11 (13 pts), error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · VectorStore.buildChunkSplitLocked (cognitive 29) · ×1
  • VectorStore.buildChunkSplitLocked (cognitive 29) Sources/OmniKit/VectorStore.swift:17527 — VectorStore.buildChunkSplitLocked has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 6, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaperCorpus.writeVideo (cognitive 29) · ×1
  • PaperCorpus.writeVideo (cognitive 29) Sources/OmniKit/Paper/PaperCorpus.swift:489 — PaperCorpus.writeVideo has cognitive complexity 29 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 5 (12 pts), boolean chains 2 (nesting depth added 17). 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.
D2 · Cognitive Complexity · Coordinator.handle (cognitive 29) · ×1
  • Coordinator.handle (cognitive 29) App/ContentKeys.swift:100 — Coordinator.handle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 12, ternaries 1 (2 pts), 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.
D2 · Cognitive Complexity · ContentView.body (cognitive 29) · ×1
  • ContentView.body (cognitive 29) App/ContentView.swift:64 — ContentView.body has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 11, ternaries 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MCPAdapter.callSearchInline (cognitive 29) · ×1
  • MCPAdapter.callSearchInline (cognitive 29) App/Serving/MCPAdapter.swift:642 — MCPAdapter.callSearchInline has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchAdapter.handle (cognitive 29) · ×1
  • SearchAdapter.handle (cognitive 29) App/Serving/SchemaAdapters.swift:365 — SearchAdapter.handle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 4 (6 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.top-level code (cognitive 29) · ×1
  • main.swift.top-level code (cognitive 29) Sources/linktool/main.swift:26 — main.swift.top-level code has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · ANEQuery.vision (cognitive 29) · ×1
  • ANEQuery.vision (cognitive 29) Sources/omni-verify/ANEQuery.swift:134 — ANEQuery.vision has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (10 pts), boolean chains 4, ternaries 1 (nesting depth added 10). Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.videosegcheckRun (cognitive 29) · ×1
  • main.swift.videosegcheckRun (cognitive 29) Sources/omni-verify/main.swift:7413 — main.swift.videosegcheckRun has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (8 pts), ternaries 5 (7 pts), boolean chains 2 (nesting depth added 9). Of this number, 21 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · ANETextBackend.runLayers (cognitive 28) · ×1
  • ANETextBackend.runLayers (cognitive 28) Sources/OmniKit/ANETextBackend.swift:406 — ANETextBackend.runLayers has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 6 (8 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BulkDirWalker.list (cognitive 28) · ×1
  • BulkDirWalker.list (cognitive 28) Sources/OmniKit/BulkDirWalker.swift:60 — BulkDirWalker.list has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Zip.entries (cognitive 28) · ×1
  • Zip.entries (cognitive 28) Sources/OmniKit/IWorkText.swift:251 — Zip.entries has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 8, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.streamedAudio (cognitive 28) · ×1
  • Indexer.streamedAudio (cognitive 28) Sources/OmniKit/Indexer.swift:5064 — Indexer.streamedAudio has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 3 (5 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · VectorStore.replaceMany (cognitive 28) · ×1
  • VectorStore.replaceMany (cognitive 28) Sources/OmniKit/VectorStore.swift:3235 — VectorStore.replaceMany has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (5 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.pooledVectors (cognitive 28) · ×1
  • VectorStore.pooledVectors (cognitive 28) Sources/OmniKit/VectorStore.swift:15043 — VectorStore.pooledVectors has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 5 (6 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.
D2 · Cognitive Complexity · BenchTable.rows (cognitive 28) · ×1
  • BenchTable.rows (cognitive 28) Sources/OmniKit/Paper/BenchTable.swift:90 — BenchTable.rows has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (nesting depth added 12). Of this number, 26 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaperCasesCompute.sdpaCurve (cognitive 28) · ×1
  • PaperCasesCompute.sdpaCurve (cognitive 28) Sources/OmniKit/Paper/PaperCasesCompute.swift:68 — PaperCasesCompute.sdpaCurve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.lookAtQueue (cognitive 28) · ×1
  • AppModel.lookAtQueue (cognitive 28) App/AppModel.swift:8705 — AppModel.lookAtQueue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FolderBrowser.reload (cognitive 28) · ×1
  • FolderBrowser.reload (cognitive 28) App/FolderBrowser.swift:566 — FolderBrowser.reload has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 4, 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.
D2 · Cognitive Complexity · ResultGrouping.group (cognitive 28) · ×1
  • ResultGrouping.group (cognitive 28) App/ResultGrouping.swift:55 — ResultGrouping.group has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 9, ternaries 3 (4 pts), 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.
D2 · Cognitive Complexity · ScreenRecorder.tick (cognitive 28) · ×1
  • ScreenRecorder.tick (cognitive 28) App/ScreenRecorder.swift:217 — ScreenRecorder.tick has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ScreenTimeline.body (cognitive 28) · ×1
  • ScreenTimeline.body (cognitive 28) App/ScreenTimeline.swift:515 — ScreenTimeline.body has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 2 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndexTab.body (cognitive 28) · ×1
  • IndexTab.body (cognitive 28) App/SettingsView.swift:1251 — IndexTab.body has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, ternaries 3 (5 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MCPAdapter.notIndexedWhy (cognitive 28) · ×1
  • MCPAdapter.notIndexedWhy (cognitive 28) App/Serving/MCPAdapter.swift:994 — MCPAdapter.notIndexedWhy has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · ANEQuery.parallel (cognitive 28) · ×1
  • ANEQuery.parallel (cognitive 28) Sources/omni-verify/ANEQuery.swift:286 — ANEQuery.parallel has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 10). Of this number, 18 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShotBench.state (cognitive 28) · ×1
  • ShotBench.state (cognitive 28) Sources/omni-verify/ShotBench.swift:794 — ShotBench.state has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (6 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 11). Of this number, 25 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BulkDirWalker.walk (cognitive 27) · ×1
  • BulkDirWalker.walk (cognitive 27) Sources/OmniKit/BulkDirWalker.swift:190 — BulkDirWalker.walk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IDTokens.tokens (cognitive 27) · ×1
  • IDTokens.tokens (cognitive 27) Sources/OmniKit/IDTokens.swift:19 — IDTokens.tokens has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 5 (10 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.coverageAudit (cognitive 27) · ×1
  • VectorStore.coverageAudit (cognitive 27) Sources/OmniKit/VectorStore.swift:10130 — VectorStore.coverageAudit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 3 (5 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Drawer.run (cognitive 27) · ×1
  • Drawer.run (cognitive 27) Sources/OmniPages/main.swift:165 — Drawer.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.reloadEngine (cognitive 27) · ×1
  • AppModel.reloadEngine (cognitive 27) App/AppModel.swift:4866 — AppModel.reloadEngine has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (11 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 2). Of this number, 25 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AppModel.refreshIndexStats (cognitive 27) · ×1
  • AppModel.refreshIndexStats (cognitive 27) App/AppModel.swift:6371 — AppModel.refreshIndexStats has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 12, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalCommand.matches (cognitive 27) · ×1
  • EvalCommand.matches (cognitive 27) Sources/omni-verify/Eval.swift:738 — EvalCommand.matches has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ANETextBackend.packedInputs (cognitive 26) · ×1
  • ANETextBackend.packedInputs (cognitive 26) Sources/OmniKit/ANETextBackend.swift:294 — ANETextBackend.packedInputs has cognitive complexity 26 (threshold 15). Drivers by points: loops 8 (13 pts), boolean chains 7, ternaries 2 (5 pts), if/else 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.
D2 · Cognitive Complexity · Indexer.enrichMedia (cognitive 26) · ×1
  • Indexer.enrichMedia (cognitive 26) Sources/OmniKit/Indexer.swift:3256 — Indexer.enrichMedia has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 8, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). Of this number, 23 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.pdfTextTurn (cognitive 26) · ×1
  • Indexer.pdfTextTurn (cognitive 26) Sources/OmniKit/Indexer.swift:3588 — Indexer.pdfTextTurn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10, ternaries 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioSegmentReader.nextSegment (cognitive 26) · ×1
  • AudioSegmentReader.nextSegment (cognitive 26) Sources/OmniKit/OmniAudioPreprocess.swift:224 — AudioSegmentReader.nextSegment has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (9 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.replaceManyLocked (cognitive 26) · ×1
  • VectorStore.replaceManyLocked (cognitive 26) Sources/OmniKit/VectorStore.swift:3300 — VectorStore.replaceManyLocked has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 5 (7 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.searchGraphDense (cognitive 26) · ×1
  • VectorStore.searchGraphDense (cognitive 26) Sources/OmniKit/VectorStore.swift:6677 — VectorStore.searchGraphDense has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 19, if/else 6, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MarkdownSource.build (cognitive 26) · ×1
  • MarkdownSource.build (cognitive 26) App/MarkdownSource.swift:64 — MarkdownSource.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (20 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerfScript.runIfRequested (cognitive 26) · ×1
  • PerfScript.runIfRequested (cognitive 26) App/PerfScript.swift:22 — PerfScript.runIfRequested has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (8 pts), ternaries 2 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · main.swift.pathbenchRun (cognitive 26) · ×1
  • main.swift.pathbenchRun (cognitive 26) Sources/omni-verify/main.swift:1578 — main.swift.pathbenchRun has cognitive complexity 26 (threshold 15). Drivers by points: loops 10 (15 pts), if/else 4 (7 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 10). Of this number, 24 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · index.validate (cognitive 26) · ×1
  • index.validate (cognitive 26) worker/src/index.ts:237 — index.validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 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.
D2 · Cognitive Complexity · FileCrawler.walkBulk (cognitive 25) · ×1
  • FileCrawler.walkBulk (cognitive 25) Sources/OmniKit/FileCrawler.swift:173 — FileCrawler.walkBulk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 10, loops 2 (nesting depth added 1). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Indexer.extraChunks (cognitive 25) · ×1
  • Indexer.extraChunks (cognitive 25) Sources/OmniKit/Indexer.swift:3012 — Indexer.extraChunks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, loops 3 (6 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.
D2 · Cognitive Complexity · OmniEngine.embedTextBatches (cognitive 25) · ×1
  • OmniEngine.embedTextBatches (cognitive 25) Sources/OmniKit/OmniEngine.swift:1415 — OmniEngine.embedTextBatches has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (8 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenHistory.record (cognitive 25) · ×1
  • ScreenHistory.record (cognitive 25) Sources/OmniKit/ScreenHistory.swift:170 — ScreenHistory.record has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, error handling 2 (3 pts), ternaries 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.
D2 · Cognitive Complexity · VectorStore.folderCountsLocked (cognitive 25) · ×1
  • VectorStore.folderCountsLocked (cognitive 25) Sources/OmniKit/VectorStore.swift:1996 — VectorStore.folderCountsLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (10 pts), ternaries 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.fuseLexical (cognitive 25) · ×1
  • VectorStore.fuseLexical (cognitive 25) Sources/OmniKit/VectorStore.swift:7054 — VectorStore.fuseLexical has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 5 (7 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · VectorStore.mergeTwinFileRowsOnceLocked (cognitive 25) · ×1
  • VectorStore.mergeTwinFileRowsOnceLocked (cognitive 25) Sources/OmniKit/VectorStore.swift:11949 — VectorStore.mergeTwinFileRowsOnceLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (7 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · VectorStore.stampRowSidecarLocked (cognitive 25) · ×1
  • VectorStore.stampRowSidecarLocked (cognitive 25) Sources/OmniKit/VectorStore.swift:13251 — VectorStore.stampRowSidecarLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 3 (4 pts), loops 2, error handling 1 (nesting depth added 2). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VectorStore.dropV4TablesLocked (cognitive 25) · ×1
  • VectorStore.dropV4TablesLocked (cognitive 25) Sources/OmniKit/VectorStore.swift:17317 — VectorStore.dropV4TablesLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11, loops 1 (nesting depth added 1). Of this number, 23 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · VectorStore.internPathsLocked (cognitive 25) · ×1
  • VectorStore.internPathsLocked (cognitive 25) Sources/OmniKit/VectorStore.swift:18575 — VectorStore.internPathsLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (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.
D2 · Cognitive Complexity · SearchToolbar.toolbar (cognitive 25) · ×1
  • SearchToolbar.toolbar (cognitive 25) App/SearchToolbar.swift:103 — SearchToolbar.toolbar has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (10 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Job.decode (cognitive 25) · ×1
  • Job.decode (cognitive 25) App/Serving/OCRServing.swift:280 — Job.decode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (6 pts), ternaries 2 (4 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.
D2 · Cognitive Complexity · ANETextBackend.mapLayers (cognitive 24) · ×1
  • ANETextBackend.mapLayers (cognitive 24) Sources/OmniKit/ANETextBackend.swift:98 — ANETextBackend.mapLayers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (2 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.
D2 · Cognitive Complexity · ANEVisionBackend.encode (cognitive 24) · ×1
  • ANEVisionBackend.encode (cognitive 24) Sources/OmniKit/ANEVisionBackend.swift:92 — ANEVisionBackend.encode has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), loops 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IDIndex.drain (cognitive 24) · ×1
  • IDIndex.drain (cognitive 24) Sources/OmniKit/IDIndex.swift:98 — IDIndex.drain has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.update · ×1
  • Indexer.update::flushImagesU (cognitive 24) Sources/OmniKit/Indexer.swift:4115 — Indexer.update::flushImagesU has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (6 pts), loops 3 (5 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. This shape REPEATS in the file: one other method here (Indexer.update) 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.
D2 · Cognitive Complexity · OfficeDocument.slides (cognitive 24) · ×1
  • OfficeDocument.slides (cognitive 24) Sources/OmniKit/OfficeDocument.swift:46 — OfficeDocument.slides has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 9, ternaries 1 (4 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.
D2 · Cognitive Complexity · CompiledPathFilter.accepts (cognitive 24) · ×1
  • CompiledPathFilter.accepts (cognitive 24) Sources/OmniKit/PathTable.swift:592 — CompiledPathFilter.accepts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · VectorStore.rowWindowAuditLocked (cognitive 24) · ×1
  • VectorStore.rowWindowAuditLocked (cognitive 24) Sources/OmniKit/VectorStore.swift:2262 — VectorStore.rowWindowAuditLocked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.chunksForCurrentPathLocked (cognitive 24) · ×1
  • VectorStore.chunksForCurrentPathLocked (cognitive 24) Sources/OmniKit/VectorStore.swift:3616 — VectorStore.chunksForCurrentPathLocked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts), ternaries 3 (4 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.
D2 · Cognitive Complexity · AppModel.applyComputeUnit (cognitive 24) · ×1
  • AppModel.applyComputeUnit (cognitive 24) App/AppModel.swift:2908 — AppModel.applyComputeUnit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 9, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhotoSourceRow.body (cognitive 24) · ×1
  • PhotoSourceRow.body (cognitive 24) App/Sidebar.swift:849 — PhotoSourceRow.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MCPAdapter.callTool (cognitive 24) · ×1
  • MCPAdapter.callTool (cognitive 24) App/Serving/MCPAdapter.swift:1417 — MCPAdapter.callTool has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (6 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiAdapter.handle (cognitive 24) · ×1
  • GeminiAdapter.handle (cognitive 24) App/Serving/SchemaAdapters.swift:296 — GeminiAdapter.handle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.rowwindowbenchRun (cognitive 24) · ×1
  • main.swift.rowwindowbenchRun (cognitive 24) Sources/omni-verify/main.swift:1379 — main.swift.rowwindowbenchRun has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (13 pts), loops 6 (11 pts) (nesting depth added 14). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · ScreenHistory.indexedShots (cognitive 23) · ×1
  • ScreenHistory.indexedShots (cognitive 23) Sources/OmniKit/ScreenHistory.swift:1025 — ScreenHistory.indexedShots has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.provenRowRangesLocked (cognitive 23) · ×1
  • VectorStore.provenRowRangesLocked (cognitive 23) Sources/OmniKit/VectorStore.swift:2366 — VectorStore.provenRowRangesLocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3, boolean chains 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.
D2 · Cognitive Complexity · VectorStore.readKindName (cognitive 23) · ×1
  • VectorStore.readKindName (cognitive 23) Sources/OmniKit/VectorStore.swift:5523 — VectorStore.readKindName has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.modalityScoreProfile (cognitive 23) · ×1
  • VectorStore.modalityScoreProfile (cognitive 23) Sources/OmniKit/VectorStore.swift:6485 — VectorStore.modalityScoreProfile has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (8 pts), loops 5 (6 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.
D2 · Cognitive Complexity · VectorStore.placeVectorLocked (cognitive 23) · ×1
  • VectorStore.placeVectorLocked (cognitive 23) Sources/OmniKit/VectorStore.swift:9629 — VectorStore.placeVectorLocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · VectorStore.keepReleasedLocked (cognitive 23) · ×1
  • VectorStore.keepReleasedLocked (cognitive 23) Sources/OmniKit/VectorStore.swift:17240 — VectorStore.keepReleasedLocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · AppModel.serializeSearch (cognitive 23) · ×1
  • AppModel.serializeSearch (cognitive 23) App/AppModel.swift:5201 — AppModel.serializeSearch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 4, ternaries 1 (2 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.
D2 · Cognitive Complexity · AppModel.runPaperBenchmark (cognitive 23) · ×1
  • AppModel.runPaperBenchmark (cognitive 23) App/PaperBenchmark.swift:33 — AppModel.runPaperBenchmark has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.bulkList (cognitive 23) · ×1
  • main.swift.bulkList (cognitive 23) Sources/crawlbench/main.swift:26 — main.swift.bulkList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 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.
D2 · Cognitive Complexity · ShotBench.reference (cognitive 23) · ×1
  • ShotBench.reference (cognitive 23) Sources/omni-verify/ShotBench.swift:482 — ShotBench.reference has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 5 (6 pts), ternaries 3 (4 pts), boolean chains 1 (nesting depth added 5). Of this number, 14 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.streamWindow (cognitive 22) · ×1
  • Indexer.streamWindow (cognitive 22) Sources/OmniKit/Indexer.swift:3471 — Indexer.streamWindow has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 5, match/switch 1 (2 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.
D2 · Cognitive Complexity · OmniAudioEncoder.encodeBatch (cognitive 22) · ×1
  • OmniAudioEncoder.encodeBatch (cognitive 22) Sources/OmniKit/OmniAudioEncoder.swift:74 — OmniAudioEncoder.encodeBatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (7 pts), ternaries 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniEngine.mediaPathFinite (cognitive 22) · ×1
  • OmniEngine.mediaPathFinite (cognitive 22) Sources/OmniKit/OmniEngine.swift:459 — OmniEngine.mediaPathFinite has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenHistory.session (cognitive 22) · ×1
  • ScreenHistory.session (cognitive 22) Sources/OmniKit/ScreenHistory.swift:691 — ScreenHistory.session has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (7 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenHistory.takeInStills (cognitive 22) · ×1
  • ScreenHistory.takeInStills (cognitive 22) Sources/OmniKit/ScreenHistory.swift:1160 — ScreenHistory.takeInStills has cognitive complexity 22 (threshold 15). Drivers by points: if/else 26 (67 pts), loops 10 (23 pts), boolean chains 14, ternaries 2 (8 pts), error handling 1 (2 pts) (nesting depth added 61). 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. This shape REPEATS in the file: one other method here (ScreenHistory.takeInStills::pass) 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.
D2 · Cognitive Complexity · VectorStore.chunkVectors (cognitive 22) · ×1
  • VectorStore.chunkVectors (cognitive 22) Sources/OmniKit/VectorStore.swift:3458 — VectorStore.chunkVectors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 3 (4 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.
D2 · Cognitive Complexity · VectorStore.vectorsForContentKeys (cognitive 22) · ×1
  • VectorStore.vectorsForContentKeys (cognitive 22) Sources/OmniKit/VectorStore.swift:3547 — VectorStore.vectorsForContentKeys has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, loops 2 (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.
D2 · Cognitive Complexity · VectorStore.adoptReuseDebtsLocked (cognitive 22) · ×1
  • VectorStore.adoptReuseDebtsLocked (cognitive 22) Sources/OmniKit/VectorStore.swift:10530 — VectorStore.adoptReuseDebtsLocked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaperCasesCompute.indexPass (cognitive 22) · ×1
  • PaperCasesCompute.indexPass (cognitive 22) Sources/OmniKit/Paper/PaperCasesCompute.swift:380 — PaperCasesCompute.indexPass has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentScroll.scroller (cognitive 22) · ×1
  • DocumentScroll.scroller (cognitive 22) App/OCRView.swift:1133 — DocumentScroll.scroller has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Coordinator.install (cognitive 22) · ×1
  • Coordinator.install (cognitive 22) App/ScreenTimeline.swift:936 — Coordinator.install has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LinkServed.servedSearch (cognitive 22) · ×1
  • LinkServed.servedSearch (cognitive 22) App/Link/AppModel+Link.swift:234 — LinkServed.servedSearch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (6 pts), boolean chains 3, loops 3, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Router.handle (cognitive 22) · ×1
  • Router.handle (cognitive 22) App/Serving/Router.swift:22 — Router.handle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, match/switch 2 (4 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.
D2 · Cognitive Complexity · main.swift.bulkWalkParallel (cognitive 22) · ×1
  • main.swift.bulkWalkParallel (cognitive 22) Sources/crawlbench/main.swift:130 — main.swift.bulkWalkParallel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, loops 3 (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.
D2 · Cognitive Complexity · ANEHintAB.run (cognitive 22) · ×1
  • ANEHintAB.run (cognitive 22) Sources/omni-verify/ANEQuery.swift:473 — ANEHintAB.run has cognitive complexity 22 (threshold 15). Drivers by points: loops 9 (13 pts), if/else 4 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 9 belong to 3 function items inside it that branch. 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.
D2 · Cognitive Complexity · index.validateTable (cognitive 22) · ×1
  • index.validateTable (cognitive 22) worker/src/index.ts:286 — index.validateTable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ANEProgram.constant (cognitive 21) · ×1
  • ANEProgram.constant (cognitive 21) Sources/OmniKit/ANEProgram.swift:167 — ANEProgram.constant has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (10 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Indexer.documentPieces (cognitive 21) · ×1
  • Indexer.documentPieces (cognitive 21) Sources/OmniKit/Indexer.swift:5292 — Indexer.documentPieces has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 2 (5 pts), loops 2 (3 pts) (nesting depth added 12). 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.
D2 · Cognitive Complexity · OmniEngine.embedImagesTaggedHQ (cognitive 21) · ×1
  • OmniEngine.embedImagesTaggedHQ (cognitive 21) Sources/OmniKit/OmniEngine.swift:1694 — OmniEngine.embedImagesTaggedHQ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 3 (5 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniVisionPreprocess.preprocessRaw (cognitive 21) · ×1
  • OmniVisionPreprocess.preprocessRaw (cognitive 21) Sources/OmniKit/OmniVisionPreprocess.swift:58 — OmniVisionPreprocess.preprocessRaw has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). 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.
D2 · Cognitive Complexity · ScreenHistory.wallSeconds (cognitive 21) · ×1
  • ScreenHistory.wallSeconds (cognitive 21) Sources/OmniKit/ScreenHistory.swift:757 — ScreenHistory.wallSeconds has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 3 (4 pts), ternaries 3, loops 1 (nesting depth added 1). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SearchHit.matchReason (cognitive 21) · ×1
  • SearchHit.matchReason (cognitive 21) App/ResultsList.swift:1387 — SearchHit.matchReason has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 3 (5 pts), match/switch 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.
D2 · Cognitive Complexity · VectorStore.pathAllowGPULocked (cognitive 21) · ×1
  • VectorStore.pathAllowGPULocked (cognitive 21) Sources/OmniKit/VectorStore.swift:8183 — VectorStore.pathAllowGPULocked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VectorStore.advanceCoverageLocked (cognitive 21) · ×1
  • VectorStore.advanceCoverageLocked (cognitive 21) Sources/OmniKit/VectorStore.swift:12047 — VectorStore.advanceCoverageLocked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SAMEncoder.positions (cognitive 21) · ×1
  • SAMEncoder.positions (cognitive 21) Sources/OmniKit/OCR/OCRVision.swift:116 — SAMEncoder.positions has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 3 (nesting depth added 12). 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.
D2 · Cognitive Complexity · FileMenuItems.body (cognitive 21) · ×1
  • FileMenuItems.body (cognitive 21) App/FileMenu.swift:123 — FileMenuItems.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TrackPoints.body (cognitive 21) · ×1
  • TrackPoints.body (cognitive 21) App/ScreenTimeline.swift:829 — TrackPoints.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4, ternaries 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.
D2 · Cognitive Complexity · PerformanceTab.body (cognitive 21) · ×1
  • PerformanceTab.body (cognitive 21) App/SettingsView.swift:802 — PerformanceTab.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, ternaries 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Sidebar.reconcileSelection (cognitive 21) · ×1
  • Sidebar.reconcileSelection (cognitive 21) App/Sidebar.swift:427 — Sidebar.reconcileSelection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Thumbnail.render (cognitive 21) · ×1
  • Thumbnail.render (cognitive 21) App/Thumbnail.swift:139 — Thumbnail.render has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoteFiles.downloadOnce (cognitive 21) · ×1
  • RemoteFiles.downloadOnce (cognitive 21) App/Link/RemoteFiles.swift:143 — RemoteFiles.downloadOnce has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (4 pts), error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPAdapter.callPhrase (cognitive 21) · ×1
  • MCPAdapter.callPhrase (cognitive 21) App/Serving/MCPAdapter.swift:708 — MCPAdapter.callPhrase has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (15 pts), if/else 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.tombstonecheckRun (cognitive 21) · ×1
  • main.swift.tombstonecheckRun (cognitive 21) Sources/omni-verify/main.swift:863 — main.swift.tombstonecheckRun has cognitive complexity 21 (threshold 15). Drivers by points: loops 8 (10 pts), ternaries 5, if/else 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (run, reopen). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · main.swift.toolHelp (cognitive 20) · ×1
  • main.swift.toolHelp (cognitive 20) Sources/OmniCLI/main.swift:465 — main.swift.toolHelp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (7 pts), loops 2 (6 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.
D2 · Cognitive Complexity · ANETextBackend.fillTokens (cognitive 20) · ×1
  • ANETextBackend.fillTokens (cognitive 20) Sources/OmniKit/ANETextBackend.swift:452 — ANETextBackend.fillTokens has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). 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.
D2 · Cognitive Complexity · Indexer.pieceTurn (cognitive 20) · ×1
  • Indexer.pieceTurn (cognitive 20) Sources/OmniKit/Indexer.swift:3515 — Indexer.pieceTurn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 2, match/switch 1 (2 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ModelDownloader.downloadRelease (cognitive 20) · ×1
  • ModelDownloader.downloadRelease (cognitive 20) Sources/OmniKit/ModelDownloader.swift:134 — ModelDownloader.downloadRelease has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniEngine.run (cognitive 20) · ×1
  • OmniEngine.run (cognitive 20) Sources/OmniKit/OmniEngine.swift:637 — OmniEngine.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OmniIgnore.init (cognitive 20) · ×1
  • OmniIgnore.init (cognitive 20) Sources/OmniKit/OmniIgnore.swift:92 — OmniIgnore.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 2, ternaries 1 (nesting depth added 5). Of this number, 12 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniIgnore.matchSegments · ×1
  • OmniIgnore.matchSegments::go (cognitive 20) Sources/OmniKit/OmniIgnore.swift:455 — OmniIgnore.matchSegments::go has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniTagger.seedImages (cognitive 20) · ×1
  • OmniTagger.seedImages (cognitive 20) Sources/OmniKit/OmniTagger.swift:494 — OmniTagger.seedImages has cognitive complexity 20 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 3 (5 pts), ternaries 1 (5 pts), match/switch 1 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniVisionTower.rotPosEmb (cognitive 20) · ×1
  • OmniVisionTower.rotPosEmb (cognitive 20) Sources/OmniKit/OmniVisionTower.swift:287 — OmniVisionTower.rotPosEmb has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 1 (2 pts) (nesting depth added 13). 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.
D2 · Cognitive Complexity · PassageRecovery.passages (cognitive 20) · ×1
  • PassageRecovery.passages (cognitive 20) Sources/OmniKit/Passages.swift:198 — PassageRecovery.passages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ScreenSignature.init (cognitive 20) · ×1
  • ScreenSignature.init (cognitive 20) Sources/OmniKit/ScreenChange.swift:19 — ScreenSignature.init has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 4 (6 pts), boolean chains 1 (nesting depth added 9). 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.
D2 · Cognitive Complexity · ScreenHistory.readCatalog (cognitive 20) · ×1
  • ScreenHistory.readCatalog (cognitive 20) Sources/OmniKit/ScreenHistory.swift:1066 — ScreenHistory.readCatalog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.streamedVectorsUnderFolder · ×1
  • VectorStore.streamedVectorsUnderFolder::walk::stepLocked (cognitive 20) Sources/OmniKit/VectorStore.swift:6395 — VectorStore.streamedVectorsUnderFolder::walk::stepLocked has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (VectorStore.streamedVectorsUnderFolder) 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.
D2 · Cognitive Complexity · VectorStore.commitReclaimLocked (cognitive 20) · ×1
  • VectorStore.commitReclaimLocked (cognitive 20) Sources/OmniKit/VectorStore.swift:12842 — VectorStore.commitReclaimLocked has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 7, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · VectorStore.removeRowsByPathsLocked (cognitive 20) · ×1
  • VectorStore.removeRowsByPathsLocked (cognitive 20) Sources/OmniKit/VectorStore.swift:15345 — VectorStore.removeRowsByPathsLocked has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OCRResize.bicubicAntialiasCHW (cognitive 20) · ×1
  • OCRResize.bicubicAntialiasCHW (cognitive 20) Sources/OmniKit/OCR/OCRResize.swift:66 — OCRResize.bicubicAntialiasCHW has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (20 pts) (nesting depth added 12). 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.
D2 · Cognitive Complexity · PaperCasesStore.exactReference (cognitive 20) · ×1
  • PaperCasesStore.exactReference (cognitive 20) Sources/OmniKit/Paper/PaperCasesStore.swift:681 — PaperCasesStore.exactReference has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.reloadFolderPolicies (cognitive 20) · ×1
  • AppModel.reloadFolderPolicies (cognitive 20) App/AppModel.swift:4440 — AppModel.reloadFolderPolicies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmptyResults.body (cognitive 20) · ×1
  • EmptyResults.body (cognitive 20) App/ContentView.swift:770 — EmptyResults.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DropIntake.read (cognitive 20) · ×1
  • DropIntake.read (cognitive 20) App/DropIntake.swift:94 — DropIntake.read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenRecorder.frontWindows (cognitive 20) · ×1
  • ScreenRecorder.frontWindows (cognitive 20) App/ScreenRecorder.swift:434 — ScreenRecorder.frontWindows has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (7 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · HTTPParse.parseHead (cognitive 20) · ×1
  • HTTPParse.parseHead (cognitive 20) App/Serving/HTTPMessage.swift:85 — HTTPParse.parseHead has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPAdapter.callOCR (cognitive 20) · ×1
  • MCPAdapter.callOCR (cognitive 20) App/Serving/MCPAdapter.swift:1163 — MCPAdapter.callOCR has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 4, ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ServingController.startServer (cognitive 20) · ×1
  • ServingController.startServer (cognitive 20) App/Serving/ServingController.swift:307 — ServingController.startServer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 5, error handling 1, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · main.swift.unixExchange (cognitive 19) · ×1
  • main.swift.unixExchange (cognitive 19) Sources/OmniCLI/main.swift:81 — main.swift.unixExchange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ANEVisionBackend.init (cognitive 19) · ×1
  • ANEVisionBackend.init (cognitive 19) Sources/OmniKit/ANEVisionBackend.swift:26 — ANEVisionBackend.init has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 3, boolean chains 1 (nesting depth added 10). Of this number, 17 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
D2 · Cognitive Complexity · PDFPagePictures.imageShare (cognitive 19) · ×1
  • PDFPagePictures.imageShare (cognitive 19) Sources/OmniKit/DocumentPictures.swift:75 — PDFPagePictures.imageShare has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (6 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Half.bits (cognitive 19) · ×1
  • Half.bits (cognitive 19) Sources/OmniKit/Half.swift:10 — Half.bits has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IDIndex.lookup (cognitive 19) · ×1
  • IDIndex.lookup (cognitive 19) Sources/OmniKit/IDIndex.swift:183 — IDIndex.lookup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndexRelocation.copy (cognitive 19) · ×1
  • IndexRelocation.copy (cognitive 19) Sources/OmniKit/IndexRelocation.swift:76 — IndexRelocation.copy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 pts), 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.
D2 · Cognitive Complexity · OmniTagger.buildCache (cognitive 19) · ×1
  • OmniTagger.buildCache (cognitive 19) Sources/OmniKit/OmniTagger.swift:147 — OmniTagger.buildCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PDFPagePick.page (cognitive 19) · ×1
  • PDFPagePick.page (cognitive 19) Sources/OmniKit/PDFPagePick.swift:18 — PDFPagePick.page has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 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.
D2 · Cognitive Complexity · VectorStore.copies (cognitive 19) · ×1
  • VectorStore.copies (cognitive 19) Sources/OmniKit/VectorStore.swift:4709 — VectorStore.copies has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.finishTailReclaimLocked (cognitive 19) · ×1
  • VectorStore.finishTailReclaimLocked (cognitive 19) Sources/OmniKit/VectorStore.swift:12670 — VectorStore.finishTailReclaimLocked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OCRVerifyAttention.plan (cognitive 19) · ×1
  • OCRVerifyAttention.plan (cognitive 19) Sources/OmniKit/OCR/OCRLanguage.swift:572 — OCRVerifyAttention.plan has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (6 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.
D2 · Cognitive Complexity · PaperCasesCompute.textLever (cognitive 19) · ×1
  • PaperCasesCompute.textLever (cognitive 19) Sources/OmniKit/Paper/PaperCasesCompute.swift:283 — PaperCasesCompute.textLever has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.fillPassages (cognitive 19) · ×1
  • AppModel.fillPassages (cognitive 19) App/AppModel.swift:630 — AppModel.fillPassages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 2, 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.
D2 · Cognitive Complexity · AppModel.finishPass (cognitive 19) · ×1
  • AppModel.finishPass (cognitive 19) App/AppModel.swift:8998 — AppModel.finishPass has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PerfScript.ocrStep (cognitive 19) · ×1
  • PerfScript.ocrStep (cognitive 19) App/PerfScript.swift:654 — PerfScript.ocrStep has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · MCPAdapter.sourcesResult (cognitive 19) · ×1
  • MCPAdapter.sourcesResult (cognitive 19) App/Serving/MCPAdapter.swift:1697 — MCPAdapter.sourcesResult has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 1 (4 pts), loops 1 (2 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.
D2 · Cognitive Complexity · ANEBatchAB.run (cognitive 19) · ×1
  • ANEBatchAB.run (cognitive 19) Sources/omni-verify/ANEQuery.swift:397 — ANEBatchAB.run has cognitive complexity 19 (threshold 15). Drivers by points: loops 8 (11 pts), boolean chains 3, ternaries 1 (3 pts), if/else 2 (nesting depth added 5). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, 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.
D2 · Cognitive Complexity · EvalCommand.stateCompare (cognitive 19) · ×1
  • EvalCommand.stateCompare (cognitive 19) Sources/omni-verify/Eval.swift:517 — EvalCommand.stateCompare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SoundCost.run (cognitive 19) · ×1
  • SoundCost.run (cognitive 19) Sources/omni-verify/main.swift:4399 — SoundCost.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (9 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · OmniEngine.embedImagesTagged (cognitive 18) · ×1
  • OmniEngine.embedImagesTagged (cognitive 18) Sources/OmniKit/OmniEngine.swift:1617 — OmniEngine.embedImagesTagged has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OmniTagger.topIndices (cognitive 18) · ×1
  • OmniTagger.topIndices (cognitive 18) Sources/OmniKit/OmniTagger.swift:359 — OmniTagger.topIndices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4, ternaries 3 (4 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (siftDown, worse). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · TextSlice.largeTextLines (cognitive 18) · ×1
  • TextSlice.largeTextLines (cognitive 18) Sources/OmniKit/Passages.swift:641 — TextSlice.largeTextLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 3, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenHistory.read (cognitive 18) · ×1
  • ScreenHistory.read (cognitive 18) Sources/OmniKit/ScreenHistory.swift:575 — ScreenHistory.read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchFilter.accepts (cognitive 18) · ×1
  • SearchFilter.accepts (cognitive 18) Sources/OmniKit/VectorStore.swift:350 — SearchFilter.accepts has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Vec16Buffer.mapPersistent (cognitive 18) · ×1
  • Vec16Buffer.mapPersistent (cognitive 18) Sources/OmniKit/VectorStore.swift:680 — Vec16Buffer.mapPersistent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · VectorStore.ensureSlotRowsLocked (cognitive 18) · ×1
  • VectorStore.ensureSlotRowsLocked (cognitive 18) Sources/OmniKit/VectorStore.swift:1516 — VectorStore.ensureSlotRowsLocked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 4 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.searchDense · ×1
  • VectorStore.searchDense::coarseFastPathLocked (cognitive 18) Sources/OmniKit/VectorStore.swift:7160 — VectorStore.searchDense::coarseFastPathLocked has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (VectorStore.searchDense) 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.
D2 · Cognitive Complexity · VectorStore.selectLargest (cognitive 18) · ×1
  • VectorStore.selectLargest (cognitive 18) Sources/OmniKit/VectorStore.swift:7575 — VectorStore.selectLargest has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 5 (8 pts), boolean chains 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.
D2 · Cognitive Complexity · VectorStore.deriveUnownedPositionsAsHolesLocked (cognitive 18) · ×1
  • VectorStore.deriveUnownedPositionsAsHolesLocked (cognitive 18) Sources/OmniKit/VectorStore.swift:11762 — VectorStore.deriveUnownedPositionsAsHolesLocked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 2, 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.
D2 · Cognitive Complexity · OCRModel.transcribeBatched (cognitive 18) · ×1
  • OCRModel.transcribeBatched (cognitive 18) Sources/OmniKit/OCR/OCRBatched.swift:711 — OCRModel.transcribeBatched has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 4). Of this number, 12 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SAMAttention.relTable (cognitive 18) · ×1
  • SAMAttention.relTable (cognitive 18) Sources/OmniKit/OCR/OCRVision.swift:266 — SAMAttention.relTable has cognitive complexity 18 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 2 (nesting depth added 9). 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.
D2 · Cognitive Complexity · AppModel.applyKind (cognitive 18) · ×1
  • AppModel.applyKind (cognitive 18) App/AppModel.swift:4753 — AppModel.applyKind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AppModel.loadPerf (cognitive 18) · ×1
  • AppModel.loadPerf (cognitive 18) App/AppModel.swift:4970 — AppModel.loadPerf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 1 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AppModel.vectorSpaceDiffers (cognitive 18) · ×1
  • AppModel.vectorSpaceDiffers (cognitive 18) App/AppModel.swift:6265 — AppModel.vectorSpaceDiffers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.restartWatcher (cognitive 18) · ×1
  • AppModel.restartWatcher (cognitive 18) App/AppModel.swift:8540 — AppModel.restartWatcher has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChunkPreview.load (cognitive 18) · ×1
  • ChunkPreview.load (cognitive 18) App/ChunkPreview.swift:38 — ChunkPreview.load has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Coordinator.move (cognitive 18) · ×1
  • Coordinator.move (cognitive 18) App/ContentKeys.swift:149 — Coordinator.move has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FolderBrowser.followProgress (cognitive 18) · ×1
  • FolderBrowser.followProgress (cognitive 18) App/FolderBrowser.swift:504 — FolderBrowser.followProgress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 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.
D2 · Cognitive Complexity · MarkdownBlock.parseHTMLTable (cognitive 18) · ×1
  • MarkdownBlock.parseHTMLTable (cognitive 18) App/MarkdownBlock.swift:355 — MarkdownBlock.parseHTMLTable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OCRView.content (cognitive 18) · ×1
  • OCRView.content (cognitive 18) App/OCRView.swift:128 — OCRView.content has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppDelegate.dumpUIDebug (cognitive 18) · ×1
  • AppDelegate.dumpUIDebug (cognitive 18) App/OmniApp.swift:227 — AppDelegate.dumpUIDebug has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 3). Of this number, 10 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PassagesView.body (cognitive 18) · ×1
  • PassagesView.body (cognitive 18) App/ResultsList.swift:860 — PassagesView.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 5, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ResultGridItem.body (cognitive 18) · ×1
  • ResultGridItem.body (cognitive 18) App/ResultsList.swift:935 — ResultGridItem.body has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 4, boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ScreenTimelineState.apply (cognitive 18) · ×1
  • ScreenTimelineState.apply (cognitive 18) App/ScreenTimeline.swift:182 — ScreenTimelineState.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MCPAdapter.handleModern (cognitive 18) · ×1
  • MCPAdapter.handleModern (cognitive 18) App/Serving/MCPAdapter.swift:1482 — MCPAdapter.handleModern has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · MCPAdapter.callSources (cognitive 18) · ×1
  • MCPAdapter.callSources (cognitive 18) App/Serving/MCPAdapter.swift:1653 — MCPAdapter.callSources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (6 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentOCRAdapter.handle (cognitive 18) · ×1
  • DocumentOCRAdapter.handle (cognitive 18) App/Serving/OCRAdapters.swift:195 — DocumentOCRAdapter.handle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, match/switch 5 (6 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ANEQuery.textBackend (cognitive 18) · ×1
  • ANEQuery.textBackend (cognitive 18) Sources/omni-verify/ANEQuery.swift:31 — ANEQuery.textBackend has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IDIndex.sweep (cognitive 17) · ×1
  • IDIndex.sweep (cognitive 17) Sources/OmniKit/IDIndex.swift:223 — IDIndex.sweep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (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.
D2 · Cognitive Complexity · Indexer.withExtras (cognitive 17) · ×1
  • Indexer.withExtras (cognitive 17) Sources/OmniKit/Indexer.swift:3193 — Indexer.withExtras has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.embedDocument (cognitive 17) · ×1
  • Indexer.embedDocument (cognitive 17) Sources/OmniKit/Indexer.swift:5228 — Indexer.embedDocument has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (5 pts), boolean chains 4, loops 2 (4 pts), ternaries 3 (4 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.
D2 · Cognitive Complexity · MigrationV5Runner.backfillInPlace (cognitive 17) · ×1
  • MigrationV5Runner.backfillInPlace (cognitive 17) Sources/OmniKit/MigrationV5Runner.swift:200 — MigrationV5Runner.backfillInPlace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniIgnore.parseLine (cognitive 17) · ×1
  • OmniIgnore.parseLine (cognitive 17) Sources/OmniKit/OmniIgnore.swift:143 — OmniIgnore.parseLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniIgnore.scoped (cognitive 17) · ×1
  • OmniIgnore.scoped (cognitive 17) Sources/OmniKit/OmniIgnore.swift:181 — OmniIgnore.scoped has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (6 pts), loops 4 (5 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.
D2 · Cognitive Complexity · OmniIgnore.matches (cognitive 17) · ×1
  • OmniIgnore.matches (cognitive 17) Sources/OmniKit/OmniIgnore.swift:429 — OmniIgnore.matches has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OmniImageEncoder.encode (cognitive 17) · ×1
  • OmniImageEncoder.encode (cognitive 17) Sources/OmniKit/OmniImageEncoder.swift:86 — OmniImageEncoder.encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PagePhrase.span (cognitive 17) · ×1
  • PagePhrase.span (cognitive 17) Sources/OmniKit/PagePhrase.swift:46 — PagePhrase.span has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhotoLibrary.enumerate (cognitive 17) · ×1
  • PhotoLibrary.enumerate (cognitive 17) Sources/OmniKit/PhotosSource.swift:197 — PhotoLibrary.enumerate has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 4 (5 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScreenSignature.share (cognitive 17) · ×1
  • ScreenSignature.share (cognitive 17) Sources/OmniKit/ScreenChange.swift:66 — ScreenSignature.share has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). 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.
D2 · Cognitive Complexity · ScreenHistory.delete (cognitive 17) · ×1
  • ScreenHistory.delete (cognitive 17) Sources/OmniKit/ScreenHistory.swift:1359 — ScreenHistory.delete has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.foldOrphanLiveLocked (cognitive 17) · ×1
  • VectorStore.foldOrphanLiveLocked (cognitive 17) Sources/OmniKit/VectorStore.swift:1625 — VectorStore.foldOrphanLiveLocked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 2 (nesting depth added 3). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.fileChunkDec (cognitive 17) · ×1
  • VectorStore.fileChunkDec (cognitive 17) Sources/OmniKit/VectorStore.swift:2089 — VectorStore.fileChunkDec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.knownFiles (cognitive 17) · ×1
  • VectorStore.knownFiles (cognitive 17) Sources/OmniKit/VectorStore.swift:4380 — VectorStore.knownFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.hitsForPaths (cognitive 17) · ×1
  • VectorStore.hitsForPaths (cognitive 17) Sources/OmniKit/VectorStore.swift:4939 — VectorStore.hitsForPaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.releaseHolesOwnedByLiveContentsLocked (cognitive 17) · ×1
  • VectorStore.releaseHolesOwnedByLiveContentsLocked (cognitive 17) Sources/OmniKit/VectorStore.swift:11826 — VectorStore.releaseHolesOwnedByLiveContentsLocked has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), loops 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OCRPreprocess.closestAspectRatio (cognitive 17) · ×1
  • OCRPreprocess.closestAspectRatio (cognitive 17) Sources/OmniKit/OCR/OCRPreprocess.swift:327 — OCRPreprocess.closestAspectRatio has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 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.
D2 · Cognitive Complexity · BenchTable.renderText (cognitive 17) · ×1
  • BenchTable.renderText (cognitive 17) Sources/OmniKit/Paper/BenchTable.swift:179 — BenchTable.renderText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts) (nesting depth added 7). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemProbe.gpuClientTimes (cognitive 17) · ×1
  • SystemProbe.gpuClientTimes (cognitive 17) Sources/OmniKit/Paper/SystemProbe.swift:317 — SystemProbe.gpuClientTimes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkNode.accept (cognitive 17) · ×1
  • LinkNode.accept (cognitive 17) Sources/OmniLink/LinkNode.swift:632 — LinkNode.accept has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.drainIdleUpkeep (cognitive 17) · ×1
  • AppModel.drainIdleUpkeep (cognitive 17) App/AppModel.swift:7563 — AppModel.drainIdleUpkeep has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Coordinator.show (cognitive 17) · ×1
  • Coordinator.show (cognitive 17) App/OCRView.swift:883 — Coordinator.show has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ScreenshotsRow.body (cognitive 17) · ×1
  • ScreenshotsRow.body (cognitive 17) App/Sidebar.swift:985 — ScreenshotsRow.body has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ANEQuery.onDevice (cognitive 17) · ×1
  • ANEQuery.onDevice (cognitive 17) Sources/omni-verify/ANEQuery.swift:99 — ANEQuery.onDevice has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Examples.commands (cognitive 16) · ×1
  • Examples.commands (cognitive 16) Sources/OmniCLI/AgentSkill.swift:72 — Examples.commands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClipboardHistory.title (cognitive 16) · ×1
  • ClipboardHistory.title (cognitive 16) Sources/OmniKit/ClipboardHistory.swift:160 — ClipboardHistory.title has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexer.anchorStarts · ×1
  • Indexer.anchorStarts::matches (cognitive 16) Sources/OmniKit/Indexer.swift:830 — Indexer.anchorStarts::matches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Indexer.anchorStarts) 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.
D2 · Cognitive Complexity · Indexer.streamedVideo (cognitive 16) · ×1
  • Indexer.streamedVideo (cognitive 16) Sources/OmniKit/Indexer.swift:4994 — Indexer.streamedVideo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexicalIndex.indexedText (cognitive 16) · ×1
  • LexicalIndex.indexedText (cognitive 16) Sources/OmniKit/LexicalIndex.swift:338 — LexicalIndex.indexedText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
D2 · Cognitive Complexity · MigrationV5Runner.v5CreateStatements (cognitive 16) · ×1
  • MigrationV5Runner.v5CreateStatements (cognitive 16) Sources/OmniKit/MigrationV5Runner.swift:158 — MigrationV5Runner.v5CreateStatements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DateStyles.isDateFormat (cognitive 16) · ×1
  • DateStyles.isDateFormat (cognitive 16) Sources/OmniKit/OfficeDocument.swift:238 — DateStyles.isDateFormat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · ProjectionEngine.layout (cognitive 16) · ×1
  • ProjectionEngine.layout (cognitive 16) Sources/OmniKit/ProjectionEngine.swift:241 — ProjectionEngine.layout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, loops 2 (4 pts), boolean chains 3, ternaries 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProjectionEngine.selectNth (cognitive 16) · ×1
  • ProjectionEngine.selectNth (cognitive 16) Sources/OmniKit/ProjectionEngine.swift:582 — ProjectionEngine.selectNth has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (7 pts) (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.
D2 · Cognitive Complexity · SearchQueryParser.hasFinishedQualifier (cognitive 16) · ×1
  • SearchQueryParser.hasFinishedQualifier (cognitive 16) Sources/OmniKit/SearchQueryParser.swift:52 — SearchQueryParser.hasFinishedQualifier has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, loops 4 (6 pts), if/else 3 (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.
D2 · Cognitive Complexity · VectorStore.shrinkFileInSlices (cognitive 16) · ×1
  • VectorStore.shrinkFileInSlices (cognitive 16) Sources/OmniKit/VectorStore.swift:3818 — VectorStore.shrinkFileInSlices 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.
D2 · Cognitive Complexity · VectorStore.allIndexedPaths (cognitive 16) · ×1
  • VectorStore.allIndexedPaths (cognitive 16) Sources/OmniKit/VectorStore.swift:4810 — VectorStore.allIndexedPaths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.fillSnippetsLocked (cognitive 16) · ×1
  • VectorStore.fillSnippetsLocked (cognitive 16) Sources/OmniKit/VectorStore.swift:7951 — VectorStore.fillSnippetsLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.resolveTagFilterLocked (cognitive 16) · ×1
  • VectorStore.resolveTagFilterLocked (cognitive 16) Sources/OmniKit/VectorStore.swift:8439 — VectorStore.resolveTagFilterLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.retireContentsSharingAPositionOnceLocked (cognitive 16) · ×1
  • VectorStore.retireContentsSharingAPositionOnceLocked (cognitive 16) Sources/OmniKit/VectorStore.swift:11880 — VectorStore.retireContentsSharingAPositionOnceLocked has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 4, loops 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · VectorStore.reclaimByTail (cognitive 16) · ×1
  • VectorStore.reclaimByTail (cognitive 16) Sources/OmniKit/VectorStore.swift:12515 — VectorStore.reclaimByTail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.scopeLocked (cognitive 16) · ×1
  • VectorStore.scopeLocked (cognitive 16) Sources/OmniKit/VectorStore.swift:14554 — VectorStore.scopeLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (6 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorStore.prepareChunkInsertLocked (cognitive 16) · ×1
  • VectorStore.prepareChunkInsertLocked (cognitive 16) Sources/OmniKit/VectorStore.swift:16706 — VectorStore.prepareChunkInsertLocked has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (7 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · VectorStore.appendChunksLocked (cognitive 16) · ×1
  • VectorStore.appendChunksLocked (cognitive 16) Sources/OmniKit/VectorStore.swift:18135 — VectorStore.appendChunksLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (4 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.
D2 · Cognitive Complexity · Checkpointer.runOne (cognitive 16) · ×1
  • Checkpointer.runOne (cognitive 16) Sources/OmniKit/VectorStore.swift:5385 — Checkpointer.runOne has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · PaperLevers.applying (cognitive 16) · ×1
  • PaperLevers.applying (cognitive 16) Sources/OmniKit/Paper/PaperLevers.swift:173 — PaperLevers.applying has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LinkNode.dial (cognitive 16) · ×1
  • LinkNode.dial (cognitive 16) Sources/OmniLink/LinkNode.swift:417 — LinkNode.dial has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AppModel.rawResults (cognitive 16) · ×1
  • AppModel.rawResults (cognitive 16) App/AppModel.swift:474 — AppModel.rawResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppModel.pickPage (cognitive 16) · ×1
  • AppModel.pickPage (cognitive 16) App/AppModel.swift:572 — AppModel.pickPage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ResultRow.cell (cognitive 16) · ×1
  • ResultRow.cell (cognitive 16) App/ResultsList.swift:784 — ResultRow.cell has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LinkController.refresh (cognitive 16) · ×1
  • LinkController.refresh (cognitive 16) App/Link/LinkController.swift:202 — LinkController.refresh has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, loops 4. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchAdapter.rows (cognitive 16) · ×1
  • SearchAdapter.rows (cognitive 16) App/Serving/SchemaAdapters.swift:471 — SearchAdapter.rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, ternaries 4 (5 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.
D2 · Cognitive Complexity · ServingController.lanAddress (cognitive 16) · ×1
  • ServingController.lanAddress (cognitive 16) App/Serving/ServingController.swift:490 — ServingController.lanAddress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalCommand.generate (cognitive 16) · ×1
  • EvalCommand.generate (cognitive 16) Sources/omni-verify/Eval.swift:100 — EvalCommand.generate has cognitive complexity 16 (threshold 15). Drivers by points: loops 9, if/else 4 (6 pts), ternaries 1 (nesting depth added 2). 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.
D2 · Cognitive Complexity · ShotBench.hints (cognitive 16) · ×1
  • ShotBench.hints (cognitive 16) Sources/omni-verify/ShotBench.swift:373 — ShotBench.hints has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 2 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 9). 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.
D2 · Cognitive Complexity · ShotBench.listRange (cognitive 16) · ×1
  • ShotBench.listRange (cognitive 16) Sources/omni-verify/ShotBench.swift:440 — ShotBench.listRange has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (6 pts), ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (time). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · main.swift.storeauditRun (cognitive 16) · ×1
  • main.swift.storeauditRun (cognitive 16) Sources/omni-verify/main.swift:1315 — main.swift.storeauditRun has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, if/else 4 (6 pts), boolean chains 2, loops 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 2 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. This file is where this pass's cognitive complexity CONCENTRATES: Sources/omni-verify/main.swift holds 17 of the 406 methods over the threshold — including the worst — and 3999 of the 12075 points over it (33%), 2.1× the next-largest file (Sources/OmniKit/VectorStore.swift at 1883). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: ProfilingService.swift → OmniApp.swift, SettingsView.swift, Sidebar.swift App/ProfilingService.swift — `App/ProfilingService.swift` changes together with 3 other files — `App/OmniApp.swift`, `App/SettingsView.swift`, `App/Sidebar.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Edited copy of a member (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) Sources/OmniKit/BulkDirWalker.swift:60 — Sources/OmniKit/BulkDirWalker.swift:60-135 | Sources/crawlbench/main.swift:26-89 — These two members are one piece of code written twice and then edited apart: 64 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 (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) App/PhotoSourceBrowser.swift:87 — App/PhotoSourceBrowser.swift:87-119 | App/RecentsBrowser.swift:99-132 — These two members are one piece of code written twice and then edited apart: 33 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 (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) App/Sidebar.swift:930 — App/Sidebar.swift:930-968 | App/Sidebar.swift:985-1031 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) App/Serving/MCPAdapter.swift:1314 — App/Serving/MCPAdapter.swift:1314-1331 | App/Thumbnail.swift:325-339 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) Sources/OmniKit/OCR/OCRPreprocess.swift:118 — Sources/OmniKit/OCR/OCRPreprocess.swift:118-145 | Sources/OmniKit/OCR/OCRPreprocess.swift:147-173 — 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 (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) Sources/OmniKit/VectorStore.swift:6657 — Sources/OmniKit/VectorStore.swift:6657-6675 | Sources/OmniKit/VectorStore.swift:6751-6767 — These two members are one piece of code written twice and then edited apart: 17 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 (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) Sources/OmniKit/OmniVideoPreprocess.swift:196 — Sources/OmniKit/OmniVideoPreprocess.swift:196-214 | Sources/OmniKit/OmniVisionPreprocess.swift:158-183 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) Sources/OmniKit/Paper/PaperCaseCatalog.swift:596 — Sources/OmniKit/Paper/PaperCaseCatalog.swift:596-615 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:639-658 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) Sources/OmniKit/Paper/PaperCaseCatalog.swift:329 — Sources/OmniKit/Paper/PaperCaseCatalog.swift:329-352 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:446-464 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:660-685 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) App/Serving/MCPAdapter.swift:890 — App/Serving/MCPAdapter.swift:890-900 | App/Thumbnail.swift:292-303 | Sources/OmniKit/ScreenText.swift:84-95 | Sources/omni-verify/ShotBench.swift:207-218 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) Sources/OmniKit/VectorStore.swift:4412 — Sources/OmniKit/VectorStore.swift:4412-4435 | Sources/OmniKit/VectorStore.swift:4759-4783 | Sources/OmniKit/VectorStore.swift:6908-6929 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) Sources/OmniKit/Paper/PaperCorpus.swift:396 — Sources/OmniKit/Paper/PaperCorpus.swift:396-414 | Sources/OmniKit/Paper/PaperCorpus.swift:416-434 | Sources/OmniKit/Paper/PaperCorpus.swift:436-451 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 15+ corresponding lines) Sources/OmniKit/Paper/PaperCaseCatalog.swift:310 — Sources/OmniKit/Paper/PaperCaseCatalog.swift:310-327 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:490-508 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:510-529 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:577-594 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:689-703 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:707-723 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) Sources/OmniKit/Paper/PaperCaseCatalog.swift:264 — Sources/OmniKit/Paper/PaperCaseCatalog.swift:264-289 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:291-308 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:400-414 | Sources/OmniKit/Paper/PaperCaseCatalog.swift:466-488 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) App/Serving/MCPAdapter.swift:914 — App/Serving/MCPAdapter.swift:914-933 | App/Serving/MCPAdapter.swift:1139-1161 | App/Serving/MCPAdapter.swift:1601-1616 | App/Serving/MCPAdapter.swift:1618-1634 | App/Serving/MCPAdapter.swift:1636-1651 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) Sources/OmniKit/EnrichLedger.swift:122 — Sources/OmniKit/EnrichLedger.swift:122-135 | Sources/OmniKit/IDIndex.swift:164-179 | Sources/OmniKit/VectorStore.swift:6888-6904 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) Sources/OmniKit/VectorStore.swift:15322 — Sources/OmniKit/VectorStore.swift:15322-15327 | Sources/OmniKit/VectorStore.swift:15330-15335 | Sources/OmniKit/VectorStore.swift:16147-16152 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) App/AppModel.swift:1348 — App/AppModel.swift:1348-1358 | App/AppModel.swift:1584-1595 | App/Serving/ServingTab.swift:409-417 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) App/ChunkPreview.swift:23 — App/ChunkPreview.swift:23-26 | App/OpenAtHit.swift:114-117 | Sources/OmniKit/PDFPagePick.swift:51-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (15–36 lines × 3) · ×1
  • Duplicated block (15–36 lines × 3) App/FolderBrowser.swift:271 — App/FolderBrowser.swift:271-306 | App/PhotoSourceBrowser.swift:162-177 | App/RecentsBrowser.swift:170-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `App/FolderBrowser.swift:271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) Sources/omni-verify/main.swift:3637 — Sources/omni-verify/main.swift:3637-3664 | Sources/omni-verify/main.swift:3763-3789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–26 lines × 3) · ×1
  • Duplicated block (11–26 lines × 3) Sources/OmniKit/Indexer.swift:1287 — Sources/OmniKit/Indexer.swift:1287-1312 | Sources/OmniKit/Indexer.swift:1345-1355 | Sources/OmniKit/Indexer.swift:1402-1412 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Indexer.swift:1287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) App/Serving/SchemaAdapters.swift:532 — App/Serving/SchemaAdapters.swift:532-552 | App/Serving/SchemaAdapters.swift:724-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) Sources/OmniKit/Indexer.swift:2011 — Sources/OmniKit/Indexer.swift:2011-2025 | Sources/OmniKit/Indexer.swift:4162-4180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Indexer.swift:2011` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) Sources/OmniKit/ModelDownloader.swift:255 — Sources/OmniKit/ModelDownloader.swift:255-269 | Sources/OmniKit/OCR/OCRModelDownloader.swift:142-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) Sources/omni-verify/main.swift:4529 — Sources/omni-verify/main.swift:4529-4545 | Sources/omni-verify/main.swift:4552-4567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) App/PhotoSourceBrowser.swift:132 — App/PhotoSourceBrowser.swift:132-147 | App/RecentsBrowser.swift:142-154 — before extracting anything, compare `App/PhotoSourceBrowser.swift` and `App/RecentsBrowser.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 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 `App/PhotoSourceBrowser.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.
D4 · Code Duplication · Duplicated block (10–16 lines × 2) · ×1
  • Duplicated block (10–16 lines × 2) Sources/OmniKit/OmniVideoPreprocess.swift:197 — Sources/OmniKit/OmniVideoPreprocess.swift:197-206 | Sources/OmniKit/OmniVisionPreprocess.swift:159-174 — 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) App/Link/LinkViews.swift:338 — App/Link/LinkViews.swift:338-352 | App/PhotoSourceBrowser.swift:143-157 | App/RecentsBrowser.swift:150-164 — before extracting anything, compare `App/PhotoSourceBrowser.swift` and `App/RecentsBrowser.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 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 `App/Link/LinkViews.swift:338` it begins part-way through the construct above it, so those 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, `App/RecentsBrowser.swift:165` calls `help` and `App/PhotoSourceBrowser.swift:158` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) App/FolderBrowser.swift:137 — App/FolderBrowser.swift:137-151 | App/RecentsBrowser.swift:32-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `App/FolderBrowser.swift:137` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (3–15 lines × 4) · ×1
  • Duplicated block (3–15 lines × 4) App/ResultsList.swift:176 — App/ResultsList.swift:176-178 | App/ResultsList.swift:217-220 | App/ResultsList.swift:381-395 | App/ResultsList.swift:413-423 — 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 `App/ResultsList.swift:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) Sources/OmniKit/OmniVideoPreprocess.swift:87 — Sources/OmniKit/OmniVideoPreprocess.swift:87-101 | Sources/OmniKit/OmniVisionPreprocess.swift:67-80 — 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.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) Sources/OmniKit/Indexer.swift:1365 — Sources/OmniKit/Indexer.swift:1365-1372 | Sources/OmniKit/Indexer.swift:1411-1421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Indexer.swift:1365` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–11 lines × 3) · ×1
  • Duplicated block (4–11 lines × 3) Sources/omni-verify/main.swift:5911 — Sources/omni-verify/main.swift:5911-5914 | Sources/omni-verify/main.swift:6251-6263 | Sources/omni-verify/main.swift:6496-6506 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:5911` 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, `Sources/omni-verify/main.swift:6263` calls `Int` and `Sources/omni-verify/main.swift:5914` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–11 lines × 3) · ×1
  • Duplicated block (3–11 lines × 3) Sources/omni-verify/main.swift:7597 — Sources/omni-verify/main.swift:7597-7608 | Sources/omni-verify/main.swift:7897-7899 | Sources/omni-verify/main.swift:8266-8276 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:7597` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) App/FolderBrowser.swift:414 — App/FolderBrowser.swift:414-423 | App/PhotoSourceBrowser.swift:110-119 | App/RecentsBrowser.swift:123-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. Read the line range as the matched WINDOW rather than a finished unit: at `App/FolderBrowser.swift:414` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) App/ResultsList.swift:187 — App/ResultsList.swift:187-196 | App/ResultsList.swift:226-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/ResultsList.swift:187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) Sources/omni-verify/main.swift:2578 — Sources/omni-verify/main.swift:2578-2589 | Sources/omni-verify/main.swift:3899-3909 | Sources/omni-verify/main.swift:4044-4052 | Sources/omni-verify/main.swift:4121-4132 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:2578` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) Sources/OmniKit/Indexer.swift:1748 — Sources/OmniKit/Indexer.swift:1748-1754 | Sources/OmniKit/Indexer.swift:1944-1950 | Sources/OmniKit/Indexer.swift:4064-4072 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/Indexer.swift:1748` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) Sources/omni-verify/main.swift:2669 — Sources/omni-verify/main.swift:2669-2683 | Sources/omni-verify/main.swift:5362-5369 | Sources/omni-verify/main.swift:8724-8732 | Sources/omni-verify/main.swift:9025-9035 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:2669` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) Sources/omni-verify/main.swift:6871 — Sources/omni-verify/main.swift:6871-6878 | Sources/omni-verify/main.swift:7101-7109 | Sources/omni-verify/main.swift:9795-9810 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:6871` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) App/Serving/MCPAdapter.swift:919 — App/Serving/MCPAdapter.swift:919-926 | App/Serving/MCPAdapter.swift:1058-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `App/Serving/MCPAdapter.swift:919` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×1
  • Duplicated block (12 lines × 2) Sources/OmniKit/BulkDirWalker.swift:115 — Sources/OmniKit/BulkDirWalker.swift:115-126 | Sources/crawlbench/main.swift:70-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/BulkDirWalker.swift:115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) Sources/omni-verify/main.swift:1810 — Sources/omni-verify/main.swift:1810-1821 | Sources/omni-verify/main.swift:1892-1907 | Sources/omni-verify/main.swift:3275-3284 | Sources/omni-verify/main.swift:4093-4098 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:1810` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–6 lines × 3) · ×1
  • Duplicated block (5–6 lines × 3) Sources/OmniKit/EnrichLedger.swift:125 — Sources/OmniKit/EnrichLedger.swift:125-129 | Sources/OmniKit/IDIndex.swift:168-173 | Sources/OmniKit/VectorStore.swift:6892-6896 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/EnrichLedger.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. 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (2–6 lines × 4) · ×1
  • Duplicated block (2–6 lines × 4) Sources/OmniKit/VectorStore.swift:6716 — Sources/OmniKit/VectorStore.swift:6716-6721 | Sources/OmniKit/VectorStore.swift:7246-7251 | Sources/OmniKit/VectorStore.swift:7279-7280 | Sources/OmniKit/VectorStore.swift:7630-7631 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OmniKit/VectorStore.swift:6716` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 12) · ×1
  • Duplicated block (5 lines × 12) Sources/omni-verify/main.swift:1811 — Sources/omni-verify/main.swift:1811-1821 | Sources/omni-verify/main.swift:1893-1907 | Sources/omni-verify/main.swift:3276-3284 | Sources/omni-verify/main.swift:3457-3466 | Sources/omni-verify/main.swift:3818-3827 | Sources/omni-verify/main.swift:4094-4098 | Sources/omni-verify/main.swift:6602-6617 | Sources/omni-verify/main.swift:6871-6878 | Sources/omni-verify/main.swift:7042-7049 | Sources/omni-verify/main.swift:7101-7109 | Sources/omni-verify/main.swift:9356-9366 | Sources/omni-verify/main.swift:9795-9810 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:1811` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (2–5 lines × 6) · ×1
  • Duplicated block (2–5 lines × 6) Sources/filterbench/main.swift:32 — Sources/filterbench/main.swift:32-36 | Sources/omni-verify/main.swift:1737-1741 | Sources/omni-verify/main.swift:1831-1832 | Sources/omni-verify/main.swift:1917-1918 | Sources/omni-verify/main.swift:2620-2621 | Sources/omni-verify/main.swift:2693-2697 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/filterbench/main.swift:32` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–5 lines × 3) · ×1
  • Duplicated block (3–5 lines × 3) App/Serving/MCPAdapter.swift:1323 — App/Serving/MCPAdapter.swift:1323-1325 | Sources/OmniKit/FileExtractor.swift:271-275 | Sources/OmniPages/main.swift:68-72 — 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 `App/Serving/MCPAdapter.swift:1323` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/OmniPages/main.swift:67` calls `setFillColor`, `CGColor`, `fill` and `App/Serving/MCPAdapter.swift:1323` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (1–5 lines × 8) · ×1
  • Duplicated block (1–5 lines × 8) Sources/omni-verify/main.swift:3849 — Sources/omni-verify/main.swift:3849-3853 | Sources/omni-verify/main.swift:3947-3949 | Sources/omni-verify/main.swift:3950-3950 | Sources/omni-verify/main.swift:3951-3951 | Sources/omni-verify/main.swift:4105-4105 | Sources/omni-verify/main.swift:4106-4106 | Sources/omni-verify/main.swift:7076-7077 | Sources/omni-verify/main.swift:9835-9839 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/omni-verify/main.swift:3849` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/omni-verify/main.swift:3849` calls `VectorStore` and `Sources/omni-verify/main.swift:3947` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) Sources/OmniKit/OCR/OCRBatched.swift:135 — Sources/OmniKit/OCR/OCRBatched.swift:135-139 | Sources/OmniKit/OCR/OCRBatched.swift:191-195 | Sources/OmniKit/OCR/OCRBatched.swift:804-808 | Sources/OmniKit/OCR/OCRBatched.swift:845-849 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/OmniKit/OCR/OCRBatched.swift:850` calls `Sendable` and `Sources/OmniKit/OCR/OCRBatched.swift:809` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) Sources/omni-verify/main.swift:2914 — Sources/omni-verify/main.swift:2914-2919 | Sources/omni-verify/main.swift:2932-2937 | Sources/omni-verify/main.swift:2967-2972 — 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.
D4 · Code Duplication · Edited copy of a member (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) Tools/gen_image_fixtures.py:232 — Tools/gen_image_fixtures.py:232-304 | Tools/gen_video_fixtures.py:247-328 — These two members are one piece of code written twice and then edited apart: 73 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 (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) Tools/gen_image_fixtures.py:127 — Tools/gen_image_fixtures.py:127-176 | Tools/gen_video_fixtures.py:159-215 — These two members are one piece of code written twice and then edited apart: 50 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 · Duplicated block (23–28 lines × 2) · ×1
  • Duplicated block (23–28 lines × 2) Tools/gen_image_fixtures.py:280 — Tools/gen_image_fixtures.py:280-302 | Tools/gen_video_fixtures.py:298-325 — 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/gen_video_fixtures.py:298` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) Tools/gen_audio_fixtures.py:232 — Tools/gen_audio_fixtures.py:232-253 | Tools/gen_image_fixtures.py:274-295 | Tools/gen_video_fixtures.py:292-313 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Tools/gen_audio_fixtures.py:232` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–9 lines × 3) · ×1
  • Duplicated block (4–9 lines × 3) Tools/video/launch/music.py:25 — Tools/video/launch/music.py:25-33 | Tools/video/launch/vo.py:32-35 | Tools/video/linked/music.py:25-33 — 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 `Tools/video/launch/music.py:25` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (6–8 lines × 4) · ×1
  • Duplicated block (6–8 lines × 4) Tools/gen_audio_fixtures.py:176 — Tools/gen_audio_fixtures.py:176-183 | Tools/gen_fixtures.py:43-48 | Tools/gen_image_fixtures.py:221-228 | Tools/gen_video_fixtures.py:236-243 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) Tools/video/launch/render.py:66 — Tools/video/launch/render.py:66-92 | Tools/video/linked/render.py:68-94 — `Tools/video/launch/render.py` and `Tools/video/linked/render.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `Tools/video/launch/render.py: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. 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×1
  • Swallowed exception (empty catch) App/AppModel.swift:6608 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Minor — 29 finding(s)
X7 · Silent fallback defaults · Silent fallback default in catch · ×9
  • Silent fallback default in catch Sources/OmniKit/OmniTextEncoder.swift:86 — `tokenIds` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Sources/OmniKit/OmniTextEncoder.swift:92 — `prefixTokenIds` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Sources/OmniKit/ScreenText.swift:25 — `lines` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Sources/OmniKit/OCR/OCRCache.swift:194 — `move` 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 Sources/OmniKit/OCR/OCRCache.swift:210 — `storedBytes` 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 App/Updater.swift:176 — `fetchReleaseNotes` 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 App/Updater.swift:416 — `md5Hex` 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 App/Link/LinkController.swift:507 — `passages` 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 App/Serving/ServingLog.swift:120 — `tail` 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.
X10 · Duplicated predicate · Duplicated predicate · ×7
  • Duplicated predicate Tools/video/launch/render.py:21 — `prev is not None and (prev, shot) in film.DISSOLVE` appears character-identically in 2 files — Tools/video/launch/render.py, Tools/video/linked/render.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/OmniKit/EnrichLedger.swift:154 — `openLocked() && metaLocked("backfilled") == "1"` appears character-identically in 2 files — Sources/OmniKit/EnrichLedger.swift, Sources/OmniKit/IDIndex.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 App/OCRSession.swift:1261 — `page.state == .pending || page.state == .stopped || (page.state == .done && page.truncatedByStop)` appears character-identically in 2 files — App/OCRSession.swift, App/OCRView.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 App/AppModel.swift:2515 — `path == $0.path || path.hasPrefix($0.path + "/")` appears character-identically in 2 files — App/AppModel.swift, Sources/OmniKit/FileCrawler.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 App/FolderEmbeddingVisualization.swift:462 — `prev == u.startIndex || u[u.index(before: prev)] == UInt8(ascii: "/")` appears character-identically in 2 files — App/FolderEmbeddingVisualization.swift, Sources/omni-verify/main.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/OmniKit/OmniTagger.swift:83 — `snippet == base || snippet == "\(base) - \(base)"` appears character-identically in 2 files — Sources/OmniKit/OmniTagger.swift, Sources/OmniKit/VectorStore.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Sources/OmniKit/OmniTagger.swift:85 — `snippet.hasPrefix(pagePrefix) && Int(snippet.dropFirst(pagePrefix.count)) != nil` appears character-identically in 2 files — Sources/OmniKit/OmniTagger.swift, Sources/OmniKit/VectorStore.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.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure Tools/video/launch/render.py:63 — `_frames_in` returns `-1` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure Tools/video/linked/render.py:65 — `_frames_in` returns `-1` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on the handler or in the docstring, and the row stops firing.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found Package.swift:10 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `Package.swift` makes this repository a deployable product (line 10).
D21 · Naming Consistency · `othersGPUNs` spells `Ns` where 34 names in the project spell it `NS` · ×1
  • `othersGPUNs` spells `Ns` where 34 names in the project spell it `NS` Sources/OmniKit/Paper/PaperSuite.swift:224 — 34 of 35 names in project OmniCLI spell the token `NS` (34 of 35; unit: names in project OmniCLI containing `NS`). Peers: ContentKeyMonitor.makeNSView (App/ContentKeys.swift:44); ContentKeyMonitor.updateNSView (App/ContentKeys.swift:50); ContentKeyMonitor.dismantleNSView (App/ContentKeys.swift:54); WindowTitleHider.makeNSView (App/ContentView.swift:1201); WindowTitleHider.updateNSView (App/ContentView.swift:1206). Rename to `othersGPUNS`. [rule N6]
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 3 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.
P6 · Release Hygiene · No changelog · ×1
  • 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.)
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~2.9 `!` null assertions per 1k TypeScript source lines — 2 assertion(s) across the 680 source line(s) of the 1 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: worker/src/index.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex App/MarkdownBlock.swift:356 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Minor — 2 finding(s)
D12 · Dependency Hygiene · Outdated · ×2
  • Outdated: mlx-swift — `mlx-swift` is resolved at 0.31.3, but 0.33.0 is the newest release tagged on https://github.com/ml-explore/mlx-swift within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update mlx-swift` reaches this one with no change to Package.swift.
  • Outdated: swift-tokenizers — `swift-tokenizers` is resolved at 0.7.0, but 0.7.5 is the newest release tagged on https://github.com/DePasqualeOrg/swift-tokenizers within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-tokenizers` reaches this one with no change to Package.swift.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-6e62fc8f16da483d8c415589438b9daa/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=757" --report-format json --report-path /tmp/watchdog-gitleaks-6e62fc8f16da483d8c415589438b9daa/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=957 --max-count=258" --report-format json --report-path /tmp/watchdog-gitleaks-6e62fc8f16da483d8c415589438b9daa/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-6e62fc8f16da483d8c415589438b9daa/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .10artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 23 file(s) — `App/AppModel.swift`, `App/ContentKeys.swift`, `App/ContentView.swift`, `App/Link/RemoteFiles.swift`, `App/OCRSession.swift`, … (+18 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—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.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1eb0a-d4d0-736f-a345-73620bc48a30 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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