Public report of iFurySt/open-codex-computer-use, published 29 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 29 October 2026, 10:10 UTC · Survey ID cd_b4aa9569acf5447086d7d1dccc537a93
iFurySt/open-codex-computer-use
Measured 29 October 2026, 10:07 UTC, at code version c6ffbce
No regression since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 1 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 34,115 lines of product code in 14 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Production Readiness, 50
Findings by how serious they are
1 critical472 serious22 minor
20 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 October 2026, 10:07 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
71of 71 dimensions measured by tools.
482of 495 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
71dimensions across 6 lenses, read from 34,115 lines of product code in 14 projects.
iFurySt/open-codex-computer-use falls short of our standard for production because we found no automated security scanning of the code, its secrets or its dependencies. It scores 58 out of 100 and is rated Adequate, and its one critical finding is a security problem in the build pipeline.
Production Readiness, at 50, is the weakest lens and counts most in the score. The best first steps are adding automated security scanning and adding type checking, each worth about 5 points. Raising Production Readiness to 70 would lift the score to about 63.
One secret can leak from the build pipeline. Limiting the secret to its own step would close this risk.
The product code is 34,115 lines, about €45,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Test Quality · Skipped test: testLiveSettingsListGeometry apps/OpenComputerUse/Tests/PermissionOnboardingTests/PermissionListAnchorTests.swift
Test Quality · Skipped test: testServiceClickRegistersLiveWindowAndFeedbackMatchesMovedButton packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift
Test Quality · Skipped test: testRealAccessibilityWindowFollowsTravelPulseAndIdleAcrossDisplays packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift
Test Quality · Skipped test: testKernelRecheckAcceptsSameLivePeerAndRejectsForgedHashOrToken packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/LockedUsePeerRevalidationTests.swift
Test Quality · Skipped test: testRealAXTextViewSupportsUTF16SelectionAndBothCaretModes packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/TextSelectionOperationTests.swift
Test Quality · No assertions: testCompletedLaunchUsesExactTargetSize apps/OpenComputerUse/Tests/PermissionOnboardingTests/PermissionAccessoryPanelTests.swift
Test Quality · No assertions: testNewGuidanceAfterInterruptedLaunchUsesFullPanel apps/OpenComputerUse/Tests/PermissionOnboardingTests/PermissionAccessoryPanelTests.swift
Test Quality · No assertions: testIdleFollowsRepeatedMovesAndReturnToOriginalFrame packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift
Test Quality · No assertions: testClickPulseTracksMovesDuringBothClicks packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift
Test Quality · No assertions: testTravelAbortActuallyPlacesVisibleTipAtMovedWindow packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift
Test Quality · No assertions: testUnanchoredTargetDoesNotKeepPreviousWindowTracking packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 10 findings
These 10 critical or serious findings were in the previous survey, on 15 October 2026, and are gone from this one.
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) apps/OpenComputerUseLinux/main.go
€15,000 to €75,000, for 250 to 794 hours of work, about 0.3 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 58. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 34,115 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 5 points · Medium effort · Type Safety
3
Raise allocation-aware density on the hot paths — currently 28 use(s) across 33,222 production line(s) (~0.8/1k).
More of the idioms below on the allocation-heavy paths climbs this toward 10.
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 €45,000 to build again, about 0.3 person-years of work. Its weakest lens is Production Readiness, at 50 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
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. Of all the actions in this report, it raises the score most for the work it takes: about 5 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.8 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 32,935 lines over the last 90 days, which is about 133,570 lines a year. At that pace, the extra work comes to an estimated 18.2 to 109.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
24 modules, with 13 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
Uses a module listed above itPart of a loopThe module itself
15→17 packages~OpenComputerUseKit~OpenComputerUseKit uses experiments~CursorMotion~CursorMotionpart of a loop✕
Connections
130 pairs of types, where a type in packages~OpenComputerUseKit~OpenComputerUseKit uses a type in experiments~CursorMotion~CursorMotion. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
packages~OpenComputerUseKit~OpenComputerUseKit uses experiments~CursorMotion~CursorMotion, so a change to experiments~CursorMotion~CursorMotion can break packages~OpenComputerUseKit~OpenComputerUseKit, while a change to packages~OpenComputerUseKit~OpenComputerUseKit can't break experiments~CursorMotion~CursorMotion.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
scripts.cursor-motion-re uses scripts.cursor-motion-re.official_cursor_motion, so a change to scripts.cursor-motion-re.official_cursor_motion can break scripts.cursor-motion-re, while a change to scripts.cursor-motion-re can't break scripts.cursor-motion-re.official_cursor_motion.
Position
Below the diagonal: scripts.cursor-motion-re uses a module listed above it, which is the healthy direction.
experiments~CursorMotion~CursorMotion uses packages~OpenComputerUseKit~OpenComputerUseKit, so a change to packages~OpenComputerUseKit~OpenComputerUseKit can break experiments~CursorMotion~CursorMotion, while a change to experiments~CursorMotion~CursorMotion can't break packages~OpenComputerUseKit~OpenComputerUseKit.
Position
Below the diagonal: experiments~CursorMotion~CursorMotion uses a module listed above it, which is the healthy direction.
experiments~LockedUse~Broker uses packages~OpenComputerUseKit~OpenComputerUseKit, so a change to packages~OpenComputerUseKit~OpenComputerUseKit can break experiments~LockedUse~Broker, while a change to experiments~LockedUse~Broker can't break packages~OpenComputerUseKit~OpenComputerUseKit.
Position
Below the diagonal: experiments~LockedUse~Broker uses a module listed above it, which is the healthy direction.
experiments~LockedUse~Guardian uses packages~OpenComputerUseKit~OpenComputerUseKit, so a change to packages~OpenComputerUseKit~OpenComputerUseKit can break experiments~LockedUse~Guardian, while a change to experiments~LockedUse~Guardian can't break packages~OpenComputerUseKit~OpenComputerUseKit.
Position
Below the diagonal: experiments~LockedUse~Guardian uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite uses a type in packages~OpenComputerUseKit~OpenComputerUseKit.
apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite uses packages~OpenComputerUseKit~OpenComputerUseKit, so a change to packages~OpenComputerUseKit~OpenComputerUseKit can break apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite, while a change to apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite can't break packages~OpenComputerUseKit~OpenComputerUseKit.
Position
Below the diagonal: apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite uses a module listed above it, which is the healthy direction.
apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite uses experiments~CursorMotion~CursorMotion, so a change to experiments~CursorMotion~CursorMotion can break apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite, while a change to apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite can't break experiments~CursorMotion~CursorMotion.
Position
Below the diagonal: apps~OpenComputerUseSmokeSuite~OpenComputerUseSmokeSuite uses a module listed above it, which is the healthy direction.
apps~OpenComputerUse~OpenComputerUse uses packages~OpenComputerUseKit~OpenComputerUseKit, so a change to packages~OpenComputerUseKit~OpenComputerUseKit can break apps~OpenComputerUse~OpenComputerUse, while a change to apps~OpenComputerUse~OpenComputerUse can't break packages~OpenComputerUseKit~OpenComputerUseKit.
Position
Below the diagonal: apps~OpenComputerUse~OpenComputerUse uses a module listed above it, which is the healthy direction.
apps~OpenComputerUse~OpenComputerUse uses experiments~CursorMotion~CursorMotion, so a change to experiments~CursorMotion~CursorMotion can break apps~OpenComputerUse~OpenComputerUse, while a change to apps~OpenComputerUse~OpenComputerUse can't break experiments~CursorMotion~CursorMotion.
Position
Below the diagonal: apps~OpenComputerUse~OpenComputerUse uses a module listed above it, which is the healthy direction.
experiments~StandaloneCursor~StandaloneCursorSupport uses experiments~CursorMotion~CursorMotion, so a change to experiments~CursorMotion~CursorMotion can break experiments~StandaloneCursor~StandaloneCursorSupport, while a change to experiments~StandaloneCursor~StandaloneCursorSupport can't break experiments~CursorMotion~CursorMotion.
Position
Below the diagonal: experiments~StandaloneCursor~StandaloneCursorSupport uses a module listed above it, which is the healthy direction.
repository uses experiments~CursorMotion~CursorMotion, so a change to experiments~CursorMotion~CursorMotion can break repository, while a change to repository can't break experiments~CursorMotion~CursorMotion.
Position
Below the diagonal: repository uses a module listed above it, which is the healthy direction.
experiments~StandaloneCursor~StandaloneCursor uses experiments~CursorMotion~CursorMotion, so a change to experiments~CursorMotion~CursorMotion can break experiments~StandaloneCursor~StandaloneCursor, while a change to experiments~StandaloneCursor~StandaloneCursor can't break experiments~CursorMotion~CursorMotion.
Position
Below the diagonal: experiments~StandaloneCursor~StandaloneCursor uses a module listed above it, which is the healthy direction.
experiments~StandaloneCursor~StandaloneCursor uses experiments~StandaloneCursor~StandaloneCursorSupport, so a change to experiments~StandaloneCursor~StandaloneCursorSupport can break experiments~StandaloneCursor~StandaloneCursor, while a change to experiments~StandaloneCursor~StandaloneCursor can't break experiments~StandaloneCursor~StandaloneCursorSupport.
Position
Below the diagonal: experiments~StandaloneCursor~StandaloneCursor uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 51% · Adequate · gated by D1, D2, R1 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2025 — Software Supply Chain Failures
5
Medium
A05:2025 — Injection
2
High / Critical
A02:2025 — Security Misconfiguration
1
Medium
Roadmap
First, integrate automated security scanning into the CI pipeline to block regressions and adopt TypeScript with strict type checking to improve frontend reliability. Next, optimize hot paths by reducing unnecessary memory allocations and replacing synchronous operations with asynchronous equivalents to enhance latency. Finally, extend structured logging across all runnable modules to ensure full observability and diagnosability in production.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raise allocation-aware density on the hot paths — currently 28 use(s) across 33,222 production line(s) (~0.8/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Resolve the 9 No assertions finding(s) in Test Quality — start with CursorWindowFollowTests.swift (4), LockedUseRecoveryDeadlineTests.swift (3), PermissionAccessoryPanelTests.swift (2).
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 1
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 472
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 — 22
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 20
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 71 of 71 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 71 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 482 of 495 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 397 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 4 test source file(s) (.mjs) that it cannot: it reads the test types the .swift frontend declared, so a suite in any other language is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.swift, .mjs) and this repository declares a SwiftPM test suite (OpenComputerUse), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its SwiftPM package dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D20 ADR Quality — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `apps/OpenComputerUse/Sources/OpenComputerUse/LockedUseNativeValidation.swift`, `apps/OpenComputerUseFixture/Sources/OpenComputerUseFixture/main.swift`, `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift`, `experiments/LockedUse/Sources/Guardian/ScreenLock.swift`, `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift`, … (+3 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.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention 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 retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights 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 data-subject rights controls.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Go, Python, Swift, c, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Go, Python, Swift, c, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Objectivec, Python, Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
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.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
+ 68 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with LockedUseBrokerCoordinator.handle (cyclomatic 178), LockScreenInteractor.probe (cyclomatic 99). — 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 2 together lifts Cyclomatic Complexity from 3.8 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 106 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with LockedUseBrokerCoordinator.handle (cognitive 216). — Refactoring it lifts Cognitive Complexity from 2.0 to about 2.5/10.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes6.8 / 10Adequate✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 17 FileTooLong finding(s) in God Classes — start with main.go (3), CursorMotionModel.swift (2), AccessibilitySnapshot.swift. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 10 MethodTooLong finding(s) in God Classes — start with CursorMotionModel.swift (3), LockScreenInteractor.swift, LockedUseBrokerCoordinator.swift. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 5 ClassTooLong finding(s) in God Classes — start with CursorMotionModel.swift (2), ComputerUseService.swift, SoftwareCursorOverlay.swift. — One of this dimension's main actionable groups (5 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
148 duplicated block group(s) detected. A further 7 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 2 of the 155 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.
+ 59 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with main.go (5), CursorMotionModel.swift (2), CursorMotionApp.swift. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 9 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with main.go (4), PermissionOnboardingApp.swift, CursorLabRootView.swift. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 9 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with main.go (5), PermissionOnboardingApp.swift, CursorMotionModel.swift. — One of this dimension's main actionable groups (9 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.9 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
14 production modules (Go+SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 2 module(s) off the main sequence, with abstractness counted on 12 of the 14 (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: StandaloneCursorSupport · ×2
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with SkyLightSPI.swift, MCPAppRuntime.swift. — One of this dimension's main actionable groups (2 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Resolve the 1 Classify ADR enforcement finding(s) in Architectural Integrity — start with core-beliefs.md. — One of this dimension's main actionable groups (1 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
557 test methods: 557 unit, 0 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 42 `it`/`test` case(s) across 4 test file(s) declaring at least one beside 397 .NET test method(s); its tier split is read from package names and paths only. The Python suite contributes 37 test function(s) across 2 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 81 test case(s) across 7 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 0 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.0 / 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.
14 skipped, 9 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 397 tests. Measured on the .swift suite only — at least 4 test source file(s) (.mjs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: testCompletedLaunchUsesExactTargetSize · ×9apps/OpenComputerUse/Tests/PermissionOnboardingTests/PermissionAccessoryPanelTests.swift:26
What to do
Resolve the 14 Skipped test finding(s) in Test Quality — start with CursorWindowFollowTests.swift (2), PermissionListAnchorTests.swift, AgentDisplayLiveTests.swift. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 9 No assertions finding(s) in Test Quality — start with CursorWindowFollowTests.swift (4), LockedUseRecoveryDeadlineTests.swift (3), PermissionAccessoryPanelTests.swift (2). — One of this dimension's main actionable groups (9 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
0 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.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 1 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 1 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. ★ COVERAGE OF THIS VERDICT: it grades this repository's SwiftPM package dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 11 Hotspot finding(s) in Churn × Complexity Hotspots — start with main.go (2), open-computer-use-repl.mjs, AccessibilitySnapshot.swift. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.6 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
12 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is scripts/cursor-motion-re/official_cursor_motion.py. Counted over 83 of the 124 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 34115 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.
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.
1 of 4 build units (Go, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
2 finding(s): 0 critical, 1 high, 1 medium, 0 low. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 83 of the 124 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
What it measures: Whether 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.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 2 of 3 project(s) that lack one — worth up to 1.3 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & 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 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.
Do you agree with this assessment?
P2 · Observability4.8 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `apps/OpenComputerUseLinux`, `apps/OpenComputerUseWindows`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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 17138 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. — .github/workflows/windows-observation.yml:4
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Do you agree with this assessment?
P6 · Release Hygiene8.0 / 10Strong✓ 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.
The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
What to do
Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 28 use(s) across 33,222 production line(s) (~0.8/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`readFileSync` in `runJavaScript` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/node-repl/open-computer-use-cli.mjs:330
`existsSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/node-repl/open-computer-use-cli.mjs:523
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 18 plain JS — the untyped files are scripts/install-config-helper.mjs, scripts/node-repl/ocu-config.mjs, scripts/node-repl/ocu-config.test.mjs, scripts/node-repl/open-computer-use-cli.mjs, scripts/node-repl/open-computer-use-cli.test.mjs, scripts/node-repl/open-computer-use-kernel.mjs (+12 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
scripts/install-config-helper.mjs:233 · scripts/install-config-helper.mjs:270 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/install-config-helper.mjs:233
scripts/install-config-helper.mjs:792 · scripts/install-config-helper.mjs:813 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/install-config-helper.mjs:792
scripts/npm/build-packages.mjs:140 · scripts/npm/publish-packages.mjs:74 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — scripts/npm/build-packages.mjs:140
scripts/install-config-helper.mjs:642 · scripts/node-repl/open-computer-use-repl.mjs:142 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/install-config-helper.mjs:642
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
main has cyclomatic complexity 31 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/open-computer-use-cli.mjs:448
validateSetting has cyclomatic complexity 24 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/ocu-config.mjs:25
query has cyclomatic complexity 23 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/open-computer-use-repl.mjs:310
configCommand has cyclomatic complexity 21 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/ocu-config.mjs:85
installOpencodeMcp has cyclomatic complexity 20 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/install-config-helper.mjs:297
runInteractiveRepl has cyclomatic complexity 19 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/open-computer-use-cli.mjs:347
main has cyclomatic complexity 19 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/install-config-helper.mjs:763
parseJavaScriptArgs has cyclomatic complexity 16 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/open-computer-use-cli.mjs:206
selectText has cyclomatic complexity 15 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/open-computer-use-repl.mjs:362
publishWithRetry has cyclomatic complexity 14 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/npm/publish-packages.mjs:161
handle has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/open-computer-use-repl.mjs:663
normalizeImage has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/node-repl/open-computer-use-repl.mjs:78
validateNotes has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/validate-github-release-notes.mjs:52
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
Do you agree with this assessment?
R4 · Test Coverage8.6 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. — scripts/npm/publish-packages.mjs:1
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling6.7 / 10Adequate✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
What to do
Add eslint as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
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. (×3) — scripts/run-locked-use-native-validation.py:231, scripts/run-locked-use-native-validation.py:255, apps/OpenComputerUseLinux/runtime.py:770
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — scripts/node-repl/open-computer-use-repl.mjs:601
`if _, err := os.Stat(serverBin); err != nil` 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. — scripts/computer-use-cli/main.go:702
`if _, err := os.Stat(filepath.Join(root, defaultServerRelativeBin)); err != nil` 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. — scripts/computer-use-cli/main.go:742
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×9) — packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:392, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift:158, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/TargetedQuery.swift:96, …
`if err != nil` 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. (×6) — apps/OpenComputerUseWindows/main.go:193, apps/OpenComputerUseLinux/main.go:795, apps/OpenComputerUseLinux/main.go:827, …
`except Exception` 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. (×4) — apps/OpenComputerUseLinux/runtime.py:49, apps/OpenComputerUseLinux/runtime.py:105, apps/OpenComputerUseLinux/runtime.py:364, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention 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 retention 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.
C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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 — 54 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's Go 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 Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. 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
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB1 Runtime evidence locked — no reproducible boot — 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.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
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.
D20 ADR Quality — 1 ADR(s) are written in a language our ADR lexicon does not cover, or are too short to tell (undetermined); their sections and statuses were not judged.
D21 Naming Consistency — Naming consistency is measured on C# only; Go, JavaScript, Python, Swift not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ 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# and Visual Basic comments only — this repository's production source is .go, .py, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 8 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage — Coverage not measured — Swift suite
DM1 Domain Modelling — applicable but not scored (1 of 2 signals for this style — below the bar we score at): 13 value object(s)
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Go, JavaScript/TypeScript, Python, Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Swallowed exception (caught, then discarded) scripts/computer-use-cli/main.go:702— `if _, err := os.Stat(serverBin); err != nil` 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) scripts/computer-use-cli/main.go:742— `if _, err := os.Stat(filepath.Join(root, defaultServerRelativeBin)); err != nil` 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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:392— `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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift:158— `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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/TargetedQuery.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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/TargetedQuery.swift:105— `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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/WindowOcclusionKeepAlive.swift:90— `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) experiments/LockedUse/Sources/Guardian/GuardianMain.swift:118— `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) experiments/LockedUse/Sources/Guardian/GuardianMain.swift:127— `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) experiments/LockedUse/AuthorizationPlugin/TaskVerifier.swift:33— `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) experiments/LockedUse/AuthorizationPlugin/TaskVerifierDiagnostics.swift:27— `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) apps/OpenComputerUseWindows/main.go:193— `if err != nil` 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) apps/OpenComputerUseLinux/runtime.py:49— `except Exception` 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) apps/OpenComputerUseLinux/runtime.py:105— `except Exception` 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) apps/OpenComputerUseLinux/runtime.py:364— `except Exception` 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) apps/OpenComputerUseLinux/runtime.py:392— `except Exception` 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) apps/OpenComputerUseLinux/main.go:795— `if err != nil` 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) apps/OpenComputerUseLinux/main.go:827— `if err != nil` 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) apps/OpenComputerUseLinux/main.go:837— `if err != nil` 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) apps/OpenComputerUseLinux/main.go:963— `if err != nil` 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) apps/OpenComputerUseLinux/main.go:1036— `if err != nil` 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.
FileTooLong: OpenComputerUseKit/AccessibilitySnapshot.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift— FileTooLong — 1727 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1227 over it, 3.45× 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: OpenComputerUseKit/ComputerUseService.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift— FileTooLong — 1535 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: ComputerUseService (542-2346). The bar is 500 significant lines; this is 1035 over it, 3.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: CursorMotion/CursorMotionModel.swift experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift— FileTooLong — 1488 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 988 over it, 2.98× 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: cursor-motion-re/official_cursor_motion.py scripts/cursor-motion-re/official_cursor_motion.py— FileTooLong — 1383 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 883 over it, 2.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: OpenComputerUseLinux/main.go apps/OpenComputerUseLinux/main.go— FileTooLong — 1287 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 787 over it, 2.57× 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: OpenComputerUseKit/CursorMotionModel.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift— FileTooLong — 1163 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 663 over it, 2.33× 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: OpenComputerUseWindows/main.go apps/OpenComputerUseWindows/main.go— FileTooLong — 1051 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 551 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: OpenComputerUse/PermissionOnboardingApp.swift apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift— FileTooLong — 988 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 488 over it, 1.98× 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: OpenComputerUseLinux/runtime.py apps/OpenComputerUseLinux/runtime.py— FileTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 242 over it, 1.48× 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: StandaloneCursorSupport/StandaloneCursorModel.swift experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift— FileTooLong — 708 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 208 over it, 1.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: OpenComputerUseKit/SoftwareCursorOverlay.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorOverlay.swift— FileTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: SoftwareCursorOverlay (186-902). The bar is 500 significant lines; this is 138 over it, 1.28× 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: computer-use-cli/main.go scripts/computer-use-cli/main.go— FileTooLong — 607 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 107 over it, 1.21× 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: CursorMotion/CursorLabRootView.swift experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift— FileTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 87 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: StandaloneCursor/StandaloneCursorRootView.swift experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift— FileTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 85 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scripts/install-config-helper.mjs scripts/install-config-helper.mjs— FileTooLong — 548 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 48 over it, 1.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: node-repl/open-computer-use-repl.mjs scripts/node-repl/open-computer-use-repl.mjs— FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 18 over it, 1.04× 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: scripts/codex_dump.py scripts/codex_dump.py— FileTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5 over it, 1.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Hotspot: scripts/node-repl/open-computer-use-repl.mjs scripts/node-repl/open-computer-use-repl.mjs:288— scripts/node-repl/open-computer-use-repl.mjs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in open-computer-use-repl.createCuaApi at line 288. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- scripts/node-repl/open-computer-use-repl.mjs`: 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: apps/OpenComputerUseWindows/main.go apps/OpenComputerUseWindows/main.go:264— apps/OpenComputerUseWindows/main.go changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in service.callTool at line 264. 2 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- apps/OpenComputerUseWindows/main.go`: 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: packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:845— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in TreeRenderer.render at line 845. 2 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.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: apps/OpenComputerUseLinux/main.go apps/OpenComputerUseLinux/main.go:201— apps/OpenComputerUseLinux/main.go changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in service.callTool at line 201. 1 of those changes was a fix/bug commit, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- apps/OpenComputerUseLinux/main.go`: 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: packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:625— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ComputerUseService.click at line 625. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.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: apps/OpenComputerUseLinux/runtime.py apps/OpenComputerUseLinux/runtime.py:804— apps/OpenComputerUseLinux/runtime.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in runtime.perform_operation at line 804. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- apps/OpenComputerUseLinux/runtime.py`: 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: apps/OpenComputerUse/Sources/OpenComputerUse/OpenComputerUseMain.swift apps/OpenComputerUse/Sources/OpenComputerUse/OpenComputerUseMain.swift:25— apps/OpenComputerUse/Sources/OpenComputerUse/OpenComputerUseMain.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in OpenComputerUseMain.run at line 25. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- apps/OpenComputerUse/Sources/OpenComputerUse/OpenComputerUseMain.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: packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:61— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in OpenComputerUseCLI.swift.parseOpenComputerUseCLI at line 61. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.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: experiments/LockedUse/Sources/Installer/InstallerMain.swift experiments/LockedUse/Sources/Installer/InstallerMain.swift:195— experiments/LockedUse/Sources/Installer/InstallerMain.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in InstallerMain.install at line 195. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- experiments/LockedUse/Sources/Installer/InstallerMain.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: scripts/install-config-helper.mjs scripts/install-config-helper.mjs:763— scripts/install-config-helper.mjs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in install-config-helper.main at line 763. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- scripts/install-config-helper.mjs`: 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: packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift:94— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in LockedUseDiagnostics.current at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-31..2026-10-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-31 12:53:48 +08:00' --until='2026-10-29 12:53:48 +08:00' --full-history --no-merges -- packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
MethodTooLong: LockScreenInteractor.probe experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:57— MethodTooLong — probe runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.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.
MethodTooLong: HeadingDrivenCursorMotionModel.descriptors experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1010— MethodTooLong — descriptors runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× 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: HeadingDrivenCursorMotionModel.descriptors packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:815— MethodTooLong — descriptors runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× 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: LockedUseBrokerCoordinator.handle packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseBrokerCoordinator.swift:98— MethodTooLong — handle runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× 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: TreeRenderer.render packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:845— MethodTooLong — render runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GuardianMain.main experiments/LockedUse/Sources/Guardian/GuardianMain.swift:21— MethodTooLong — main runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ComputerUseService.click packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:625— MethodTooLong — click runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HeadingDrivenCursorMotionModel.makePath experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:743— MethodTooLong — makePath 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: AppAgentConnection.handle apps/OpenComputerUse/Sources/OpenComputerUse/MacOSAppAgentProxy.swift:353— MethodTooLong — handle runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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: StandaloneCursorBinaryGuidedModel.makeCandidates experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:420— MethodTooLong — makeCandidates runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (11 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:47— experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:47-57 | experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorApp.swift:46-56 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorApp.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:471— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:471-481 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:383-393 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:471` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1534— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1534-1544 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1289-1299 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1534` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:52— experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:52-62 | experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:65-75 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:52` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) apps/OpenComputerUseLinux/main.go:1225— apps/OpenComputerUseLinux/main.go:1225-1235 | apps/OpenComputerUseWindows/main.go:861-871 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) apps/OpenComputerUseLinux/main.go:1238— apps/OpenComputerUseLinux/main.go:1238-1248 | apps/OpenComputerUseWindows/main.go:874-884 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) apps/OpenComputerUseLinux/main.go:1251— apps/OpenComputerUseLinux/main.go:1251-1261 | apps/OpenComputerUseWindows/main.go:887-897 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) apps/OpenComputerUseLinux/main.go:1061— apps/OpenComputerUseLinux/main.go:1061-1071 | apps/OpenComputerUseWindows/main.go:697-707 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (11 lines × 2) apps/OpenComputerUseLinux/main.go:1375— apps/OpenComputerUseLinux/main.go:1375-1385 | apps/OpenComputerUseWindows/main.go:1022-1032 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (11 lines × 2) scripts/computer-use-cli/app_server.go:312— scripts/computer-use-cli/app_server.go:312-322 | scripts/computer-use-cli/main.go:419-429 — 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 `scripts/computer-use-cli/app_server.go:312` 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.
No assertions: testCompletedLaunchUsesExactTargetSize apps/OpenComputerUse/Tests/PermissionOnboardingTests/PermissionAccessoryPanelTests.swift:26— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testNewGuidanceAfterInterruptedLaunchUsesFullPanel apps/OpenComputerUse/Tests/PermissionOnboardingTests/PermissionAccessoryPanelTests.swift:40— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testIdleFollowsRepeatedMovesAndReturnToOriginalFrame packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift:64— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testClickPulseTracksMovesDuringBothClicks packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift:78— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testTravelAbortActuallyPlacesVisibleTipAtMovedWindow packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift:94— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testUnanchoredTargetDoesNotKeepPreviousWindowTracking packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/CursorWindowFollowTests.swift:110— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testWedgedRPCQueueAndRepeatedRetriesCannotExtendRecoveryDeadline packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/LockedUseRecoveryDeadlineTests.swift:5— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCompletedCleanupCancelsExpiration packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/LockedUseRecoveryDeadlineTests.swift:17— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testEarlierFailureShortensAcquisitionDeadline packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/LockedUseRecoveryDeadlineTests.swift:26— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Duplicated block (12 lines × 2) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1227— apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1227-1238 | scripts/render-open-computer-use-icon.swift:129-140 — before extracting anything, compare `apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift` and `scripts/render-open-computer-use-icon.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift:402— experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift:402-413 | experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift:416-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1403— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1403-1414 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1154-1165 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) apps/OpenComputerUseLinux/main.go:577— apps/OpenComputerUseLinux/main.go:577-588 | apps/OpenComputerUseWindows/main.go:627-638 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (12 lines × 2) apps/OpenComputerUseLinux/main.go:604— apps/OpenComputerUseLinux/main.go:604-615 | apps/OpenComputerUseWindows/main.go:654-665 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:604` it begins part-way through the construct above it, so those 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 (12 lines × 2) apps/OpenComputerUseLinux/main.go:1138— apps/OpenComputerUseLinux/main.go:1138-1149 | apps/OpenComputerUseWindows/main.go:774-785 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (12 lines × 2) scripts/computer-use-cli/app_server.go:350— scripts/computer-use-cli/app_server.go:350-361 | scripts/computer-use-cli/main.go:475-486 — 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 `scripts/computer-use-cli/app_server.go:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) apps/OpenComputerUseLinux/main.go:59— apps/OpenComputerUseLinux/main.go:59-70 | apps/OpenComputerUseWindows/main.go:66-77 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (12 lines × 2) apps/OpenComputerUseFixture/Sources/OpenComputerUseFixture/main.swift:24— apps/OpenComputerUseFixture/Sources/OpenComputerUseFixture/main.swift:24-35 | apps/OpenComputerUseFixture/Sources/OpenComputerUseFixture/main.swift:63-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1215— apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1215-1221 | scripts/render-open-computer-use-icon.swift:117-123 — before extracting anything, compare `apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift` and `scripts/render-open-computer-use-icon.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1378— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1378-1384 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1129-1135 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:237— experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:237-243 | experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:252-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:237` it begins part-way through the construct above it, so those exact lines 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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SkyLightSPI.swift:40— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SkyLightSPI.swift:40-46 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SkyLightSPI.swift:57-63 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) apps/OpenComputerUseLinux/main.go:568— apps/OpenComputerUseLinux/main.go:568-574 | apps/OpenComputerUseWindows/main.go:618-624 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:568` 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) apps/OpenComputerUseLinux/main.go:1179— apps/OpenComputerUseLinux/main.go:1179-1185 | apps/OpenComputerUseWindows/main.go:815-821 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (7 lines × 2) apps/OpenComputerUseLinux/main.go:1187— apps/OpenComputerUseLinux/main.go:1187-1193 | apps/OpenComputerUseWindows/main.go:823-829 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (7 lines × 2) apps/OpenComputerUseLinux/main.go:1607— apps/OpenComputerUseLinux/main.go:1607-1613 | apps/OpenComputerUseWindows/main.go:1254-1260 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (7 lines × 2) apps/OpenComputerUseLinux/main.go:1830— apps/OpenComputerUseLinux/main.go:1830-1836 | apps/OpenComputerUseWindows/main.go:1477-1483 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (6 lines × 2) experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:590— experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:590-595 | experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:600-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:590` 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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:254— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:254-262 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorOverlay.swift:28-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swift:273— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swift:273-278 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swift:327-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `source` to `CGEventSource?` in one and `CGEventSource` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:196— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:196-201 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:120-125 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) experiments/LockedUse/Sources/Installer/InstallerMain.swift:30— experiments/LockedUse/Sources/Installer/InstallerMain.swift:30-35 | experiments/LockedUse/Sources/Installer/InstallerMain.swift:350-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (6 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swift:117— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swift:117-122 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swift:128-133 — both copies are in the same file, so extract the 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) apps/OpenComputerUseLinux/main.go:1102— apps/OpenComputerUseLinux/main.go:1102-1107 | apps/OpenComputerUseWindows/main.go:738-743 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (6 lines × 2) apps/OpenComputerUseLinux/main.go:1427— apps/OpenComputerUseLinux/main.go:1427-1432 | apps/OpenComputerUseWindows/main.go:1074-1079 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (15 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift:254— experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift:254-268 | experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift:459-473 — 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 `experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift:254` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:480— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:480-494 | experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:501-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:480` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1241— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1241-1255 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1046-1060 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:62— experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:62-76 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:284-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:392— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:392-406 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:413-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) scripts/computer-use-cli/main.go:152— scripts/computer-use-cli/main.go:152-166 | scripts/computer-use-cli/main.go:230-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/computer-use-cli/main.go:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (15 lines × 2) apps/OpenComputerUseLinux/main.go:1113— apps/OpenComputerUseLinux/main.go:1113-1127 | apps/OpenComputerUseWindows/main.go:749-763 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (10 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:911— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:911-920 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:942-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:911` 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) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1633— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1633-1642 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1397-1406 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) apps/OpenComputerUseLinux/main.go:280— apps/OpenComputerUseLinux/main.go:280-289 | apps/OpenComputerUseWindows/main.go:343-352 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:280` 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) scripts/computer-use-cli/main.go:172— scripts/computer-use-cli/main.go:172-181 | scripts/computer-use-cli/main.go:250-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) apps/OpenComputerUseLinux/main.go:293— apps/OpenComputerUseLinux/main.go:293-302 | apps/OpenComputerUseWindows/main.go:356-365 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (10 lines × 2) apps/OpenComputerUseLinux/main.go:331— apps/OpenComputerUseLinux/main.go:331-340 | apps/OpenComputerUseWindows/main.go:394-403 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:331` 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) apps/OpenComputerUseLinux/main.go:343— apps/OpenComputerUseLinux/main.go:343-352 | apps/OpenComputerUseWindows/main.go:403-412 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (5 lines × 2) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1187— apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1187-1191 | scripts/render-open-computer-use-icon.swift:89-93 — before extracting anything, compare `apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift` and `scripts/render-open-computer-use-icon.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1187` 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) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:109— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:109-113 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:44-48 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1387— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1387-1391 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1138-1142 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1387` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift:288— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift:288-292 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift:297-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift:288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:9— experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:9-13 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseStateMachine.swift:68-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:217— experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:217-221 | experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:236-240 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) apps/OpenComputerUseLinux/main.go:125— apps/OpenComputerUseLinux/main.go:125-129 | apps/OpenComputerUseWindows/main.go:135-139 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `apps/OpenComputerUseWindows/main.go:142` calls `sanitizeScreenshot` and `apps/OpenComputerUseLinux/main.go:132` 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 (21 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:86— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:86-106 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:21-41 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:328— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:328-348 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:244-264 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1219— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1219-1239 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1024-1044 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) apps/OpenComputerUseLinux/main.go:202— apps/OpenComputerUseLinux/main.go:202-222 | apps/OpenComputerUseWindows/main.go:265-285 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:202` 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 (21 lines × 2) apps/OpenComputerUseLinux/main.go:398— apps/OpenComputerUseLinux/main.go:398-418 | apps/OpenComputerUseWindows/main.go:458-478 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (21 lines × 2) apps/OpenComputerUseLinux/main.go:1697— apps/OpenComputerUseLinux/main.go:1697-1717 | apps/OpenComputerUseWindows/main.go:1344-1364 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (14 lines × 2) apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:254— apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:254-267 | apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:277-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1618— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1618-1631 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1382-1395 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:241— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:241-254 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:276-289 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:241` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:2066— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:2066-2079 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:2091-2104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:2066` 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 (14 lines × 2) apps/OpenComputerUseLinux/main.go:481— apps/OpenComputerUseLinux/main.go:481-494 | apps/OpenComputerUseWindows/main.go:548-561 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (14 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/FixtureBridge.swift:69— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/FixtureBridge.swift:69-82 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/FixtureBridge.swift:112-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/FixtureBridge.swift:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:20— experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:20-32 | experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorApp.swift:20-32 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorApp.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (13 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:567— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:567-579 | experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:729-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. 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) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:823— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:823-835 | experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:857-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:823` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:685— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:685-697 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:747-759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:685` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:479— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:479-491 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:643-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) apps/OpenComputerUseLinux/main.go:1754— apps/OpenComputerUseLinux/main.go:1754-1766 | apps/OpenComputerUseWindows/main.go:1401-1413 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (9 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:951— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:951-959 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:764-772 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:951` 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) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:229— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:229-237 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:240-248 — both copies are in the same file, so extract the 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 (9 lines × 2) apps/OpenComputerUseLinux/main.go:1597— apps/OpenComputerUseLinux/main.go:1597-1605 | apps/OpenComputerUseWindows/main.go:1244-1252 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) apps/OpenComputerUseLinux/main.go:452— apps/OpenComputerUseLinux/main.go:452-460 | apps/OpenComputerUseLinux/main.go:468-476 — both copies are in the same file, so extract the 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 (9 lines × 2) apps/OpenComputerUseLinux/main.go:534— apps/OpenComputerUseLinux/main.go:534-542 | apps/OpenComputerUseWindows/main.go:583-591 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (9 lines × 2) scripts/computer-use-cli/main.go:120— scripts/computer-use-cli/main.go:120-128 | scripts/computer-use-cli/main.go:140-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/computer-use-cli/main.go:120` 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) apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:246— apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:246-253 | apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:268-275 — both copies are in the same file, so extract the 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, `apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:276` calls `parseElementIndex` and `apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift:254` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:605— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:605-612 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:521-528 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:376— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:376-383 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:292-299 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:6— experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift:6-13 | experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorApp.swift:6-13 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionApp.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorApp.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) scripts/cursor-motion-re/official_cursor_motion.py:1660— scripts/cursor-motion-re/official_cursor_motion.py:1660-1667 | scripts/cursor-motion-re/official_cursor_motion.py:1680-1687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) apps/OpenComputerUseLinux/main.go:1263— apps/OpenComputerUseLinux/main.go:1263-1270 | apps/OpenComputerUseWindows/main.go:911-918 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
ClassTooLong: ComputerUseService packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:542— ClassTooLong — 1203 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 400 significant lines; this is 803 over it, 3.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HeadingDrivenCursorMotionModel experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:674— ClassTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 193 over it, 1.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SoftwareCursorOverlay packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorOverlay.swift:185— ClassTooLong — 482 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 82 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HeadingDrivenCursorMotionModel packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:590— ClassTooLong — 462 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 62 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DisplayGuardian experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:21— ClassTooLong — 441 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 41 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (18 lines × 2) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:139— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:139-156 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:167-184 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) scripts/cursor-motion-re/official_cursor_motion.py:1037— scripts/cursor-motion-re/official_cursor_motion.py:1037-1054 | scripts/cursor-motion-re/official_cursor_motion.py:1055-1072 — both copies are in the same file, so extract the 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 (18 lines × 2) apps/OpenComputerUseLinux/main.go:103— apps/OpenComputerUseLinux/main.go:103-120 | apps/OpenComputerUseWindows/main.go:111-128 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) apps/OpenComputerUseLinux/main.go:357— apps/OpenComputerUseLinux/main.go:357-374 | apps/OpenComputerUseWindows/main.go:417-434 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:357` 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 (18 lines × 2) apps/OpenComputerUseLinux/main.go:1160— apps/OpenComputerUseLinux/main.go:1160-1177 | apps/OpenComputerUseWindows/main.go:796-813 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) apps/OpenComputerUseLinux/main.go:310— apps/OpenComputerUseLinux/main.go:310-328 | apps/OpenComputerUseWindows/main.go:373-391 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:310` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) apps/OpenComputerUseLinux/main.go:423— apps/OpenComputerUseLinux/main.go:423-441 | apps/OpenComputerUseWindows/main.go:483-501 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (19 lines × 2) apps/OpenComputerUseLinux/main.go:543— apps/OpenComputerUseLinux/main.go:543-561 | apps/OpenComputerUseWindows/main.go:592-610 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `apps/OpenComputerUseWindows/main.go:611` calls `sanitizeScreenshot` and `apps/OpenComputerUseLinux/main.go:562` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) apps/OpenComputerUseLinux/main.go:1082— apps/OpenComputerUseLinux/main.go:1082-1100 | apps/OpenComputerUseWindows/main.go:718-736 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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.
Swallowed exception (empty catch) scripts/run-locked-use-native-validation.py:231— 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.
Swallowed exception (empty catch) scripts/run-locked-use-native-validation.py:255— 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.
Swallowed exception (empty catch) scripts/node-repl/open-computer-use-repl.mjs:601— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) apps/OpenComputerUseLinux/runtime.py:770— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated block (52 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:203— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:203-254 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:127-178 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (52 lines × 2) apps/OpenComputerUseLinux/main.go:1458— apps/OpenComputerUseLinux/main.go:1458-1509 | apps/OpenComputerUseWindows/main.go:1105-1156 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:1458` 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 (52 lines × 2) apps/OpenComputerUseLinux/main.go:1543— apps/OpenComputerUseLinux/main.go:1543-1594 | apps/OpenComputerUseWindows/main.go:1190-1241 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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.
service.callTool (cyclomatic 24) apps/OpenComputerUseLinux/main.go:201— service.callTool 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.
service.callTool (cyclomatic 24) apps/OpenComputerUseWindows/main.go:264— service.callTool 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.
main.runCallCommand (cyclomatic 23) apps/OpenComputerUseLinux/main.go:1615— main.runCallCommand 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.
main.runCallCommand (cyclomatic 23) apps/OpenComputerUseWindows/main.go:1262— main.runCallCommand 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.
main.runCLI (cyclomatic 22) apps/OpenComputerUseLinux/main.go:1434— main.runCLI 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.
main.runCLI (cyclomatic 22) apps/OpenComputerUseWindows/main.go:1081— main.runCLI 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.
main.runCallCommand (cognitive 36) apps/OpenComputerUseLinux/main.go:1615— main.runCallCommand has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 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.
main.runCallCommand (cognitive 36) apps/OpenComputerUseWindows/main.go:1262— main.runCallCommand has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 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.
main.parseSnapshotArgs (cognitive 28) apps/OpenComputerUseLinux/main.go:1542— main.parseSnapshotArgs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.parseSnapshotArgs (cognitive 28) apps/OpenComputerUseWindows/main.go:1189— main.parseSnapshotArgs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.runCLI (cognitive 27) apps/OpenComputerUseLinux/main.go:1434— main.runCLI has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.runCLI (cognitive 27) apps/OpenComputerUseWindows/main.go:1081— main.runCLI has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
service.callTool (cognitive 24) apps/OpenComputerUseLinux/main.go:201— service.callTool has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1, 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.
service.callTool (cognitive 24) apps/OpenComputerUseWindows/main.go:264— service.callTool has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1, 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.
CursorMotionPath.measure (cognitive 17) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:203— CursorMotionPath.measure has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (7 pts), boolean chains 1 (nesting depth added 10). 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.
CursorMotionPath.measure (cognitive 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:127— CursorMotionPath.measure has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (7 pts), boolean chains 1 (nesting depth added 10). 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.
service.click (cognitive 16) apps/OpenComputerUseLinux/main.go:330— service.click has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (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.
service.click (cognitive 16) apps/OpenComputerUseWindows/main.go:393— service.click has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 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.
FunctionTooLong: OpenComputerUseCLI.swift.openComputerUseHelpText packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:105— FunctionTooLong — openComputerUseHelpText runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: open-computer-use-repl.createCuaApi scripts/node-repl/open-computer-use-repl.mjs:288— FunctionTooLong — createCuaApi 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.
Duplicated block (29 lines × 2) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1623— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1623-1651 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:2001-2029 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (29 lines × 2) apps/OpenComputerUseLinux/main.go:1512— apps/OpenComputerUseLinux/main.go:1512-1540 | apps/OpenComputerUseWindows/main.go:1159-1187 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (25 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:350— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:350-374 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:266-290 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:960— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:960-984 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:773-797 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:960` 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, `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:985` calls `max` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:798` 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 (23 lines × 2) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1192— apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1192-1214 | scripts/render-open-computer-use-icon.swift:94-116 — before extracting anything, compare `apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift` and `scripts/render-open-computer-use-icon.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift:1192` 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 (23 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:581— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:581-603 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:497-519 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:392— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:392-413 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:304-325 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:392` 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 (22 lines × 2) apps/OpenComputerUseLinux/main.go:1435— apps/OpenComputerUseLinux/main.go:1435-1456 | apps/OpenComputerUseWindows/main.go:1082-1103 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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 `apps/OpenComputerUseLinux/main.go:1435` 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 (15 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:517— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:517-531 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:506-520 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:429-443 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:517` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:550— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:550-564 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:538-552 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:462-476 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:550` 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 (10 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:468— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:468-477 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:451-460 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:380-389 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:633— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:633-642 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:792-801 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:549-558 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) apps/OpenComputerUseLinux/main.go:1769— apps/OpenComputerUseLinux/main.go:1769-1788 | apps/OpenComputerUseWindows/main.go:1416-1435 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (20 lines × 2) apps/OpenComputerUseLinux/main.go:34— apps/OpenComputerUseLinux/main.go:34-53 | apps/OpenComputerUseWindows/main.go:41-60 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Off the main sequence: StandaloneCursorSupport — StandaloneCursorSupport: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: OpenComputerUseKit — OpenComputerUseKit: abstractness 0.01, instability 0.29, distance 0.71 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Low cohesion: SkyLightSPI (LCOM4 6) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SkyLightSPI.swift:105— SkyLightSPI's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MCPAppRuntime (LCOM4 4) apps/OpenComputerUse/Sources/OpenComputerUse/MCPAppRuntime.swift:5— MCPAppRuntime's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Sync-over-async blocking scripts/node-repl/open-computer-use-cli.mjs:330— `readFileSync` in `runJavaScript` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/node-repl/open-computer-use-cli.mjs:523— `existsSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
LockedUseBrokerCoordinator.handle (cyclomatic 178) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseBrokerCoordinator.swift:98— LockedUseBrokerCoordinator.handle has cyclomatic complexity 178 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LockScreenInteractor.probe (cyclomatic 99) experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:57— LockScreenInteractor.probe has cyclomatic complexity 99 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (LockScreenInteractor.probe::visit) 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.
BrokerServer.read (cyclomatic 55) experiments/LockedUse/Sources/Broker/BrokerMain.swift:253— BrokerServer.read has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppAgentConnection.handle (cyclomatic 49) apps/OpenComputerUse/Sources/OpenComputerUse/MacOSAppAgentProxy.swift:353— AppAgentConnection.handle 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.
GuardianMain.swift.runWatchdog (cyclomatic 49) experiments/LockedUse/Sources/Guardian/GuardianMain.swift:237— GuardianMain.swift.runWatchdog has cyclomatic complexity 49 (threshold 15). Of this number, 48 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.
GuardianMain.main (cyclomatic 42) experiments/LockedUse/Sources/Guardian/GuardianMain.swift:21— GuardianMain.main 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.
open-computer-use-repl.createCuaApi::appBinding (cyclomatic 41) scripts/node-repl/open-computer-use-repl.mjs:308— open-computer-use-repl.createCuaApi::appBinding has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DisplayGuardian.poll (cyclomatic 40) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:332— DisplayGuardian.poll 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.
ImageCaptureConfig.resolve (cyclomatic 39) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ImageCaptureConfig.swift:60— ImageCaptureConfig.resolve has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 10 of the 39 points are its own statements and the rest belongs to 4 function items inside it that branch (number::valid, disabled, number, …). 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.
TreeRenderer.render (cyclomatic 37) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:845— TreeRenderer.render 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.
LockedUseUnshieldedDiagnostic.handle (cyclomatic 34) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseUnshieldedDiagnostic.swift:34— LockedUseUnshieldedDiagnostic.handle has cyclomatic complexity 34 (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.
run-locked-use-native-validation.main (cyclomatic 34) scripts/run-locked-use-native-validation.py:95— run-locked-use-native-validation.main has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LockedUseRecoveryRecord.validated (cyclomatic 33) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseRecoveryRecord.swift:30— LockedUseRecoveryRecord.validated has cyclomatic complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 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.
runtime.perform_operation (cyclomatic 32) apps/OpenComputerUseLinux/runtime.py:804— runtime.perform_operation 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.
open-computer-use-cli.main (cyclomatic 30) scripts/node-repl/open-computer-use-cli.mjs:448— open-computer-use-cli.main 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.
LockedUseSecureStore.read (cyclomatic 29) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseSecureStore.swift:8— LockedUseSecureStore.read 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.
UnshieldedUnlockDiagnostic.swift.runUnshieldedUnlockDiagnostic (cyclomatic 27) experiments/LockedUse/Sources/Guardian/UnshieldedUnlockDiagnostic.swift:7— UnshieldedUnlockDiagnostic.swift.runUnshieldedUnlockDiagnostic has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs 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.
ComputerUseService.click (cyclomatic 26) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:625— ComputerUseService.click 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.
BrokerServer.start (cyclomatic 25) experiments/LockedUse/Sources/Broker/BrokerMain.swift:89— BrokerServer.start 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.
InstallerMain.reconcileStoppedGuards (cyclomatic 25) experiments/LockedUse/Sources/Installer/InstallerMain.swift:287— InstallerMain.reconcileStoppedGuards 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, 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.
OpenComputerUseCLI.swift.parseCall (cyclomatic 25) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:393— OpenComputerUseCLI.swift.parseCall 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.
CodexDump._summarize_local_session (cyclomatic 25) scripts/codex_dump.py:449— CodexDump._summarize_local_session 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.
LockScreenPresentation.presentation (cyclomatic 24) experiments/LockedUse/Sources/Guardian/LockScreenPresentation.swift:30— LockScreenPresentation.presentation 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.
LockedUseStateMachine.observe (cyclomatic 24) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseStateMachine.swift:175— LockedUseStateMachine.observe 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.
ocu-config.validateSetting (cyclomatic 24) scripts/node-repl/ocu-config.mjs:25— ocu-config.validateSetting 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.
OpenComputerUseMain.run (cyclomatic 23) apps/OpenComputerUse/Sources/OpenComputerUse/OpenComputerUseMain.swift:25— OpenComputerUseMain.run 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.
OpenComputerUseCLI.swift.parseSnapshot (cyclomatic 23) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:297— OpenComputerUseCLI.swift.parseSnapshot 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.
LockedUseConnection.acquire (cyclomatic 22) apps/OpenComputerUse/Sources/OpenComputerUse/LockedUseConnection.swift:57— LockedUseConnection.acquire 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.
LockedUseClickAllowance.accept (cyclomatic 22) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseClickAllowance.swift:21— LockedUseClickAllowance.accept has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
locked_use_report.curate (cyclomatic 22) scripts/locked_use_report.py:90— locked_use_report.curate 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.
run-locked-use-rehearsal.main (cyclomatic 22) scripts/run-locked-use-rehearsal.py:36— run-locked-use-rehearsal.main 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.
run-locked-use-unshielded-diagnostic.main (cyclomatic 22) scripts/run-locked-use-unshielded-diagnostic.py:22— run-locked-use-unshielded-diagnostic.main 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.
install-config-helper.probeStdioMcp (cyclomatic 22) scripts/install-config-helper.mjs:613— install-config-helper.probeStdioMcp has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (verify, a function literal at line 638, a function literal at line 662, …). 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.
InstallerMain.main (cyclomatic 21) experiments/LockedUse/Sources/Installer/InstallerMain.swift:19— InstallerMain.main 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.
ComputerUseService.performAXClickSequence (cyclomatic 21) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:1394— ComputerUseService.performAXClickSequence 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.
LockedUsePrivateRecord.write (cyclomatic 21) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUsePrivateRecord.swift:15— LockedUsePrivateRecord.write 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.
ocu-config.configCommand (cyclomatic 21) scripts/node-repl/ocu-config.mjs:85— ocu-config.configCommand 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.
PermissionSettingsWindowReader.context (cyclomatic 20) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionSettingsAnchor.swift:161— PermissionSettingsWindowReader.context 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.
DisplayShieldSurface.coverageFailure (cyclomatic 20) experiments/LockedUse/Sources/Guardian/DisplayShieldSurface.swift:92— DisplayShieldSurface.coverageFailure 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.
SnapshotBuilder.targetedSearch (cyclomatic 20) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:2446— SnapshotBuilder.targetedSearch 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.
LockedUseBrokerCoordinator.reply (cyclomatic 20) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseBrokerCoordinator.swift:395— LockedUseBrokerCoordinator.reply 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.
LockedUseIPCClient.request (cyclomatic 20) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseIPCSocket.swift:53— LockedUseIPCClient.request 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.
AccessibilitySnapshot.swift.preferredDisplayTitle (cyclomatic 20) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1392— AccessibilitySnapshot.swift.preferredDisplayTitle has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ComputerUseService.swift.isLikelySyntheticSideActionCandidate (cyclomatic 20) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:383— ComputerUseService.swift.isLikelySyntheticSideActionCandidate has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
install-config-helper.installOpencodeMcp (cyclomatic 20) scripts/install-config-helper.mjs:297— install-config-helper.installOpencodeMcp 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.
DisplayGuardian.reportToBroker (cyclomatic 19) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:495— DisplayGuardian.reportToBroker 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.
InstallerMain.install (cyclomatic 19) experiments/LockedUse/Sources/Installer/InstallerMain.swift:195— InstallerMain.install 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.
LockedUseGuardianPolicy.poll (cyclomatic 19) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseGuardianPolicy.swift:76— LockedUseGuardianPolicy.poll 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.
LockedUsePeerIdentity.verified (cyclomatic 19) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUsePeerIdentity.swift:57— LockedUsePeerIdentity.verified 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.
install-config-helper.main (cyclomatic 19) scripts/install-config-helper.mjs:763— install-config-helper.main 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.
open-computer-use-cli.runInteractiveRepl (cyclomatic 19) scripts/node-repl/open-computer-use-cli.mjs:347— open-computer-use-cli.runInteractiveRepl 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.
LockScreenInteractor.wake (cyclomatic 18) experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:15— LockScreenInteractor.wake 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.
LockScreenInteractor.probe::visit (cyclomatic 18) experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:84— LockScreenInteractor.probe::visit 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. This shape REPEATS in the file: one other method here (LockScreenInteractor.probe) 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.
LockedUseDiagnostics.current (cyclomatic 18) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift:94— LockedUseDiagnostics.current 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.
LockedUseReturnAllowance.accept (cyclomatic 18) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseReturnAllowance.swift:19— LockedUseReturnAllowance.accept 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.
open-computer-use-repl.runServer (cyclomatic 18) scripts/node-repl/open-computer-use-repl.mjs:644— open-computer-use-repl.runServer has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (handle, a function literal at line 653, shutdown). 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.
DisplayGuardian.verifyCaptureFixture (cyclomatic 17) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:190— DisplayGuardian.verifyCaptureFixture 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.
ComputerUseService.selectText (cyclomatic 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:1026— ComputerUseService.selectText 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.
AccessibilitySnapshot.swift.encodeScreenshot (cyclomatic 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:710— AccessibilitySnapshot.swift.encodeScreenshot has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, 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.
AccessibilitySnapshot.swift.shouldElideNode (cyclomatic 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1653— AccessibilitySnapshot.swift.shouldElideNode 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.
locked_use_report.authentication_windows (cyclomatic 17) scripts/locked_use_report.py:127— locked_use_report.authentication_windows 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.
service.click (cyclomatic 17) apps/OpenComputerUseWindows/main.go:393— service.click 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.
main.runCall (cyclomatic 17) scripts/computer-use-cli/main.go:193— main.runCall 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.
PermissionListAnchorSearch.first (cyclomatic 16) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionSettingsAnchor.swift:13— PermissionListAnchorSearch.first 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.
DisplayGuardian.start (cyclomatic 16) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:85— DisplayGuardian.start 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.
DisplayGuardian.installTap (cyclomatic 16) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:249— DisplayGuardian.installTap 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.
CodexDump._sync_local_sessions (cyclomatic 16) scripts/codex_dump.py:411— CodexDump._sync_local_sessions 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.
LiveAuthenticationTrace._read (cyclomatic 16) scripts/locked_use_report.py:185— LiveAuthenticationTrace._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.
service.click (cyclomatic 16) apps/OpenComputerUseLinux/main.go:330— service.click 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.
open-computer-use-cli.parseJavaScriptArgs (cyclomatic 16) scripts/node-repl/open-computer-use-cli.mjs:206— open-computer-use-cli.parseJavaScriptArgs 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.
LockedUseBrokerCoordinator.handle (cognitive 216) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseBrokerCoordinator.swift:98— LockedUseBrokerCoordinator.handle has cognitive complexity 216 (threshold 15). Drivers by points: if/else 53 (108 pts), boolean chains 104, ternaries 1 (3 pts), match/switch 1 (nesting depth added 57). 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.
LockScreenInteractor.probe (cognitive 116) experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:57— LockScreenInteractor.probe has cognitive complexity 116 (threshold 15). Drivers by points: boolean chains 75, if/else 37 (54 pts), loops 3 (7 pts), ternaries 6, error handling 1 (2 pts) (nesting depth added 22). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (LockScreenInteractor.probe::visit) 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.
BrokerServer.read (cognitive 112) experiments/LockedUse/Sources/Broker/BrokerMain.swift:253— BrokerServer.read has cognitive complexity 112 (threshold 15). Drivers by points: if/else 28 (78 pts), boolean chains 21, error handling 4 (11 pts), loops 1 (2 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppAgentConnection.handle (cognitive 102) apps/OpenComputerUse/Sources/OpenComputerUse/MacOSAppAgentProxy.swift:353— AppAgentConnection.handle has cognitive complexity 102 (threshold 15). Drivers by points: if/else 22 (79 pts), boolean chains 13, match/switch 3 (9 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.
GuardianMain.main (cognitive 63) experiments/LockedUse/Sources/Guardian/GuardianMain.swift:21— GuardianMain.main has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (49 pts), error handling 4 (10 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuardianMain.swift.runWatchdog (cognitive 63) experiments/LockedUse/Sources/Guardian/GuardianMain.swift:237— GuardianMain.swift.runWatchdog has cognitive complexity 63 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 25, ternaries 2, loops 1 (nesting depth added 14). Of this number, 62 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.
DisplayGuardian.poll (cognitive 59) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:332— DisplayGuardian.poll has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 18, ternaries 1 (2 pts), error handling 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.
ImageCaptureConfig.resolve (cognitive 57) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ImageCaptureConfig.swift:60— ImageCaptureConfig.resolve has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 16, ternaries 2 (6 pts) (nesting depth added 12). Of this number, 17 points are the body's own statements and 40 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.
locked_use_report.curate (cognitive 51) scripts/locked_use_report.py:90— locked_use_report.curate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (31 pts), ternaries 3 (12 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-locked-use-native-validation.main (cognitive 51) scripts/run-locked-use-native-validation.py:95— run-locked-use-native-validation.main has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (28 pts), error handling 5 (10 pts), ternaries 4 (7 pts), boolean chains 6 (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.
ComputerUseService.click (cognitive 50) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:625— ComputerUseService.click has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 2 (6 pts), error handling 2 (4 pts), loops 1 (4 pts), boolean chains 3 (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.
CodexDump._summarize_local_session (cognitive 49) scripts/codex_dump.py:449— CodexDump._summarize_local_session has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 3 (6 pts), boolean chains 5, ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComputerUseService.performAXClickSequence (cognitive 45) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:1394— ComputerUseService.performAXClickSequence has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (10 pts), boolean chains 6 (nesting depth added 25). 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.
open-computer-use-repl.createCuaApi::appBinding (cognitive 44) scripts/node-repl/open-computer-use-repl.mjs:308— open-computer-use-repl.createCuaApi::appBinding has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 13, ternaries 4 (6 pts), loops 5 (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.
TreeRenderer.render (cognitive 41) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:845— TreeRenderer.render has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13, ternaries 11 (12 pts), boolean chains 9, loops 4 (7 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
runtime.perform_operation (cognitive 41) apps/OpenComputerUseLinux/runtime.py:804— runtime.perform_operation has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 5, loops 1 (2 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.
open-computer-use-cli.runInteractiveRepl (cognitive 40) scripts/node-repl/open-computer-use-cli.mjs:347— open-computer-use-cli.runInteractiveRepl has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 1, error handling 1, loops 1, ternaries 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.
LockedUseUnshieldedDiagnostic.handle (cognitive 39) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseUnshieldedDiagnostic.swift:34— LockedUseUnshieldedDiagnostic.handle has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 20, if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BrokerServer.start (cognitive 38) experiments/LockedUse/Sources/Broker/BrokerMain.swift:89— BrokerServer.start has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 10, error handling 3 (6 pts), loops 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.
LockedUseIPCClient.request (cognitive 38) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseIPCSocket.swift:53— LockedUseIPCClient.request has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 8, ternaries 1 (4 pts), loops 1 (2 pts), error handling 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.
LiveAuthenticationTrace._read (cognitive 37) scripts/locked_use_report.py:185— LiveAuthenticationTrace._read has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (24 pts), error handling 2 (6 pts), loops 2 (3 pts), ternaries 1 (3 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.
run-locked-use-unshielded-diagnostic.main (cognitive 37) scripts/run-locked-use-unshielded-diagnostic.py:22— run-locked-use-unshielded-diagnostic.main has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 3 (6 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockedUseSecureStore.read (cognitive 35) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseSecureStore.swift:8— LockedUseSecureStore.read has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 16, 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.
OpenComputerUseCLI.swift.parseSnapshot (cognitive 35) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:297— OpenComputerUseCLI.swift.parseSnapshot has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
open-computer-use-cli.main (cognitive 34) scripts/node-repl/open-computer-use-cli.mjs:448— open-computer-use-cli.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 9, error handling 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, 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.
LockedUseRecoveryRecord.validated (cognitive 32) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseRecoveryRecord.swift:30— LockedUseRecoveryRecord.validated has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 31, if/else 1. Of this number, 27 points are the body's own statements and 5 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.
locked_use_report.authentication_windows (cognitive 32) scripts/locked_use_report.py:127— locked_use_report.authentication_windows has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 5, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnshieldedUnlockDiagnostic.swift.runUnshieldedUnlockDiagnostic (cognitive 30) experiments/LockedUse/Sources/Guardian/UnshieldedUnlockDiagnostic.swift:7— UnshieldedUnlockDiagnostic.swift.runUnshieldedUnlockDiagnostic has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 10 (14 pts), loops 2 (nesting depth added 4). Of this number, 29 points are the body's own statements and 1 belongs 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.
InstallerMain.reconcileStoppedGuards (cognitive 30) experiments/LockedUse/Sources/Installer/InstallerMain.swift:287— InstallerMain.reconcileStoppedGuards has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 8 (14 pts), error handling 1 (nesting depth added 6). 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, 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.
install-config-helper.installOpencodeMcp (cognitive 30) scripts/install-config-helper.mjs:297— install-config-helper.installOpencodeMcp has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, loops 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.
LockedUseStateMachine.observe (cognitive 29) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseStateMachine.swift:175— LockedUseStateMachine.observe has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 11, 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.
TargetedQuery.swift.boundedTargetedWalk (cognitive 29) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/TargetedQuery.swift:79— TargetedQuery.swift.boundedTargetedWalk has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockedUseConnection.acquire (cognitive 28) apps/OpenComputerUse/Sources/OpenComputerUse/LockedUseConnection.swift:57— LockedUseConnection.acquire has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 11, loops 1 (2 pts), error handling 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.
DisplayGuardian.start (cognitive 28) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:85— DisplayGuardian.start has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, ternaries 2 (5 pts), error handling 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.
InstallerMain.main (cognitive 28) experiments/LockedUse/Sources/Installer/InstallerMain.swift:19— InstallerMain.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 9, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayGuardian.reportToBroker (cognitive 27) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:495— DisplayGuardian.reportToBroker has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts), ternaries 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayShieldSurface.coverageFailure (cognitive 27) experiments/LockedUse/Sources/Guardian/DisplayShieldSurface.swift:92— DisplayShieldSurface.coverageFailure has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, 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.
OpenComputerUseCLI.swift.parseCall (cognitive 27) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:393— OpenComputerUseCLI.swift.parseCall has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-locked-use-rehearsal.main (cognitive 27) scripts/run-locked-use-rehearsal.py:36— run-locked-use-rehearsal.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 4 (8 pts), boolean chains 4, ternaries 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DisplayGuardian.execute (cognitive 26) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:426— DisplayGuardian.execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockScreenInteractor.wake (cognitive 26) experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:15— LockScreenInteractor.wake has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockScreenPresentation.presentation (cognitive 26) experiments/LockedUse/Sources/Guardian/LockScreenPresentation.swift:30— LockScreenPresentation.presentation has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, if/else 8 (11 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.
official_cursor_motion.extract_motion_type_fields (cognitive 26) scripts/cursor-motion-re/official_cursor_motion.py:111— official_cursor_motion.extract_motion_type_fields has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (6 pts), boolean chains 2, error handling 1 (2 pts), ternaries 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.
ocu-config.configCommand (cognitive 26) scripts/node-repl/ocu-config.mjs:85— ocu-config.configCommand has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 9, 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.
install-config-helper.probeStdioMcp (cognitive 25) scripts/install-config-helper.mjs:613— install-config-helper.probeStdioMcp has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), error handling 2 (3 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 7 function items inside it that branch (verify, a function literal at line 638, a function literal at line 662, …). 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.
ocu-config.validateSetting (cognitive 25) scripts/node-repl/ocu-config.mjs:25— ocu-config.validateSetting has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, ternaries 3 (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.
PermissionListAnchorSearch.first (cognitive 24) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionSettingsAnchor.swift:13— PermissionListAnchorSearch.first has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, loops 3 (5 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InstallerMain.install (cognitive 24) experiments/LockedUse/Sources/Installer/InstallerMain.swift:195— InstallerMain.install has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, ternaries 2 (4 pts), error handling 1, 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.
LockedUseGuardianPolicy.poll (cognitive 24) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseGuardianPolicy.swift:76— LockedUseGuardianPolicy.poll has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7 (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.
SkyClickDispatcher.click (cognitive 24) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SkyClickSimulation.swift:109— SkyClickDispatcher.click has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (6 pts), loops 1 (2 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.
appServerSession.request (cognitive 24) scripts/computer-use-cli/app_server.go:324— appServerSession.request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rpcSession.request (cognitive 24) scripts/computer-use-cli/main.go:446— rpcSession.request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockScreenInteractor.probe::visit (cognitive 23) experiments/LockedUse/Sources/Guardian/LockScreenInteractor.swift:84— LockScreenInteractor.probe::visit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, loops 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. This shape REPEATS in the file: one other method here (LockScreenInteractor.probe) 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.
SnapshotBuilder.targetedSearch (cognitive 23) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:2446— SnapshotBuilder.targetedSearch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, ternaries 2, 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.
PermissionSettingsWindowReader.context (cognitive 22) apps/OpenComputerUse/Sources/OpenComputerUse/PermissionSettingsAnchor.swift:161— PermissionSettingsWindowReader.context has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10 (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.
LockedUseClickAllowance.accept (cognitive 22) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseClickAllowance.swift:21— LockedUseClickAllowance.accept has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (9 pts), match/switch 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.
LockedUsePrivateRecord.write (cognitive 22) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUsePrivateRecord.swift:15— LockedUsePrivateRecord.write has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (10 pts), loops 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.
CodexDump._sync_local_sessions (cognitive 22) scripts/codex_dump.py:411— CodexDump._sync_local_sessions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenComputerUseMain.run (cognitive 21) apps/OpenComputerUse/Sources/OpenComputerUse/OpenComputerUseMain.swift:25— OpenComputerUseMain.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayGuardian.verifyCaptureFixture (cognitive 21) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:190— DisplayGuardian.verifyCaptureFixture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8, error handling 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.
LockedUseBrokerCoordinator.reply (cognitive 21) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseBrokerCoordinator.swift:395— LockedUseBrokerCoordinator.reply has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 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.
ComputerUseService.swift.isLikelySyntheticSideActionCandidate (cognitive 21) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:383— ComputerUseService.swift.isLikelySyntheticSideActionCandidate has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (9 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.
CodexDump._session_matches_capture (cognitive 21) scripts/codex_dump.py:550— CodexDump._session_matches_capture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (5 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
official_cursor_motion.scan_bundle_for_slider_labels (cognitive 21) scripts/cursor-motion-re/official_cursor_motion.py:1185— official_cursor_motion.scan_bundle_for_slider_labels has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (5 pts), error handling 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.
open-computer-use-cli.parseJavaScriptArgs (cognitive 21) scripts/node-repl/open-computer-use-cli.mjs:206— open-computer-use-cli.parseJavaScriptArgs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, 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.
AppAgentConnection.runCLI (cognitive 20) apps/OpenComputerUse/Sources/OpenComputerUse/MacOSAppAgentProxy.swift:494— AppAgentConnection.runCLI has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (7 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskVerifier.swift.verifyBrokerTask (cognitive 20) experiments/LockedUse/AuthorizationPlugin/TaskVerifier.swift:8— TaskVerifier.swift.verifyBrokerTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchdogShield.init (cognitive 20) experiments/LockedUse/Sources/Guardian/WatchdogShield.swift:22— WatchdogShield.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComputerUseService.selectText (cognitive 20) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:1026— ComputerUseService.selectText has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
main.runCall (cognitive 20) scripts/computer-use-cli/main.go:193— main.runCall has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, 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.
publish-packages.publishWithRetry (cognitive 20) scripts/npm/publish-packages.mjs:161— publish-packages.publishWithRetry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrokerServer.flush (cognitive 19) experiments/LockedUse/Sources/Broker/BrokerMain.swift:452— BrokerServer.flush has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchdogBrokerLink.report (cognitive 19) experiments/LockedUse/Sources/Guardian/WatchdogBrokerLink.swift:37— WatchdogBrokerLink.report has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpotlightAppIndex.recentApps (cognitive 19) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AppDiscovery.swift:455— SpotlightAppIndex.recentApps has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, 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.
LockedUseIPCFrame.append (cognitive 19) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseIPC.swift:86— LockedUseIPCFrame.append has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilitySnapshot.swift.preferredDisplayTitle (cognitive 19) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1392— AccessibilitySnapshot.swift.preferredDisplayTitle has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AccessibilitySnapshot.swift.isPlainGenericTextContainer (cognitive 19) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1873— AccessibilitySnapshot.swift.isPlainGenericTextContainer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.find_element (cognitive 19) apps/OpenComputerUseLinux/runtime.py:542— runtime.find_element has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, 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.
RPC.call (cognitive 19) scripts/run-locked-use-native-validation.py:42— RPC.call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 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.
main.discoverPluginRoot (cognitive 19) scripts/computer-use-cli/main.go:655— main.discoverPluginRoot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 1 belongs to one function literal 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.
install-config-helper.main (cognitive 19) scripts/install-config-helper.mjs:763— install-config-helper.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
InstallerMain.trustedTree (cognitive 18) experiments/LockedUse/Sources/Installer/InstallerMain.swift:74— InstallerMain.trustedTree has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, 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.
InstallerMain.removeOwnArtifacts (cognitive 18) experiments/LockedUse/Sources/Installer/InstallerMain.swift:393— InstallerMain.removeOwnArtifacts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockedUsePeerIdentity.verified (cognitive 18) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUsePeerIdentity.swift:57— LockedUsePeerIdentity.verified has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 8. 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.
LockedUseReturnAllowance.accept (cognitive 18) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseReturnAllowance.swift:19— LockedUseReturnAllowance.accept has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8 (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.
PermissionSupport.preferredInstalledAppBundleURL (cognitive 18) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift:242— PermissionSupport.preferredInstalledAppBundleURL has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 5 (7 pts) (nesting depth added 7). Of this number, 15 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.
CursorMotionPath.measure (cognitive 18) scripts/cursor-motion-re/official_cursor_motion.py:583— CursorMotionPath.measure has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (8 pts), boolean chains 1 (nesting depth added 10). 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.
SnapshotBuilder.buildAccessibilitySnapshot (cognitive 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:264— SnapshotBuilder.buildAccessibilitySnapshot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LockedUseDiagnostics.current (cognitive 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift:94— LockedUseDiagnostics.current has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, ternaries 3, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LockedUseIPCSocket.connect (cognitive 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseIPCSocket.swift:118— LockedUseIPCSocket.connect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (4 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AccessibilitySnapshot.swift.summaryImageDescendants (cognitive 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1814— AccessibilitySnapshot.swift.summaryImageDescendants has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenComputerUseCLI.swift.parseTurnEnded (cognitive 17) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:260— OpenComputerUseCLI.swift.parseTurnEnded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.sessionBusAddress (cognitive 17) apps/OpenComputerUseLinux/main.go:708— main.sessionBusAddress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
open-computer-use-repl.normalizeImage (cognitive 17) scripts/node-repl/open-computer-use-repl.mjs:78— open-computer-use-repl.normalizeImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 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.
open-computer-use-repl.runServer::handle (cognitive 17) scripts/node-repl/open-computer-use-repl.mjs:663— open-computer-use-repl.runServer::handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 1 (3 pts), error handling 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrokerServer.accept (cognitive 16) experiments/LockedUse/Sources/Broker/BrokerMain.swift:171— BrokerServer.accept has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayGuardian.installTap (cognitive 16) experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:249— DisplayGuardian.installTap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 2 (3 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.
GuardReleaseAcknowledgement.send (cognitive 16) experiments/LockedUse/Sources/Guardian/GuardReleaseAcknowledgement.swift:9— GuardReleaseAcknowledgement.send has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 2 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowCapture.resolve (cognitive 16) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:538— WindowCapture.resolve has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 2 (4 pts), if/else 2 (3 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.
AppDiscovery.bestResolutionIndex (cognitive 16) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AppDiscovery.swift:211— AppDiscovery.bestResolutionIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 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.
LockedUseSession.from (cognitive 16) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift:29— LockedUseSession.from has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), ternaries 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.
LockedUseDiagnostics.installedGuardianPermissions (cognitive 16) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseDiagnostics.swift:136— LockedUseDiagnostics.installedGuardianPermissions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 6, loops 1 (2 pts), error handling 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.
AccessibilitySnapshot.swift.shouldElideNode (cognitive 16) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/AccessibilitySnapshot.swift:1653— AccessibilitySnapshot.swift.shouldElideNode has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 5. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
official_cursor_motion.build_timed_cursor_timeline (cognitive 16) scripts/cursor-motion-re/official_cursor_motion.py:818— official_cursor_motion.build_timed_cursor_timeline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, ternaries 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.
JsonLinePeer.#onData (cognitive 16) scripts/node-repl/open-computer-use-repl.mjs:136— JsonLinePeer.#onData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (2 pts), boolean chains 1, 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.
TooManyMethods: ComputerUseService packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:542— TooManyMethods — 89 methods. The bar is 30 methods; this is 59 over it, 2.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Near-duplicate member family (3 members, 68 shared lines) · ×1
Near-duplicate member family (3 members, 68 shared lines) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:437— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:437-564 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:420-552 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:349-476 — These 3 members are variants of one another: a block of 68 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 25 shared lines) · ×1
Near-duplicate member family (3 members, 25 shared lines) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:196— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:196-227 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:239-270 | scripts/render-synthesized-software-cursor.swift:266-321 — These 3 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 5 shared lines) · ×1
Near-duplicate member family (3 members, 5 shared lines) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1860— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1860-1870 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:855-871 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1426-1436 — These 3 members are variants of one another: a block of 5 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (85 shared lines) apps/OpenComputerUseLinux/main.go:201— apps/OpenComputerUseLinux/main.go:201-289 | apps/OpenComputerUseWindows/main.go:264-352 — These two members are variants of one another: 85 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:108— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:108-137 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:43-72 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) apps/OpenComputerUseLinux/main.go:376— apps/OpenComputerUseLinux/main.go:376-395 | apps/OpenComputerUseLinux/main.go:397-420 | apps/OpenComputerUseLinux/main.go:480-496 | apps/OpenComputerUseWindows/main.go:436-455 | apps/OpenComputerUseWindows/main.go:457-480 | apps/OpenComputerUseWindows/main.go:547-563 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:566— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:566-579 | experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:728-741 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:478-491 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:642-655 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (208 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1010— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1010-1217 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:815-1022 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (36–37 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:158— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:158-194 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:111-146 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:82-118 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (36 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1581— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1581-1616 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1345-1380 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1581` it begins part-way through the construct above it, so those 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 (30 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:920— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:920-949 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:733-762 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25–29 lines × 3) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:203— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:203-227 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:246-270 | scripts/render-synthesized-software-cursor.swift:293-321 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:203` 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 (28 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:438— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:438-465 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:421-448 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:350-377 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26–27 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:516— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:516-541 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:428-454 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:516` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (23–25 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1548— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1548-1570 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1305-1329 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1548` 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 (24 lines × 2) experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:463— experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:463-486 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:487-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–21 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1843— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1843-1858 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:833-853 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1409-1424 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 3) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:116— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:116-136 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:144-164 | scripts/render-synthesized-software-cursor.swift:180-200 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:116` 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 (20 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:644— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:644-663 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:803-822 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:560-579 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:614— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:614-631 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:773-790 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:530-547 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:116— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:116-132 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:51-68 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 3) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:139— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:139-154 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:167-182 | scripts/render-synthesized-software-cursor.swift:203-218 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15–16 lines × 3) packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:277— packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:277-292 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:341-355 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:420-435 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseCLI.swift:277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:682— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:682-696 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:601-616 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:682` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1502— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1502-1516 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1254-1267 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1502` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 6) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:121— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:121-134 | experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:142-155 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:149-162 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:170-183 | scripts/render-synthesized-software-cursor.swift:185-198 | scripts/render-synthesized-software-cursor.swift:206-219 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:204— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:204-214 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:177-187 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:128-138 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:566— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:566-574 | experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:728-736 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:478-486 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:642-650 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 918 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:566` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:174— experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift:174-182 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift:217-225 | scripts/render-synthesized-software-cursor.swift:244-252 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorGlyphRenderer.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:336— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:336-341 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:686-691 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:252-257 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:336` 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–6 lines × 2) experiments/LockedUse/Sources/AuthorizationProbe.swift:17— experiments/LockedUse/Sources/AuthorizationProbe.swift:17-22 | experiments/LockedUse/Sources/RemoteVerificationProbe.swift:19-23 — 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 `experiments/LockedUse/Sources/AuthorizationProbe.swift:17` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1866— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1866-1870 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:867-871 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1432-1436 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1866` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:1872` calls `distanceBetween`, `hypot` and `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:1438` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:665— experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:665-671 | experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:824-830 | packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift:581-587 — before extracting anything, compare `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift` and `experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–18 lines × 2) scripts/codex_dump.py:332— scripts/codex_dump.py:332-349 | scripts/codex_dump.py:355-368 — both copies are in the same file, so extract the 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 `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 (74 lines × 2) apps/OpenComputerUseLinux/main.go:1616— apps/OpenComputerUseLinux/main.go:1616-1689 | apps/OpenComputerUseWindows/main.go:1263-1336 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (54 lines × 2) apps/OpenComputerUseLinux/main.go:225— apps/OpenComputerUseLinux/main.go:225-278 | apps/OpenComputerUseWindows/main.go:288-341 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (34 lines × 2) apps/OpenComputerUseLinux/main.go:1791— apps/OpenComputerUseLinux/main.go:1791-1824 | apps/OpenComputerUseWindows/main.go:1438-1471 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (33 lines × 2) apps/OpenComputerUseLinux/main.go:1720— apps/OpenComputerUseLinux/main.go:1720-1752 | apps/OpenComputerUseWindows/main.go:1367-1399 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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. 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 (24–25 lines × 2) apps/OpenComputerUseLinux/main.go:146— apps/OpenComputerUseLinux/main.go:146-170 | apps/OpenComputerUseWindows/main.go:210-233 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (17 lines × 2) apps/OpenComputerUseLinux/main.go:377— apps/OpenComputerUseLinux/main.go:377-393 | apps/OpenComputerUseWindows/main.go:437-453 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (16 lines × 2) scripts/computer-use-cli/main.go:226— scripts/computer-use-cli/main.go:226-241 | scripts/computer-use-cli/main.go:292-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/computer-use-cli/main.go:226` 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 × 6) apps/OpenComputerUseLinux/main.go:386— apps/OpenComputerUseLinux/main.go:386-393 | apps/OpenComputerUseLinux/main.go:411-418 | apps/OpenComputerUseLinux/main.go:487-494 | apps/OpenComputerUseWindows/main.go:446-453 | apps/OpenComputerUseWindows/main.go:471-478 | apps/OpenComputerUseWindows/main.go:554-561 — `apps/OpenComputerUseLinux/main.go` and `apps/OpenComputerUseWindows/main.go` 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 50 separate duplicated blocks between them, totalling at least 896 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.
Duplicated block (17 lines × 2 locations) scripts/install-config-helper.mjs:233— scripts/install-config-helper.mjs:233 · scripts/install-config-helper.mjs:270 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) scripts/install-config-helper.mjs:792— scripts/install-config-helper.mjs:792 · scripts/install-config-helper.mjs:813 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (11 lines × 2 locations) scripts/npm/build-packages.mjs:140— scripts/npm/build-packages.mjs:140 · scripts/npm/publish-packages.mjs:74 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (5 matched lines × 2 locations) · ×1
Duplicated block with local edits (5 matched lines × 2 locations) scripts/install-config-helper.mjs:642— scripts/install-config-helper.mjs:642 · scripts/node-repl/open-computer-use-repl.mjs:142 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 31, cognitive 35) · ×1
Complex function main (cyclomatic 31, cognitive 35) scripts/node-repl/open-computer-use-cli.mjs:448— main has cyclomatic complexity 31 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateSetting (cyclomatic 24, cognitive 24) scripts/node-repl/ocu-config.mjs:25— validateSetting has cyclomatic complexity 24 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function query (cyclomatic 23, cognitive 25) scripts/node-repl/open-computer-use-repl.mjs:310— query has cyclomatic complexity 23 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function configCommand (cyclomatic 21, cognitive 26) scripts/node-repl/ocu-config.mjs:85— configCommand has cyclomatic complexity 21 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function installOpencodeMcp (cyclomatic 20, cognitive 30) scripts/install-config-helper.mjs:297— installOpencodeMcp has cyclomatic complexity 20 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function runInteractiveRepl (cyclomatic 19, cognitive 40) scripts/node-repl/open-computer-use-cli.mjs:347— runInteractiveRepl has cyclomatic complexity 19 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 19, cognitive 19) · ×1
Complex function main (cyclomatic 19, cognitive 19) scripts/install-config-helper.mjs:763— main has cyclomatic complexity 19 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseJavaScriptArgs (cyclomatic 16, cognitive 21) scripts/node-repl/open-computer-use-cli.mjs:206— parseJavaScriptArgs has cyclomatic complexity 16 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function selectText (cyclomatic 15, cognitive 16) scripts/node-repl/open-computer-use-repl.mjs:362— selectText has cyclomatic complexity 15 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function publishWithRetry (cyclomatic 14, cognitive 23) scripts/npm/publish-packages.mjs:161— publishWithRetry has cyclomatic complexity 14 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handle (cyclomatic 14, cognitive 18) scripts/node-repl/open-computer-use-repl.mjs:663— handle has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function normalizeImage (cyclomatic 13, cognitive 18) scripts/node-repl/open-computer-use-repl.mjs:78— normalizeImage has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateNotes (cyclomatic 13, cognitive 12) scripts/validate-github-release-notes.mjs:52— validateNotes has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R4 · Test Coverage· No test reaches this file · ×1
No test reaches this file scripts/npm/publish-packages.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
Duplicated predicate apps/OpenComputerUse/Sources/OpenComputerUse/MacOSAppAgentProxy.swift:510— `!json && !permissions.missingPermissions.isEmpty` appears character-identically in 2 files — apps/OpenComputerUse/Sources/OpenComputerUse/MacOSAppAgentProxy.swift, apps/OpenComputerUse/Sources/OpenComputerUse/OpenComputerUseMain.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 experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:667— `length < minimumLength || length < normalizationEpsilon` appears character-identically in 3 files — experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift, experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.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 experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift:577— `lhs.measurement.staysInBounds && !rhs.measurement.staysInBounds` appears character-identically in 2 files — experiments/StandaloneCursor/Sources/StandaloneCursorSupport/StandaloneCursorModel.swift, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SoftwareCursorOverlay.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 experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift:381— `progress >= configuration.closeEnoughProgressThreshold && abs(target - progress) <= configuration.closeEnoughDistanceThreshold` appears character-identically in 2 files — experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.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 packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift:1540— `result == .success && settable.boolValue` appears character-identically in 2 files — packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.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 experiments/LockedUse/Sources/Installer/InstallerMain.swift:383— `status.phase == .idle || status.phase == .awaitingManualUnlock` appears character-identically in 2 files — experiments/LockedUse/Sources/Installer/InstallerMain.swift, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/LockedUseActionScope.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 experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift:261— `type == .tapDisabledByTimeout || type == .tapDisabledByUserInput` appears character-identically in 2 files — experiments/LockedUse/Sources/Guardian/DisplayGuardian.swift, experiments/LockedUse/Sources/Guardian/ShieldPreview.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default in catch apps/OpenComputerUseLinux/runtime.py:105— `node_pid` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 in catch apps/OpenComputerUseLinux/runtime.py:392— `pixbuf_looks_black` swallows every exception into `return False` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 in catch experiments/LockedUse/AuthorizationPlugin/TaskVerifierDiagnostics.swift:27— `diagnoseBrokerTask` turns every thrown error into `-3` — 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 on error apps/OpenComputerUseLinux/main.go:795— `firstWaylandSocket` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error apps/OpenComputerUseWindows/main.go:193— `validateScreenshotPNGBase64` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 12 significant file(s) lose their only recent owner: scripts/cursor-motion-re/official_cursor_motion.py, experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift, apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift, packages/OpenComputerUseKit/Sources/OpenComputerUseKit/CursorMotionModel.swift, experiments/CursorMotion/Sources/CursorMotion/CursorLabRootView.swift, scripts/codex_dump.py, scripts/render-synthesized-software-cursor.swift, scripts/computer-use-cli/app_server.go (+4 more). Pair on, review, or document these before any departure.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 4 project(s) overshoot their size bounds, lowering Project Cohesion to 5.0/10. The most over is `(repository root)` (32160 LoC, 370 module-visible types across 16 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Classify ADR enforcement: 核心理念 docs/design-docs/core-beliefs.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Logging is not universal — Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `apps/OpenComputerUseLinux`, `apps/OpenComputerUseWindows`.
No SAST .github/workflows/windows-observation.yml:4— 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 17138 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
Changelog looks stale/thin — The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 8 file(s) — `apps/OpenComputerUse/Sources/OpenComputerUse/LockedUseNativeValidation.swift`, `apps/OpenComputerUseFixture/Sources/OpenComputerUseFixture/main.swift`, `experiments/CursorMotion/Sources/CursorMotion/CursorMotionModel.swift`, `experiments/LockedUse/Sources/Guardian/ScreenLock.swift`, `experiments/StandaloneCursor/Sources/StandaloneCursor/StandaloneCursorRootView.swift`, … (+3 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a18720-e230-7a6d-b5e6-202c88d25a30 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 1 · Warnings: 472 · Recommendations: 22 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-10-2026 @ 10:07 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.