Public report — openpencil, published 29 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_1ee03fc6dc634f8cb6c2673201aae5c2
Filed 29 September 2026, 21:25 UTC
Public
Very large · 717,990 LoC · 56 projects · rebuild ~6.2 person-years · weakest lens: Accessibility (48%)
Findings by grade
62 critical3020 serious69 minor40 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 September 2026, 21:05 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
3103findings with an exact file:lineof 3151 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
66/139dimensions across the health lenses717990 LoC · 56 projects — wide & deep
⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.
Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.
This system is a massive, high-value asset carrying significant operational risk. With a health score of 57%, the platform is stable but fragile, facing a velocity tax that slows every change and exposes the business to compliance failures. The sheer scale—nearly 720,000 lines of production code—means that inefficiencies compound rapidly, turning minor technical debts into major annual costs.
The most critical issue is accessibility debt. At 48%, this is the weakest lens for an asset of this size. Non-compliance is not just a technical oversight; it is a legal and reputational liability that blocks users and invites regulatory scrutiny. Remediation here offers the highest protection for the brand and ensures the product serves all customers. Ignoring this area means paying a continuous penalty in lost market reach and potential litigation.
Secondly, the codebase suffers from a structural velocity tax. While the architecture is sound, the code quality in key areas is mediocre, creating a drag on development speed. Every modification in these weaker zones costs 3–8% more effort than it should. This is an invisible tax on every feature release, slowing time-to-market and increasing long-term maintenance costs without adding new value. It is a silent drain on engineering productivity that compounds as the team grows.
Despite these risks, the system’s architecture is robust, and domain modeling is excellent. The core logic is well-structured, and the foundation is solid. This means that fixing surface-level issues will not require a risky overhaul. The system is not broken; it is just carrying unnecessary weight that slows it down.
Focus first on accessibility remediation. Adding text alternatives to images, videos, and interactive elements is a low-effort, high-impact fix that pays for itself within months. It addresses the highest legal risk and improves user experience immediately. Once this is secured, the team can address the broader code quality issues to restore development velocity. This approach minimizes risk while delivering quick, tangible value to the business.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
431 finding(s) are new versus the previous scan (2026-09-13) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €300,000–€1,500,000
0.8× (at 57% quality) — the last 20% of quality is most of the work
Size & shape
Very large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~6.2 person-years of build effort (about ~€910,000 to rebuild). Its weakest lens is Accessibility at 48% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Low (×0.9) — transaction-script/CRUD × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Enforce accessibility in the toolchain you already use: add `jsx-a11y` to the `plugins` array in your oxlint config (its a11y rules are off until the plugin is listed), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 437–2622.2 engineer-days every year, paid as drag on the ~5,189,959 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 3–8% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 1,279,716 line(s) changed over a 90-day window ⇒ ~5,189,959/year · D1/D2/D4/D6 code quality: averaging 6.7/10 ⇒ a 3–8% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Very large asset (~6.2 person-years to rebuild), and its weakest lens is Accessibility at 48%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.7/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 3–8% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 6.7/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
1932 modules, 3814 dependencies. 22 dependency cycles across 71 modules, marked above the diagonal.
Showing the 40 most-connected modules; 1892 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
op_collab_host.runtime.relay uses op_collab_relay_protocol.locator. Changing op_collab_relay_protocol.locator can break op_collab_host.runtime.relay, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
17→1 op_editor_core.agent_settings.config_types depends on op_ai.agent_settings_state✕
Type pairs
1 distinct (type in op_editor_core.agent_settings.config_types → type in op_ai.agent_settings_state) reference.
op_editor_core.agent_settings.config_types uses op_ai.agent_settings_state. Changing op_ai.agent_settings_state can break op_editor_core.agent_settings.config_types, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
17→24 op_editor_core.agent_settings.config_types depends on op_editor_core.agent_settingscycle✕
Type pairs
1 distinct (type in op_editor_core.agent_settings.config_types → type in op_editor_core.agent_settings) reference.
op_editor_core.agent_settings.config_types uses op_editor_core.agent_settings. Changing op_editor_core.agent_settings can break op_editor_core.agent_settings.config_types, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
18→9 op_editor_core.scene_vars depends on op_editor_core.node_id✕
Type pairs
1 distinct (type in op_editor_core.scene_vars → type in op_editor_core.node_id) reference.
op_editor_ui.widgets.property_panel_snapshot uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_editor_ui.widgets.property_panel_snapshot, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→13 op_html.mapper depends on op_html.css.cascade✕
Type pairs
1 distinct (type in op_html.mapper → type in op_html.css.cascade) reference.
op_collab_host.runtime uses op_collab_relay_protocol.locator. Changing op_collab_relay_protocol.locator can break op_collab_host.runtime, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→6 op_collab_host.runtime depends on op_editor_core.collab_ui_state✕
Type pairs
1 distinct (type in op_collab_host.runtime → type in op_editor_core.collab_ui_state) reference.
op_editor_core.agent_settings uses op_ai.agent_settings_state. Changing op_ai.agent_settings_state can break op_editor_core.agent_settings, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
24→17 op_editor_core.agent_settings depends on op_editor_core.agent_settings.config_types✕
Type pairs
4 distinct (type in op_editor_core.agent_settings → type in op_editor_core.agent_settings.config_types) references.
op_editor_core.agent_settings uses op_editor_core.agent_settings.config_types. Changing op_editor_core.agent_settings.config_types can break op_editor_core.agent_settings, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→22 op_editor_ui.widgets depends on op_html.snapshot✕
Type pairs
3 distinct (type in op_editor_ui.widgets → type in op_html.snapshot) references.
op_editor_core.editor_ui_state uses op_ai.agent_settings_state. Changing op_ai.agent_settings_state can break op_editor_core.editor_ui_state, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→6 op_editor_core.editor_ui_state depends on op_editor_core.collab_ui_state✕
Type pairs
1 distinct (type in op_editor_core.editor_ui_state → type in op_editor_core.collab_ui_state) reference.
op_editor_core.editor_ui_state uses op_editor_core.collab_ui_state. Changing op_editor_core.collab_ui_state can break op_editor_core.editor_ui_state, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→8 op_editor_core.editor_ui_state depends on op_editor_core.editor_ui_state.chrome✕
Type pairs
8 distinct (type in op_editor_core.editor_ui_state → type in op_editor_core.editor_ui_state.chrome) references.
op_editor_core.editor_ui_state uses op_editor_core.editor_ui_state.chrome. Changing op_editor_core.editor_ui_state.chrome can break op_editor_core.editor_ui_state, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→9 op_editor_core.editor_ui_state depends on op_editor_core.node_id✕
Type pairs
1 distinct (type in op_editor_core.editor_ui_state → type in op_editor_core.node_id) reference.
op_editor_core.editor_ui_state uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_editor_core.editor_ui_state, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→14 op_editor_core.editor_ui_state depends on op_i18n.locale✕
Type pairs
1 distinct (type in op_editor_core.editor_ui_state → type in op_i18n.locale) reference.
op_editor_core.editor_ui_state uses op_editor_core.ui_draft. Changing op_editor_core.ui_draft can break op_editor_core.editor_ui_state, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→24 op_editor_core.editor_ui_state depends on op_editor_core.agent_settings✕
Type pairs
2 distinct (type in op_editor_core.editor_ui_state → type in op_editor_core.agent_settings) references.
op_editor_core.editor_ui_state uses op_editor_core.agent_settings. Changing op_editor_core.agent_settings can break op_editor_core.editor_ui_state, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
29→4 op_editor_core.state depends on op_collab.protocol✕
Type pairs
1 distinct (type in op_editor_core.state → type in op_collab.protocol) reference.
op_editor_core.state uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_editor_core.state, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
29→18 op_editor_core.state depends on op_editor_core.scene_vars✕
Type pairs
2 distinct (type in op_editor_core.state → type in op_editor_core.scene_vars) references.
op_editor_ui.widgets.editor_state_ext uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_editor_ui.widgets.editor_state_ext, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
30→11 op_editor_ui.widgets.editor_state_ext depends on op_editor_ui.theme✕
Type pairs
1 distinct (type in op_editor_ui.widgets.editor_state_ext → type in op_editor_ui.theme) reference.
op_editor_ui.widgets.editor_state_ext uses op_editor_ui.theme. Changing op_editor_ui.theme can break op_editor_ui.widgets.editor_state_ext, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
30→28 op_editor_ui.widgets.editor_state_ext depends on op_editor_core.editor_ui_state✕
Type pairs
1 distinct (type in op_editor_ui.widgets.editor_state_ext → type in op_editor_core.editor_ui_state) reference.
op_editor_ui.widgets.editor_state_ext uses op_editor_core.editor_ui_state. Changing op_editor_core.editor_ui_state can break op_editor_ui.widgets.editor_state_ext, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→10 op_editor_ui.widgets.property_panel_sections depends on op_editor_core.property_panel_state✕
Type pairs
2 distinct (type in op_editor_ui.widgets.property_panel_sections → type in op_editor_core.property_panel_state) references.
op_editor_ui.widgets.property_panel_sections uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_editor_ui.widgets.property_panel_sections, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→11 op_editor_ui.widgets.property_panel_sections depends on op_editor_ui.theme✕
Type pairs
2 distinct (type in op_editor_ui.widgets.property_panel_sections → type in op_editor_ui.theme) references.
op_editor_ui.widgets.property_panel_sections uses op_editor_ui.theme. Changing op_editor_ui.theme can break op_editor_ui.widgets.property_panel_sections, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→19 op_editor_ui.widgets.property_panel_sections depends on op_editor_core.ui_draft✕
Type pairs
1 distinct (type in op_editor_ui.widgets.property_panel_sections → type in op_editor_core.ui_draft) reference.
op_editor_ui.widgets.property_panel_sections uses op_editor_core.ui_draft. Changing op_editor_core.ui_draft can break op_editor_ui.widgets.property_panel_sections, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→20 op_editor_ui.widgets.property_panel_sections depends on op_editor_ui.widgets.property_panel_snapshot✕
Type pairs
1 distinct (type in op_editor_ui.widgets.property_panel_sections → type in op_editor_ui.widgets.property_panel_snapshot) reference.
op_editor_ui.widgets.property_panel_sections uses op_editor_ui.widgets.property_panel_snapshot. Changing op_editor_ui.widgets.property_panel_snapshot can break op_editor_ui.widgets.property_panel_sections, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→22 op_editor_ui.widgets.property_panel_sections depends on op_html.snapshot✕
Type pairs
1 distinct (type in op_editor_ui.widgets.property_panel_sections → type in op_html.snapshot) reference.
op_editor_ui.widgets.property_panel_sections uses op_html.snapshot. Changing op_html.snapshot can break op_editor_ui.widgets.property_panel_sections, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→25 op_editor_ui.widgets.property_panel_sections depends on op_editor_ui.widgets✕
Type pairs
2 distinct (type in op_editor_ui.widgets.property_panel_sections → type in op_editor_ui.widgets) references.
op_editor_ui.widgets.property_panel_sections uses op_editor_ui.widgets. Changing op_editor_ui.widgets can break op_editor_ui.widgets.property_panel_sections, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→28 op_editor_ui.widgets.property_panel_sections depends on op_editor_core.editor_ui_state✕
Type pairs
1 distinct (type in op_editor_ui.widgets.property_panel_sections → type in op_editor_core.editor_ui_state) reference.
op_editor_ui.widgets.property_panel_sections uses op_editor_core.editor_ui_state. Changing op_editor_core.editor_ui_state can break op_editor_ui.widgets.property_panel_sections, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→9 op_editor_ui.widgets.layer_panel depends on op_editor_core.node_id✕
Type pairs
3 distinct (type in op_editor_ui.widgets.layer_panel → type in op_editor_core.node_id) references.
op_editor_ui.widgets.layer_panel uses op_editor_core.node_id. Changing op_editor_core.node_id can break op_editor_ui.widgets.layer_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→11 op_editor_ui.widgets.layer_panel depends on op_editor_ui.theme✕
Type pairs
1 distinct (type in op_editor_ui.widgets.layer_panel → type in op_editor_ui.theme) reference.
op_editor_ui.widgets.layer_panel uses op_editor_ui.widgets.icons. Changing op_editor_ui.widgets.icons can break op_editor_ui.widgets.layer_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→28 op_editor_ui.widgets.layer_panel depends on op_editor_core.editor_ui_state✕
Type pairs
1 distinct (type in op_editor_ui.widgets.layer_panel → type in op_editor_core.editor_ui_state) reference.
op_editor_ui.widgets.layer_panel uses op_editor_core.editor_ui_state. Changing op_editor_core.editor_ui_state can break op_editor_ui.widgets.layer_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→29 op_editor_ui.widgets.layer_panel depends on op_editor_core.state✕
Type pairs
2 distinct (type in op_editor_ui.widgets.layer_panel → type in op_editor_core.state) references.
op_editor_ui.widgets.property_panel uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_editor_ui.widgets.property_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
33→11 op_editor_ui.widgets.property_panel depends on op_editor_ui.theme✕
Type pairs
1 distinct (type in op_editor_ui.widgets.property_panel → type in op_editor_ui.theme) reference.
op_editor_ui.widgets.property_panel uses op_editor_ui.theme. Changing op_editor_ui.theme can break op_editor_ui.widgets.property_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
33→14 op_editor_ui.widgets.property_panel depends on op_i18n.locale✕
Type pairs
2 distinct (type in op_editor_ui.widgets.property_panel → type in op_i18n.locale) references.
op_editor_ui.widgets.property_panel uses op_editor_core.ui_draft. Changing op_editor_core.ui_draft can break op_editor_ui.widgets.property_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
33→20 op_editor_ui.widgets.property_panel depends on op_editor_ui.widgets.property_panel_snapshot✕
Type pairs
1 distinct (type in op_editor_ui.widgets.property_panel → type in op_editor_ui.widgets.property_panel_snapshot) reference.
op_editor_ui.widgets.property_panel uses op_editor_ui.widgets.property_panel_snapshot. Changing op_editor_ui.widgets.property_panel_snapshot can break op_editor_ui.widgets.property_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
33→22 op_editor_ui.widgets.property_panel depends on op_html.snapshot✕
Type pairs
2 distinct (type in op_editor_ui.widgets.property_panel → type in op_html.snapshot) references.
op_editor_ui.widgets.property_panel uses op_editor_ui.widgets. Changing op_editor_ui.widgets can break op_editor_ui.widgets.property_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
33→31 op_editor_ui.widgets.property_panel depends on op_editor_ui.widgets.property_panel_sections✕
Type pairs
2 distinct (type in op_editor_ui.widgets.property_panel → type in op_editor_ui.widgets.property_panel_sections) references.
op_editor_ui.widgets.property_panel uses op_editor_ui.widgets.property_panel_sections. Changing op_editor_ui.widgets.property_panel_sections can break op_editor_ui.widgets.property_panel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→1 op_host_services.web_canvas_server depends on op_ai.agent_settings_state✕
Type pairs
1 distinct (type in op_host_services.web_canvas_server → type in op_ai.agent_settings_state) reference.
op_host_services.web_canvas_server uses op_ai.agent_settings_state. Changing op_ai.agent_settings_state can break op_host_services.web_canvas_server, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→7 op_host_services.web_canvas_server depends on op_editor_core.command✕
Type pairs
1 distinct (type in op_host_services.web_canvas_server → type in op_editor_core.command) reference.
op_host_services.web_canvas_server uses op_editor_core.command. Changing op_editor_core.command can break op_host_services.web_canvas_server, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→29 op_host_services.web_canvas_server depends on op_editor_core.state✕
Type pairs
1 distinct (type in op_host_services.web_canvas_server → type in op_editor_core.state) reference.
op_host_services.web_canvas_server uses op_editor_core.state. Changing op_editor_core.state can break op_host_services.web_canvas_server, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→7 op_orchestrator.types depends on op_editor_core.command✕
Type pairs
1 distinct (type in op_orchestrator.types → type in op_editor_core.command) reference.
op_host_native.widget_host uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_host_native.widget_host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→11 op_host_native.widget_host depends on op_editor_ui.theme✕
Type pairs
1 distinct (type in op_host_native.widget_host → type in op_editor_ui.theme) reference.
op_host_native.widget_host uses op_editor_core.agent_settings. Changing op_editor_core.agent_settings can break op_host_native.widget_host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→27 op_host_native.widget_host depends on op_preview_core.session✕
Type pairs
1 distinct (type in op_host_native.widget_host → type in op_preview_core.session) reference.
op_host_native.widget_host uses op_editor_ui.widgets.layer_panel. Changing op_editor_ui.widgets.layer_panel can break op_host_native.widget_host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→33 op_host_native.widget_host depends on op_editor_ui.widgets.property_panel✕
Type pairs
1 distinct (type in op_host_native.widget_host → type in op_editor_ui.widgets.property_panel) reference.
op_host_native.widget_host uses op_editor_ui.widgets.property_panel. Changing op_editor_ui.widgets.property_panel can break op_host_native.widget_host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→3 op_orchestrator.plan depends on op_ai_skills.memory.document_context✕
Type pairs
1 distinct (type in op_orchestrator.plan → type in op_ai_skills.memory.document_context) reference.
op_orchestrator.plan uses op_ai_skills.memory.document_context. Changing op_ai_skills.memory.document_context can break op_orchestrator.plan, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→35 op_orchestrator.plan depends on op_orchestrator.types✕
Type pairs
1 distinct (type in op_orchestrator.plan → type in op_orchestrator.types) reference.
op_host_web.widget_host uses op_editor_core.property_panel_state. Changing op_editor_core.property_panel_state can break op_host_web.widget_host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→11 op_host_web.widget_host depends on op_editor_ui.theme✕
Type pairs
1 distinct (type in op_host_web.widget_host → type in op_editor_ui.theme) reference.
op_host_web.widget_host uses op_editor_ui.widgets.layer_panel. Changing op_editor_ui.widgets.layer_panel can break op_host_web.widget_host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→33 op_host_web.widget_host depends on op_editor_ui.widgets.property_panel✕
Type pairs
1 distinct (type in op_host_web.widget_host → type in op_editor_ui.widgets.property_panel) reference.
op_host_web.widget_host uses op_editor_ui.widgets.property_panel. Changing op_editor_ui.widgets.property_panel can break op_host_web.widget_host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→36 op_host_web.widget_host depends on op_host_native.widget_host✕
Type pairs
3 distinct (type in op_host_web.widget_host → type in op_host_native.widget_host) references.
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:2021 — Injection
52
High / Critical
A06:2021 — Vulnerable & Outdated Components
42
High / Critical
A05:2021 — Security Misconfiguration
4
High / Critical
Roadmap
First, ensure all media elements have appropriate text alternatives and that every form control and button has a programmatic label. Next, correct the page structure by defining the language, title, and main landmark, while maintaining proper heading order and disabling meta-refresh. To sustain these improvements, integrate jsx-a11y into your linting configuration, assert accessibility in tests, and gate checks in CI. Finally, reduce the complexity of branch-heavy functions to improve maintainability.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Enforce accessibility in the toolchain you already use: add `jsx-a11y` to the `plugins` array in your oxlint config (its a11y rules are off until the plugin is listed), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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 — 62
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 — 3020
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 — 69
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 40
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. 61 of 66 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 66 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 3103 of 3151 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.
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 214 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 992 test source file(s) (.rs, .rb, .swift) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite 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 reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for packages/op-web-sdk/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
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 reliability for the vitest suite in packages/op-web-sdk/ was NOT MEASURED: the dependency install for packages/op-web-sdk/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 reliability for the vitest suite in packages/op-web-sdk-react/ was NOT MEASURED: the dependency install for packages/op-web-sdk-react/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 reliability for the vitest suite in packages/op-web-sdk-vue/ was NOT MEASURED: the dependency install for packages/op-web-sdk-vue/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Dependency Hygiene ran out of its 5-minute budget before it had finished, so what it reports here is a floor rather than a complete count. The rows above are real and stand; what is not known is how many more there are. This is a limit of the analysis run, not a finding about this repository.
D31 IaC & Container Security — 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. REDACTED.web-rust.dockerignore carries no `FROM` instruction, so it declares no build stage and every REDACTED rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 20 of 21 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
AX1 Captive dependencies — 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and no container it models, or knows cannot hold a captive, was found in this repository's source, 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.
AX2 Stateful singletons — 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 Microsoft.Extensions.DependencyInjection singletons in C# and Spring/JSR-330/CDI singletons in Java and Kotlin only, and this repository's product is written in Python and Swift, which was left unread, 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.
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.
ED5 Idempotency — 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 finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
PF3 Async & latency hygiene — 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. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
R10 Code Duplication — 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. 5 further occurrence(s) are not listed individually; the score already reflects all 45.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X14 Bypassable address classification — 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 implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X26 Unsynchronised callback handoff — 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 implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X3 Exception handling — 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 implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X32 Type resolved by simple name across every loaded assembly — 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 implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X7 Silent fallback defaults — 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. X7 measured the part of this repository it reads (C#, Python and TypeScript/JavaScript), and its Kotlin, Rust, Swift source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.
Repo exclusion declarations: 10 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
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 REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, 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.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
420 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was op_ck_bridge.opCkInit at 366. A further 156 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being op_i18n::i18n::zh_cn::lookup at 766 — they are counted neither in the figure above nor in this dimension's score. 96 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: crates/op-i18n/src/i18n/en.rs (op_i18n::i18n::en::lookup at 766), crates/op-i18n/src/i18n/zh_cn.rs (op_i18n::i18n::zh_cn::lookup at 766), crates/op-i18n/src/i18n/en_panel.rs (op_i18n::i18n::en_panel::lookup at 451), crates/op-i18n/src/i18n/zh_cn_panel.rs (op_i18n::i18n::zh_cn_panel::lookup at 451), crates/op-i18n/src/i18n/en_git.rs (op_i18n::i18n::en_git::lookup at 326), and 91 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 94 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 47 op_editor_ui finding(s) in Cyclomatic Complexity — start with property_panel_input_layout.rs (2), ai_chat_transcript.rs (2), agent_settings_builtin_form.rs (2). — One of this dimension's main actionable groups (47 warning-level).
Resolve the 46 op_orchestrator finding(s) in Cyclomatic Complexity — start with validation_fixes_apply.rs (2), parse.rs (2), cleanup_slide_padding.rs (2). — One of this dimension's main actionable groups (46 warning-level).
Resolve the 43 WidgetHostNative finding(s) in Cyclomatic Complexity — start with cursor_move_overlays.rs (3), press_chrome_tiers.rs (3), keyboard_delete.rs (2). — One of this dimension's main actionable groups (43 warning-level).
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.
+ 151 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 108 op_orchestrator finding(s) in Cognitive Complexity — start with cleanup_slide_padding.rs (5), geometry_row_fixes.rs (4), validation_fixes_apply.rs (3). — One of this dimension's main actionable groups (108 warning-level).
Resolve the 78 op_editor_ui finding(s) in Cognitive Complexity — start with paint.rs (4), agent_settings_builtin.rs (2), property_panel_input_layout.rs (2). — One of this dimension's main actionable groups (78 warning-level).
Resolve the 50 WidgetHostNative finding(s) in Cognitive Complexity — start with press_chrome_tiers.rs (4), cursor_move_overlays.rs (3), keyboard_delete.rs (2). — One of this dimension's main actionable groups (50 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.0 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 134 FunctionTooLong finding(s) in God Classes — start with connection.rs (5), home_surface_paint_art_screens.rs (3), op_ck_bridge.js (2). — One of this dimension's main actionable groups (134 warning-level).
Resolve the 81 MethodTooLong finding(s) in God Classes — start with paint.rs (4), keyboard_escape.rs (2), overlay_cursor.rs (2). — One of this dimension's main actionable groups (81 warning-level).
Resolve the 64 FileTooLong finding(s) in God Classes — start with op_host_web.js (2), paint.rs (2), op_ck_bridge.js. — One of this dimension's main actionable groups (64 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.
974 duplicated block group(s) detected. A further 43 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 7 of the 1017 are in trees this repository does not ship — vendored, example/demo, 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.
+ 198 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 77 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with prompt_center_catalog.rs (2), mcp_integrations.rs (2), model_discovery.rs (2). — One of this dimension's main actionable groups (77 warning-level).
Resolve the 76 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with icon_path_normalize.rs (3), batch_design_result.rs (2), layout_props.rs (2). — One of this dimension's main actionable groups (76 warning-level).
Resolve the 71 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with codegen_html.rs (3), guest.rs (2), path_data.rs (2). — One of this dimension's main actionable groups (71 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 · Coupling6.9 / 10Adequate✓ 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.
56 production modules (Gradle+Cargo+npm), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 20 module(s) off the main sequence, with abstractness counted on 54 of the 56 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
Off the main sequence: @zseven-w/op-web-sdk · ×20
Unstable project op-engine-ffi
Unstable project op-host-web
What to do
Resolve the 20 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 1 Unstable project op-engine-ffi finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project op-host-web finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 8 Low cohesion finding(s) in Cohesion (LCOM4) — start with chat.rs (2), skia.rs, agent_settings.rs. — One of this dimension's main actionable groups (8 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
13326 test methods: 12819 unit, 466 integration, 0 BDD, 41 e2e. The JavaScript/TypeScript suite contributes 215 `it`/`test` case(s) across 31 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 13104 `#[test]` function(s) across 1728 file(s) declaring at least one; its unit/integration split is Cargo's own — 79 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 7 test function(s) across 1 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.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ 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.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 214 tests. Measured on the JavaScript/TypeScript suite only — at least 992 test source file(s) (.rs, .rb, .swift) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: crates/op-host-web/src/op_ck_bridge.js (18×366=6588); crates/op-host-desktop/src/keyboard_input.rs (29×136=3944); crates/op-host-native/src/widget_host/paint.rs (42×86=3612) Repeated repair below the complexity floor: crates/op-orchestrator/src/cleanup.rs (28 of 55 changes were fixes); crates/op-host-services/src/chat_intent.rs (12 of 18 changes were fixes); crates/op-orchestrator/src/role_post_pass.rs (11 of 20 changes were fixes)
Resolve the 210 Hotspot finding(s) in Churn × Complexity Hotspots — start with connection.rs (4), paint.rs (3), lib.rs (3). — One of this dimension's main actionable groups (210 warning-level).
Resolve the 70 Repeated repair finding(s) in Churn × Complexity Hotspots — start with cleanup.rs, chat_intent.rs, role_post_pass.rs. — One of this dimension's main actionable groups (70 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 Factor6.8 / 10Adequate✓ 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.
702 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/op-html/src/import_warning.rs. Counted over 2207 of the 2513 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 · ×2
What to do
Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 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.
11 deducted task-comment markers across 717990 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 11 TodoComment finding(s) in Explicit Debt — start with validation_fixes_b3.rs (4), chat_canvas_tools.rs, assets.rs. — One of this dimension's main actionable groups (11 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
OpenPencil is a top-level repository with an outstanding root README and architecture/design docs. The root README (5k words) states the project's purpose, branding, and global overview while linking to every language/region locale file, plus star/CI/license badges and a multi-platform roadmap. Each crates/op-... directory README documents itself rather than the repository, so its own install/usage/contribution guidance is not flagged as missing; the root README covers all four required tiers (overview, installation, usage, contributing). The architecture docs are well written with an explicit outline for every section present and no clipped content. The OpenPencil documentation is clear and complete for its deployed directories: each README describes the directory it documents (e.g. 'OpenPencil Global ingress to CN home relay', 'Overseas ingress to the CN relay locator') without referencing the repository root's overview, installation, or contribution guidance; the architecture/design docs are separate markdown files. The visible content is well-structured with headings and an outline for each document, so any missing section would be flagged by the outline rather than being a defect of the visible text. (7 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyWeak◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
5 API inconsistencies across a 400-member sample of 2295 exposed types.
Redundant creation methods with unclear distinction. `new_session` likely creates a session with default options, while `new_session_with` takes explicit options. However, the naming convention is inconsistent with standard patterns like `create` vs `create_with` or `new` vs `new_from_options`. More critically, `NewSessionOptions` is a struct, suggesting `new_session` should just accept optional parameters or a builder pattern, rather than having two distinct entry points that do the same core action.
Ambiguous semantic overlap between 'close' and 'delete'. In many session-based APIs, 'close' terminates the active session but may keep state, while 'delete' removes it entirely. However, the naming `close_session_if_supported` and `delete_session_if_supported` suggests these are capability-gated operations. If the underlying protocol treats them as distinct lifecycle stages, the names are okay, but if they are often used interchangeably or one implies the other, this is confusing. Given the presence of `supports_session_close` and `supports_session_delete`, they are likely distinct, but the API surface feels cluttered with capability checks that could be handled internally or via a single `terminate_session` method.
Redundant send methods. `send_cancellable` is a specialized version of `send`. The existence of `supports_cancellable_send` suggests that `send` might not be cancellable, but the API user has to know which method to call. This splits the intent of 'sending a request' across two methods based on a capability flag, which is a common anti-pattern.
Duplicate intent across different types. Both `OpenAiToolCollector` and `AnthropicToolCollector` have a `handle` method that takes a string and returns a `ChatDelta`. This suggests a common trait or interface should be defined for tool collectors to abstract away the provider-specific parsing logic.
Inconsistent return types and naming for CRUD operations. `user_style_guides` returns a single `UserStyleGuide` (likely the last one or a default?), `set_user_style_guides` takes a single `UserStyleGuide` but the name implies plural, `remove_user_style_guide` returns a `UserStyleGuide` (the removed one?), and `load_user_style_guide` also returns a `UserStyleGuide`. The naming is inconsistent (`guides` vs `guide`) and the return types are unclear (is it the updated state, the removed item, or a success indicator?).
What to do
Resolve the 1 Redundant creation methods with unclear distinction. `new_session`… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Ambiguous semantic overlap between 'close' and 'delete'. In many… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Redundant send methods. `send_cancellable` is a specialized version of… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_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).
52 finding(s): 0 critical, 36 high, 7 medium, 9 low. 36 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 17 file(s) — `crates/op-editor-host-core/src/settings_io.rs` (line 476), `crates/op-editor-host-core/src/settings_payload.rs` (line 259), `crates/op-figma/examples/bench_memory.rs` (line 93, line 103), `crates/op-host-web/assets/canvaskit/canvaskit.js`, `crates/op-web-sdk/tools/build-wasm.sh` (line 141), … (+12 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-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).
No action in Static Analysis (SAST) — all 36 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (36 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 18 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (11), REDACTED (6), REDACTED. — One of this dimension's main actionable groups (18 issue-level).
Resolve the 9 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (3). — One of this dimension's main actionable groups (9 warning-level).
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 2207 of the 2513 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 16 Change coupling finding(s) in Change Coupling — start with main.rs (3), subagent.rs, plan_normalize.rs. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 5 Change-coupling hub finding(s) in Change Coupling — start with prompt.rs, mcp_serve.rs, editor_ui_state.rs. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 11 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.
End-of-life runtime: Rust 1.94
What to do
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives2.2 / 10Weak✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×3) — crates/op-host-services/src/web_static/index.html:45, crates/op-host-web/smoke/step-1b.html:37, crates/op-web-sdk/smoke/index.html:22
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels5.4 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — packages/op-chrome-extension/popup.html:86
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — crates/op-host-services/src/web_static/missing_bundle.html:2, crates/op-web-sdk/smoke/index.html:2, packages/op-chrome-extension/popup.html:2
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — packages/op-chrome-extension/popup.html:2
A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — packages/op-chrome-extension/popup.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain you already use: add `jsx-a11y` to the `plugins` array in your oxlint config (its a11y rules are off until the plugin is listed), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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 the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. 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.
Other · Domain Modelling — Whether an aggregate references another aggregate by identity rather than embedding it by object reference.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
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
Add a README to the 44 of 57 project(s) that lack one — worth up to 1.5 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
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 · Observability6.6 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 13/24 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/op-cli`, `crates/op-collab-host`, `crates/op-collab-relay-client`, `crates/op-collab-relay-control-plane` and 6 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) so requests are traceable across the system, not just health-probable.
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.
What to do
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.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 40 use(s) across 14,103 production line(s) (~2.8/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
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) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety7.1 / 10Strong✓ 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.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
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.
13 of the duplicated blocks reported below have copies in at least two of the sibling directories pkg-ck, src under crates/op-host-web/. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41 · crates/op-host-web/src/op_ck_bridge.js:367 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202 · crates/op-host-web/src/op_ck_bridge.js:838 — the 2 copies are spread across 2 files, 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. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340 · crates/op-host-web/src/op_ck_bridge.js:1308 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340
packages/op-chrome-extension/i18n.js:210 · packages/op-chrome-extension/i18n.js:255 — 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. — packages/op-chrome-extension/i18n.js:210
crates/op-host-web/src/op_ck_bridge.js:1266 · crates/op-host-web/src/op_ck_bridge.js:1285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-host-web/src/op_ck_bridge.js:1266
packages/op-chrome-extension/design-capture.js:606 · packages/op-chrome-extension/design-evidence.js:233 — the 2 copies are spread across 2 files, 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. — packages/op-chrome-extension/design-capture.js:606
packages/op-vscode/src/vscode/configure-command.ts:52 · packages/op-vscode/src/vscode/configure-command.ts:102 — the two spans are one implementation copied and then locally edited — 109 tokens are still identical, in the same order in both spans, 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. — packages/op-vscode/src/vscode/configure-command.ts:52
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118 · crates/op-host-web/src/op_ck_bridge.js:444 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118
packages/op-chrome-extension/capture.js:210 · packages/op-chrome-extension/picker.js:294 — the two spans are one implementation copied and then locally edited — 149 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. — packages/op-chrome-extension/capture.js:210
packages/op-chrome-extension/popup.js:187 · packages/op-chrome-extension/popup.js:214 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both spans, 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. — packages/op-chrome-extension/popup.js:187
crates/op-host-web/src/op_ck_image_cache.js:142 · crates/op-host-web/src/op_ck_image_cache.js:271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-host-web/src/op_ck_image_cache.js:142
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380 · crates/op-host-web/src/op_ck_bridge.js:977 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380
crates/op-host-web/src/op_ck_bridge.js:761 · crates/op-host-web/src/op_ck_bridge.js:783 — 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. — crates/op-host-web/src/op_ck_bridge.js:761
packages/op-vscode/src/session/pen-session.ts:412 · packages/op-vscode/src/session/pen-session.ts:583 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, 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. — packages/op-vscode/src/session/pen-session.ts:412
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253 · crates/op-host-web/src/op_ck_bridge.js:1124 — the 2 copies are spread across 2 files, 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. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253
crates/op-host-web/src/op_ck_bridge.js:1778 · crates/op-host-web/src/op_ck_bridge.js:1791 — 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. — crates/op-host-web/src/op_ck_bridge.js:1778
packages/op-web-sdk-react/src/design-view.tsx:25 · packages/op-web-sdk-vue/src/design-view.ts:21 — the two spans are one implementation copied and then locally edited — 67 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. — packages/op-web-sdk-react/src/design-view.tsx:25
packages/scripts/sync-version.mjs:258 · packages/scripts/sync-version.mjs:281 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both spans, 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. — packages/scripts/sync-version.mjs:258
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168 · crates/op-host-web/src/op_ck_bridge.js:572 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241 · crates/op-host-web/src/op_ck_bridge.js:1013 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431 · crates/op-host-web/src/op_ck_bridge.js:1909 — the 2 copies are spread across 2 files, 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. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431
crates/op-host-web/src/op_ck_bridge.js:1517 · crates/op-host-web/src/op_ck_bridge.js:1636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-host-web/src/op_ck_bridge.js:1517
packages/op-chrome-extension/design-capture.js:61 · packages/op-chrome-extension/design-evidence.js:28 — 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. — packages/op-chrome-extension/design-capture.js:61
packages/op-web-sdk-react/vitest.config.ts:1 · packages/op-web-sdk-vue/vitest.config.ts:2 — the two spans are one implementation copied and then locally edited — 80 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. — packages/op-web-sdk-react/vitest.config.ts:1
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9 · crates/op-host-web/src/op_ck_bridge.js:9 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9
crates/op-html/assets/snapshot-extractor.js:420 · crates/op-html/assets/snapshot-extractor.js:765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-html/assets/snapshot-extractor.js:420
packages/op-chrome-extension/client.js:94 · packages/op-chrome-extension/client.js:452 — 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. — packages/op-chrome-extension/client.js:94
packages/op-vscode/src/vscode/shell-messages.ts:36 · packages/op-vscode/src/vscode/shell-messages.ts:87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/op-vscode/src/vscode/shell-messages.ts:36
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151 · crates/op-host-web/src/op_ck_bridge.js:544 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151
crates/op-html/assets/snapshot-extractor.js:1071 · crates/op-html/assets/snapshot-extractor.js:1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-html/assets/snapshot-extractor.js:1071
packages/op-chrome-extension/account.js:130 · packages/op-chrome-extension/client.js:432 — the 2 copies are spread across 2 files, 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. — packages/op-chrome-extension/account.js:130
packages/op-chrome-extension/background.js:178 · packages/op-chrome-extension/design-md.js:34 — 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. — packages/op-chrome-extension/background.js:178
packages/op-chrome-extension/capture.js:90 · packages/op-chrome-extension/capture.js:193 — the two spans are one implementation copied and then locally edited — 59 tokens are still identical, in the same order in both spans, 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. — packages/op-chrome-extension/capture.js:90
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409 · crates/op-host-web/src/op_ck_bridge.js:1761 — the 2 copies are spread across 2 files, 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. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409
packages/op-chrome-extension/background.js:223 · packages/op-chrome-extension/popup.js:316 — 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. — packages/op-chrome-extension/background.js:223
packages/op-chrome-extension/design-capture.js:402 · packages/op-chrome-extension/design-capture.js:413 — 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. — packages/op-chrome-extension/design-capture.js:402
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312 · crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312
crates/op-host-web/src/op_ck_bridge.js:182 · crates/op-host-web/src/op_ck_bridge.js:221 — 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. — crates/op-host-web/src/op_ck_bridge.js:182
crates/op-host-web/src/op_ck_bridge.js:1557 · crates/op-host-web/src/op_ck_bridge.js:1648 — 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. — crates/op-host-web/src/op_ck_bridge.js:1557
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.
collectDesignEvidenceInPage has cyclomatic complexity 47 and cognitive complexity 78; 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. — packages/op-chrome-extension/design-capture.js:19
measureParagraph has cyclomatic complexity 39 and cognitive complexity 92; 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. — crates/op-host-web/src/op_ck_bridge.js:1609
vectorizeSvg has cyclomatic complexity 38 and cognitive complexity 49; 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. — crates/op-html/assets/snapshot-extractor.js:586
drawImageWithOptions has cyclomatic complexity 34 and cognitive complexity 53; 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. — crates/op-host-web/src/op_ck_bridge.js:1353
walkRules has cyclomatic complexity 31 and cognitive complexity 71; 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. — packages/op-chrome-extension/design-capture.js:363
parseInboundFromPage has cyclomatic complexity 29 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 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. — packages/op-vscode/src/protocol/bridge.ts:58
generateDesignMd has cyclomatic complexity 23 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. — packages/op-chrome-extension/client.js:287
jpegFitsThumbnailBounds has cyclomatic complexity 23 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. — crates/op-host-web/src/op_ck_image_cache.js:22
failureMessage has cyclomatic complexity 20 and cognitive complexity 6; 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. — packages/op-chrome-extension/background.js:257
toHex has cyclomatic complexity 19 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. — packages/op-chrome-extension/design-capture.js:104
componentSample has cyclomatic complexity 19 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 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. — packages/op-chrome-extension/design-capture.js:311
capturePage has cyclomatic complexity 18 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. — packages/op-chrome-extension/capture.js:233
t has cyclomatic complexity 17 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. — packages/op-chrome-extension/i18n.js:242
opCkMakeRuntimeShader has cyclomatic complexity 17 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 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. — crates/op-host-web/src/op_ck_bridge.js:178
textFirstBaseline has cyclomatic complexity 16 and cognitive complexity 20; 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. — crates/op-host-web/src/op_ck_bridge.js:1504
buildImage has cyclomatic complexity 15 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. — crates/op-html/assets/snapshot-extractor.js:776
buildInlineRun has cyclomatic complexity 15 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. — crates/op-html/assets/snapshot-extractor.js:1054
shapeToPathData has cyclomatic complexity 15 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. — crates/op-html/assets/snapshot-extractor.js:485
onDownload has cyclomatic complexity 15 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. — packages/op-chrome-extension/popup.js:308
buildTextLines has cyclomatic complexity 15 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. — crates/op-html/assets/snapshot-extractor.js:359
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files3.4 / 10Weak✓ 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.
10 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: crates/op-host-web/src/op_ck_bridge.js (1873), crates/op-html/assets/snapshot-extractor.js (1193), packages/op-chrome-extension/popup.js (697), packages/op-chrome-extension/design-capture.js (628), packages/op-vscode/src/vscode/pen-editor-provider.ts (581), packages/op-vscode/src/session/pen-session.ts (571) (+4 more).
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage5.8 / 10Adequate✓ 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. (×24) — crates/op-host-web/src/op_ck_bridge.js, crates/op-html/assets/snapshot-extractor.js, packages/op-chrome-extension/popup.js, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ 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.
Do you agree with this assessment?
R7 · Dead Code9.2 / 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.
20 file(s) (~6442 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: packages/op-chrome-extension/background.js imports './wasm/op_chrome_extension_core.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — packages
Unreachable from the 19 application, 15 tooling and 35 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×3) — crates/op-host-web/src/op_ck_image_cache.js, packaging/harmony/entry/hvigorfile.ts, packaging/harmony/hvigorfile.ts
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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 · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — defense in depth, even when a reverse proxy could set them. This is reported because `global-nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — deploy/collab-relay-edge/global-nginx.conf:32
What to do
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
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 — 4 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.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
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.
Not included — 66 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.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AX1 Captive dependencies — 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
AX2 Stateful singletons — 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
AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
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
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.global-edge.image: required variable OPENPENCIL_RELAY_EDGE_IMAGE_REPOSITORY is missing a value: set the audited nginx-unprivileged repository; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D14 License Compliance — Not scored — this repository's 753 shipped crate(s) were read from its REDACTED, but crates.io could not be asked for the licence of 64 of them (HTTP 429 Unknown Error), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
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.
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. Aggregate roots were found in only one source directory (op-orchestrator), which is a layered codebase, not two contexts. 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — 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.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/op-web-sdk/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
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
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. 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
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 — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) 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 `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, 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 — uses a bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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 reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, 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
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score.
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.
AC2 · Forms & labels· <input> without a programmatic label · ×1
<input> without a programmatic label packages/op-chrome-extension/popup.html:86— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<html> without a lang packages/op-chrome-extension/popup.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure· Document without a <title> · ×1
Document without a <title> packages/op-chrome-extension/popup.html:2— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Hotspot: crates/op-host-web/src/op_ck_bridge.js crates/op-host-web/src/op_ck_bridge.js:308— crates/op-host-web/src/op_ck_bridge.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 366 in op_ck_bridge.opCkInit at line 308. 8 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-web/src/op_ck_bridge.js`: 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: crates/op-host-desktop/src/keyboard_input.rs crates/op-host-desktop/src/keyboard_input.rs:15— crates/op-host-desktop/src/keyboard_input.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 136 in DesktopApp::handle_key_pressed at line 15. 10 of those changes were fix/bug commits, and the other 19 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/keyboard_input.rs`: 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: crates/op-host-native/src/widget_host/paint.rs crates/op-host-native/src/widget_host/paint.rs:19— crates/op-host-native/src/widget_host/paint.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in WidgetHostNative::paint at line 19. 5 of those changes were fix/bug commits, and the other 37 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/paint.rs`: 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: crates/op-host-web/src/widget_host/cursor_input.rs crates/op-host-web/src/widget_host/cursor_input.rs:17— crates/op-host-web/src/widget_host/cursor_input.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 148 in WidgetHost::apply_cursor_move at line 17. 4 of those changes were fix/bug commits, and the other 19 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-web/src/widget_host/cursor_input.rs`: 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: crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118— crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner at line 118. 10 of those changes were fix/bug commits, and the other 20 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs`: 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: crates/op-editor-core/src/command_apply.rs crates/op-editor-core/src/command_apply.rs:55— crates/op-editor-core/src/command_apply.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in EditorState::apply_with_allocator at line 55. 4 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-editor-core/src/command_apply.rs`: 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: crates/op-editor-ui/src/widgets/icons.rs crates/op-editor-ui/src/widgets/icons.rs:294— crates/op-editor-ui/src/widgets/icons.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 149 in Icon::paths at line 294. 2 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/icons.rs`: 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: crates/op-host-native/src/widget_host/press.rs crates/op-host-native/src/widget_host/press.rs:201— crates/op-host-native/src/widget_host/press.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in WidgetHostNative::apply_press_inner at line 201. 4 of those changes were fix/bug commits, and the other 27 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/press.rs`: 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: crates/op-host-web/src/widget_host/paint.rs crates/op-host-web/src/widget_host/paint.rs:49— crates/op-host-web/src/widget_host/paint.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in WidgetHost::paint_editor at line 49. 5 of those changes were fix/bug commits, and the other 25 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-web/src/widget_host/paint.rs`: 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: crates/op-host-services/src/web_canvas_server.rs crates/op-host-services/src/web_canvas_server.rs:460— crates/op-host-services/src/web_canvas_server.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in op_host_services::web_canvas_server::handle_web_canvas_request at line 460. 8 of those changes were fix/bug commits, and the other 26 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server.rs`: 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: crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:60— crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in AIChatPlaceholder::hit_test_with_canonical at line 60. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs`: 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: crates/op-host-desktop/src/app_handler.rs crates/op-host-desktop/src/app_handler.rs:435— crates/op-host-desktop/src/app_handler.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in DesktopApp::window_event at line 435. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/app_handler.rs`: 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: crates/op-host-native/src/widget_host/scroll.rs crates/op-host-native/src/widget_host/scroll.rs:475— crates/op-host-native/src/widget_host/scroll.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in WidgetHostNative::apply_wheel_inner at line 475. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/scroll.rs`: 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: crates/op-host-services/src/mcp_serve.rs crates/op-host-services/src/mcp_serve.rs:403— crates/op-host-services/src/mcp_serve.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in op_host_services::mcp_serve::read_http_request at line 403. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/mcp_serve.rs`: 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: crates/op-host-desktop/src/persistence.rs crates/op-host-desktop/src/persistence.rs:372— crates/op-host-desktop/src/persistence.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in op_host_desktop::persistence::run_action at line 372. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/persistence.rs`: 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: crates/op-host-native/src/widget_host/keyboard.rs crates/op-host-native/src/widget_host/keyboard.rs:16— crates/op-host-native/src/widget_host/keyboard.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in WidgetHostNative::apply_text at line 16. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/keyboard.rs`: 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: crates/op-host-desktop/src/app_handler/redraw.rs crates/op-host-desktop/src/app_handler/redraw.rs:35— crates/op-host-desktop/src/app_handler/redraw.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in DesktopApp::on_redraw_requested at line 35. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/app_handler/redraw.rs`: 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: crates/op-host-services/src/web_canvas_server/connection.rs crates/op-host-services/src/web_canvas_server/connection.rs:101— crates/op-host-services/src/web_canvas_server/connection.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in op_host_services::web_canvas_server::connection::dispatch at line 101. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server/connection.rs`: 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: crates/op-smoke/src/main.rs crates/op-smoke/src/main.rs:214— crates/op-smoke/src/main.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in op_smoke::main at line 214. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-smoke/src/main.rs`: 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: crates/op-host-native/src/widget_host/input.rs crates/op-host-native/src/widget_host/input.rs:208— crates/op-host-native/src/widget_host/input.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in WidgetHostNative::apply_node_drag_cursor_move at line 208. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/input.rs`: 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: crates/op-cli/src/main.rs crates/op-cli/src/main.rs:366— crates/op-cli/src/main.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in op_cli::command_from_positionals at line 366. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-cli/src/main.rs`: 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: crates/op-host-web/src/canvaskit/mount.rs crates/op-host-web/src/canvaskit/mount.rs:14— crates/op-host-web/src/canvaskit/mount.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in op_host_web::canvaskit::mount::mount_ck at line 14. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-web/src/canvaskit/mount.rs`: 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: crates/op-host-services/src/chat_subprocess.rs crates/op-host-services/src/chat_subprocess.rs:280— crates/op-host-services/src/chat_subprocess.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in SubprocessProvider::send_inner at line 280. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_subprocess.rs`: 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: crates/op-host-native/src/widget_host/keyboard_escape.rs crates/op-host-native/src/widget_host/keyboard_escape.rs:13— crates/op-host-native/src/widget_host/keyboard_escape.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in WidgetHostNative::apply_escape at line 13. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/keyboard_escape.rs`: 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: crates/op-editor-core/src/scene_template_catalog.rs crates/op-editor-core/src/scene_template_catalog.rs:62— crates/op-editor-core/src/scene_template_catalog.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in op_editor_core::scene_template_catalog::scene_template_document_route at line 62. 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-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-editor-core/src/scene_template_catalog.rs`: 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.
FunctionTooLong: op_ck_bridge.opCkInit crates/op-host-web/src/op_ck_bridge.js:308— FunctionTooLong — opCkInit runs 1167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1067 over it, 11.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_web.__wbg_get_imports crates/op-host-web/pkg-webgl/op_host_web.js:66— FunctionTooLong — __wbg_get_imports runs 982 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 882 over it, 9.82× 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: op_host_web.__wbg_get_imports crates/op-host-web/pkg-ck/op_host_web.js:31— FunctionTooLong — __wbg_get_imports runs 684 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 584 over it, 6.84× 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: op_editor_ui::widgets::property_panel_dispatch::apply_property_action crates/op-editor-ui/src/widgets/property_panel_dispatch.rs:186— FunctionTooLong — op_editor_ui::widgets::property_panel_dispatch::apply_property_action runs 475 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 375 over it, 4.75× 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: op_figma::instance::apply_instance_overrides_cached crates/op-figma/src/instance.rs:102— FunctionTooLong — op_figma::instance::apply_instance_overrides_cached runs 435 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 335 over it, 4.35× 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: op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118— FunctionTooLong — op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner runs 375 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 275 over it, 3.75× 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: op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:21— FunctionTooLong — op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit runs 369 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× 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: op_host_web::canvaskit::mount::mount_ck crates/op-host-web/src/canvaskit/mount.rs:14— FunctionTooLong — op_host_web::canvaskit::mount::mount_ck runs 345 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 245 over it, 3.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_ck_bridge.opCkInit crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:28— FunctionTooLong — opCkInit runs 344 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 244 over it, 3.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.
FunctionTooLong: op_editor_ui::widgets::home_surface_layout::layout_for_scrolled crates/op-editor-ui/src/widgets/home_surface_layout.rs:190— FunctionTooLong — op_editor_ui::widgets::home_surface_layout::layout_for_scrolled runs 333 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 233 over it, 3.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes crates/op-orchestrator/src/prompt_subagent.rs:148— FunctionTooLong — op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes runs 307 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_services::web_canvas_server::connection::dispatch crates/op-host-services/src/web_canvas_server/connection.rs:101— FunctionTooLong — op_host_services::web_canvas_server::connection::dispatch runs 294 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 194 over it, 2.94× 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: op_smoke::main crates/op-smoke/src/main.rs:214— FunctionTooLong — op_smoke::main runs 289 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× 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: op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker crates/op-editor-ui/src/widgets/property_panel_layout.rs:213— FunctionTooLong — op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker runs 273 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 173 over it, 2.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::ai_chat_transcript::build_item crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:178— FunctionTooLong — op_editor_ui::widgets::ai_chat_transcript::build_item runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::home_surface_paint_panels::paint_composer crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:31— FunctionTooLong — op_editor_ui::widgets::home_surface_paint_panels::paint_composer runs 266 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: op_editor_ui::widgets::property_panel_fill_body::paint_fill_gradient_body crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:140— FunctionTooLong — op_editor_ui::widgets::property_panel_fill_body::paint_fill_gradient_body runs 248 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_services::chat_http_server::run_opencode_turn crates/op-host-services/src/chat_http_server.rs:246— FunctionTooLong — op_host_services::chat_http_server::run_opencode_turn runs 240 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_orchestrator::validation_fixes_apply::apply_validation_fixes crates/op-orchestrator/src/validation_fixes_apply.rs:66— FunctionTooLong — op_orchestrator::validation_fixes_apply::apply_validation_fixes runs 236 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× 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: op_editor_ui::widgets::property_panel_input_layout::editable_input_rects crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:53— FunctionTooLong — op_editor_ui::widgets::property_panel_input_layout::editable_input_rects runs 233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::property_panel_fill::paint_one_fill crates/op-editor-ui/src/widgets/property_panel_fill.rs:358— FunctionTooLong — op_editor_ui::widgets::property_panel_fill::paint_one_fill runs 231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_mcp::batch_layered_guidelines::generate_section_guidelines crates/op-mcp/src/batch_layered_guidelines.rs:7— FunctionTooLong — op_mcp::batch_layered_guidelines::generate_section_guidelines runs 229 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 129 over it, 2.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_ck_image_cache.createWebImageCaches crates/op-host-web/src/op_ck_image_cache.js:91— FunctionTooLong — createWebImageCaches runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::home_surface_paint_art::paint_counter_window crates/op-editor-ui/src/widgets/home_surface_paint_art.rs:281— FunctionTooLong — op_editor_ui::widgets::home_surface_paint_art::paint_counter_window runs 213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_collab_relay_server::connection::serve_connection crates/op-collab-relay-server/src/connection.rs:92— FunctionTooLong — op_collab_relay_server::connection::serve_connection runs 212 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
op_orchestrator::validation_fixes_apply::apply_validation_fixes (cognitive 124) crates/op-orchestrator/src/validation_fixes_apply.rs:66— op_orchestrator::validation_fixes_apply::apply_validation_fixes has cognitive complexity 124 (threshold 15). Drivers by points: if/else 47 (116 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::cleanup_equalize_siblings::plan_family_repairs (cognitive 97) crates/op-orchestrator/src/cleanup_equalize_siblings.rs:237— op_orchestrator::cleanup_equalize_siblings::plan_family_repairs has cognitive complexity 97 (threshold 15). Drivers by points: if/else 24 (57 pts), loops 16 (31 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::geometry_row_fixes::collect_row_overfull_fixes_with_context (cognitive 65) crates/op-orchestrator/src/geometry_row_fixes.rs:313— op_orchestrator::geometry_row_fixes::collect_row_overfull_fixes_with_context has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (55 pts), boolean chains 9, loops 1 (nesting depth added 40). 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.
op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context (cognitive 58) crates/op-orchestrator/src/geometry_diagnostics_collect.rs:126— op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (40 pts), boolean chains 7, loops 3 (6 pts), match/switch 1 (5 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast (cognitive 53) crates/op-orchestrator/src/role_post_pass/contrast.rs:6— op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (47 pts), match/switch 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::subtask_completeness::expected_item_count (cognitive 52) crates/op-orchestrator/src/subtask_completeness.rs:25— op_orchestrator::subtask_completeness::expected_item_count has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (43 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::spacing_repair::strip_in_value (cognitive 49) crates/op-orchestrator/src/spacing_repair.rs:94— op_orchestrator::spacing_repair::strip_in_value has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (32 pts), boolean chains 12, loops 2 (5 pts) (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.
op_orchestrator::loop_finalize_record::record_same_id_shallow_patches (cognitive 49) crates/op-orchestrator/src/loop_finalize_record.rs:219— op_orchestrator::loop_finalize_record::record_same_id_shallow_patches has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 7 (9 pts), boolean chains 6 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor (cognitive 45) crates/op-orchestrator/src/cleanup_slide_padding.rs:106— op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 7, match/switch 2 (5 pts), loops 1 (2 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.
op_orchestrator::geometry_overflow_fixes::collect_text_overflow_fixes_with_context (cognitive 43) crates/op-orchestrator/src/geometry_overflow_fixes.rs:124— op_orchestrator::geometry_overflow_fixes::collect_text_overflow_fixes_with_context has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (33 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 24). 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.
op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes (cognitive 42) crates/op-orchestrator/src/prompt_subagent.rs:148— op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes has cognitive complexity 42 (threshold 15). Drivers by points: if/else 29 (33 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_orchestrator::role_post_pass::micro_surface_radius::round_missing_semantic_micro_surfaces (cognitive 40) crates/op-orchestrator/src/role_post_pass/micro_surface_radius.rs:203— op_orchestrator::role_post_pass::micro_surface_radius::round_missing_semantic_micro_surfaces has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 14, loops 1 (2 pts) (nesting depth added 14). 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.
op_orchestrator::plan_normalize::normalize (cognitive 39) crates/op-orchestrator/src/plan_normalize.rs:109— op_orchestrator::plan_normalize::normalize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 5 (10 pts), boolean chains 4 (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.
op_orchestrator::mobile_content_rail::collect_repairs (cognitive 38) crates/op-orchestrator/src/mobile_content_rail.rs:295— op_orchestrator::mobile_content_rail::collect_repairs has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::loop_finalize::fix_theme_variable_polarity (cognitive 37) crates/op-orchestrator/src/loop_finalize.rs:230— op_orchestrator::loop_finalize::fix_theme_variable_polarity has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 2, 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.
op_orchestrator::geometry_overflow_fixes::collect_frame_overflow_fixes_with_context (cognitive 37) crates/op-orchestrator/src/geometry_overflow_fixes.rs:286— op_orchestrator::geometry_overflow_fixes::collect_frame_overflow_fixes_with_context has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (27 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::plan_coverage::required_sections (cognitive 37) crates/op-orchestrator/src/plan_coverage.rs:83— op_orchestrator::plan_coverage::required_sections has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 5 (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.
op_orchestrator::radial_repair::radial_stack_repair (cognitive 35) crates/op-orchestrator/src/radial_repair.rs:489— op_orchestrator::radial_repair::radial_stack_repair has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 9, loops 1 (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.
op_orchestrator::concurrent::run_subtask_retry_ladder_with_outcomes (cognitive 33) crates/op-orchestrator/src/concurrent.rs:189— op_orchestrator::concurrent::run_subtask_retry_ladder_with_outcomes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 11 (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.
op_orchestrator::cleanup_section_margins::unify_transparent_section_margins (cognitive 33) crates/op-orchestrator/src/cleanup_section_margins.rs:62— op_orchestrator::cleanup_section_margins::unify_transparent_section_margins has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 4, boolean chains 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.
op_orchestrator::hero_bleed::enforce (cognitive 32) crates/op-orchestrator/src/hero_bleed.rs:16— op_orchestrator::hero_bleed::enforce has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (26 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::style_guide_context::infer_tags_from_prompt (cognitive 31) crates/op-orchestrator/src/style_guide_context.rs:25— op_orchestrator::style_guide_context::infer_tags_from_prompt has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, boolean chains 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.
op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes (cognitive 31) crates/op-orchestrator/src/subagent.rs:118— op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 4 (7 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::tree_heuristics_image_overlay::fix_notification_badge_overlay (cognitive 31) crates/op-orchestrator/src/tree_heuristics_image_overlay.rs:119— op_orchestrator::tree_heuristics_image_overlay::fix_notification_badge_overlay has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (4 pts) (nesting depth added 19). 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.
op_orchestrator::geometry_card_rail_fixes::collect_rail_width_collapse_fixes_with_context (cognitive 31) crates/op-orchestrator/src/geometry_card_rail_fixes.rs:126— op_orchestrator::geometry_card_rail_fixes::collect_rail_width_collapse_fixes_with_context has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), boolean chains 4, loops 2 (4 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.
MethodTooLong: EditorState.apply_with_allocator crates/op-editor-core/src/command_apply.rs:55— MethodTooLong — apply_with_allocator runs 578 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 478 over it, 5.78× 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: WidgetHost.apply_cursor_move crates/op-host-web/src/widget_host/cursor_input.rs:17— MethodTooLong — apply_cursor_move runs 518 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 418 over it, 5.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CollabPanel.paint crates/op-editor-ui/src/widgets/collab_panel.rs:122— MethodTooLong — paint runs 422 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 322 over it, 4.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.paint crates/op-host-native/src/widget_host/paint.rs:19— MethodTooLong — paint runs 415 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 315 over it, 4.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Orchestrator.run crates/op-orchestrator/src/run_orchestrator.rs:23— MethodTooLong — run runs 411 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 311 over it, 4.11× 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: PropertyPanel.paint crates/op-editor-ui/src/widgets/property_panel/paint.rs:31— MethodTooLong — paint runs 398 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 298 over it, 3.98× 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: WidgetHostNative.update_agent_settings_hover crates/op-host-native/src/widget_host/geometry_settings_hover.rs:12— MethodTooLong — update_agent_settings_hover runs 365 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TopBar.paint_chrome crates/op-editor-ui/src/widgets/top_bar_paint.rs:17— MethodTooLong — paint_chrome runs 325 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 225 over it, 3.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.dispatch_git_panel_press crates/op-host-native/src/widget_host/git_press.rs:26— MethodTooLong — dispatch_git_panel_press runs 312 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 212 over it, 3.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHost.paint_editor crates/op-host-web/src/widget_host/paint.rs:49— MethodTooLong — paint_editor runs 309 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesktopApp.on_redraw_requested crates/op-host-desktop/src/app_handler/redraw.rs:35— MethodTooLong — on_redraw_requested runs 305 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 205 over it, 3.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHost.update_agent_settings_hover crates/op-host-web/src/widget_host/agent_settings_hover.rs:14— MethodTooLong — update_agent_settings_hover runs 299 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 199 over it, 2.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayerPanel.paint crates/op-editor-ui/src/widgets/layer_panel.rs:394— MethodTooLong — paint runs 298 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× 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: CanvasViewport.paint crates/op-editor-ui/src/widgets/canvas_viewport.rs:165— MethodTooLong — paint runs 280 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 180 over it, 2.80× 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: GitPanel.paint crates/op-editor-ui/src/widgets/git_panel/paint.rs:12— MethodTooLong — paint runs 256 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 156 over it, 2.56× 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: EditorState.commit_property_edit_inner crates/op-editor-core/src/property_edit_mutators.rs:69— MethodTooLong — commit_property_edit_inner runs 253 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× 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: WidgetHostNative.apply_escape crates/op-host-native/src/widget_host/keyboard_escape.rs:13— MethodTooLong — apply_escape runs 248 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesktopApp.handle_key_pressed crates/op-host-desktop/src/keyboard_input.rs:15— MethodTooLong — handle_key_pressed runs 245 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AIChatPlaceholder.paint crates/op-editor-ui/src/widgets/ai_chat_panel/widget_paint.rs:23— MethodTooLong — paint runs 231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EditorUiState.default crates/op-editor-core/src/editor_ui_state/defaults.rs:16— MethodTooLong — default runs 222 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesktopApp.drain_git_action crates/op-host-desktop/src/git_host.rs:166— MethodTooLong — drain_git_action runs 209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OwnerSessionCore.handle_undo_request crates/op-collab/src/session_undo.rs:77— MethodTooLong — handle_undo_request runs 205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AIChatPlaceholder.hit_test_with_canonical crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:60— MethodTooLong — hit_test_with_canonical runs 204 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.cursor_move_late_drag_tiers crates/op-host-native/src/widget_host/cursor_move_drags.rs:52— MethodTooLong — cursor_move_late_drag_tiers runs 198 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× 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: WidgetHost.apply_overlay_cursor_move crates/op-host-web/src/widget_host/overlay_cursor.rs:96— MethodTooLong — apply_overlay_cursor_move runs 189 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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.
op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cognitive 177) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118— op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner has cognitive complexity 177 (threshold 15). Drivers by points: if/else 85 (149 pts), boolean chains 17, match/switch 6 (8 pts), loops 1 (3 pts) (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch (cognitive 122) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:117— op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch has cognitive complexity 122 (threshold 15). Drivers by points: if/else 42 (107 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 68). 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.
op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit (cognitive 82) crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:21— op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit has cognitive complexity 82 (threshold 15). Drivers by points: if/else 32 (67 pts), match/switch 8 (13 pts), boolean chains 2 (nesting depth added 40). 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.
op_editor_ui::widgets::property_panel_input_layout::editable_input_rects (cognitive 63) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:53— op_editor_ui::widgets::property_panel_input_layout::editable_input_rects has cognitive complexity 63 (threshold 15). Drivers by points: if/else 32 (47 pts), loops 3 (7 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker (cognitive 62) crates/op-editor-ui/src/widgets/property_panel_layout.rs:213— op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker has cognitive complexity 62 (threshold 15). Drivers by points: if/else 34 (49 pts), loops 4 (11 pts), boolean chains 2 (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.
op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection (cognitive 59) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:608— op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 5 (12 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 35). 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.
op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit (cognitive 58) crates/op-editor-ui/src/widgets/ai_chat_transcript_hit.rs:22— op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 6 (13 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::home_surface_paint_panels::paint_composer (cognitive 56) crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:31— op_editor_ui::widgets::home_surface_paint_panels::paint_composer has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (47 pts), loops 4 (7 pts), boolean chains 2 (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.
op_editor_ui::widgets::ai_chat_transcript::build_item (cognitive 56) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:178— op_editor_ui::widgets::ai_chat_transcript::build_item has cognitive complexity 56 (threshold 15). Drivers by points: if/else 35 (39 pts), boolean chains 12, loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke (cognitive 51) crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:409— op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (43 pts), boolean chains 8 (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.
op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout (cognitive 47) crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:151— op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (39 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds (cognitive 47) crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:99— op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 3 (5 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::property_panel_code_complete::syntax_tokens (cognitive 45) crates/op-editor-ui/src/widgets/property_panel_code_complete.rs:455— op_editor_ui::widgets::property_panel_code_complete::syntax_tokens has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 5 (13 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth (cognitive 45) crates/op-editor-ui/src/widgets/collab_ui.rs:215— op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 21). 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.
op_editor_ui::widgets::agent_settings_builtin_form::paint_field (cognitive 44) crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:189— op_editor_ui::widgets::agent_settings_builtin_form::paint_field has cognitive complexity 44 (threshold 15). Drivers by points: if/else 31 (37 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
op_editor_ui::widgets::property_panel_dispatch::apply_property_action (cognitive 44) crates/op-editor-ui/src/widgets/property_panel_dispatch.rs:186— op_editor_ui::widgets::property_panel_dispatch::apply_property_action has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (38 pts), match/switch 3 (6 pts) (nesting depth added 21). 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.
op_editor_ui::widgets::property_panel_instance::paint_component_block (cognitive 44) crates/op-editor-ui/src/widgets/property_panel_instance.rs:163— op_editor_ui::widgets::property_panel_instance::paint_component_block has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 23). 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.
op_editor_ui::widgets::canvas_viewport_text::paint_text_node (cognitive 44) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:278— op_editor_ui::widgets::canvas_viewport_text::paint_text_node has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 2 (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.
op_editor_ui::widgets::agent_settings_builtin_model_menu::paint_model_menu (cognitive 42) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:273— op_editor_ui::widgets::agent_settings_builtin_model_menu::paint_model_menu has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::property_panel_typography::font_picker_layout_at_with_density (cognitive 40) crates/op-editor-ui/src/widgets/property_panel_typography.rs:311— op_editor_ui::widgets::property_panel_typography::font_picker_layout_at_with_density has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (32 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::press_flow::apply_layer_panel_click (cognitive 38) crates/op-editor-ui/src/widgets/press_flow.rs:466— op_editor_ui::widgets::press_flow::apply_layer_panel_click has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 19). 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.
op_editor_ui::widgets::property_panel_input_layout::push_fill_action_rects (cognitive 38) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:372— op_editor_ui::widgets::property_panel_input_layout::push_fill_action_rects has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (6 pts), match/switch 1 (2 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.
op_editor_ui::widgets::agent_settings_builtin_parts::paint_preset_menu (cognitive 37) crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:166— op_editor_ui::widgets::agent_settings_builtin_parts::paint_preset_menu has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22 (35 pts), loops 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::property_panel_commit::commit_property_focus (cognitive 33) crates/op-editor-ui/src/widgets/property_panel_commit.rs:281— op_editor_ui::widgets::property_panel_commit::commit_property_focus has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (32 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::home_surface_layout::layout_for_scrolled (cognitive 33) crates/op-editor-ui/src/widgets/home_surface_layout.rs:190— op_editor_ui::widgets::home_surface_layout::layout_for_scrolled has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (26 pts), loops 5, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (8 lines × 2) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:258— crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:258-265 | crates/op-orchestrator/src/role_post_pass/surface_structure.rs:362-369 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/op-collab/src/apply.rs:221— crates/op-collab/src/apply.rs:221-228 | crates/op-collab/src/apply.rs:285-295 — both copies are in the same file, so extract the 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) crates/op-collab-relay-client/src/session.rs:454— crates/op-collab-relay-client/src/session.rs:454-461 | crates/op-collab-relay-client/src/session.rs:473-480 — both copies are in the same file, so extract the 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) crates/op-collab-transport/src/runtime.rs:97— crates/op-collab-transport/src/runtime.rs:97-104 | crates/op-collab-transport/src/runtime.rs:106-113 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/collab_ui_state.rs:169— crates/op-editor-core/src/collab_ui_state.rs:169-176 | crates/op-editor-ui/src/widgets/collab_avatar_paint.rs:16-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/op-editor-core/src/icon_path_normalize.rs:378— crates/op-editor-core/src/icon_path_normalize.rs:378-385 | crates/op-editor-core/src/icon_path_normalize.rs:397-404 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/prompt_center_catalog.rs:290— crates/op-editor-core/src/prompt_center_catalog.rs:290-297 | crates/op-editor-core/src/scene_template_catalog.rs:666-673 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_acp.rs:433— crates/op-editor-ui/src/widgets/agent_settings_acp.rs:433-440 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:693-700 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:320— crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:320-327 | crates/op-orchestrator/src/parse.rs:330-337 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:162— crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:162-169 | crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:430-441 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/layer_context_menu.rs:328— crates/op-editor-ui/src/widgets/layer_context_menu.rs:328-335 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:117-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/mobile_chrome.rs:709— crates/op-editor-ui/src/widgets/mobile_chrome.rs:709-716 | crates/op-editor-ui/src/widgets/mobile_chrome.rs:750-757 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/preview_device_switcher.rs:88— crates/op-editor-ui/src/widgets/preview_device_switcher.rs:88-95 | crates/op-editor-ui/src/widgets/screen_switcher_pills.rs:118-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/property_panel_effects.rs:334— crates/op-editor-ui/src/widgets/property_panel_effects.rs:334-341 | crates/op-editor-ui/src/widgets/property_panel_fill.rs:601-608 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:253— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:253-260 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:480-487 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:44— crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:44-51 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:233-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.
Duplicated block (8 lines × 2) crates/op-engine-ffi/src/desc.rs:348— crates/op-engine-ffi/src/desc.rs:348-355 | crates/op-engine-ffi/src/lifecycle.rs:416-423 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-engine-ffi/src/editor_chat_design.rs:75— crates/op-engine-ffi/src/editor_chat_design.rs:75-82 | crates/op-host-desktop/src/chat_session_launch_design.rs:98-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/op-engine-jni/src/callbacks.rs:62— crates/op-engine-jni/src/callbacks.rs:62-69 | crates/op-engine-napi/src/callbacks.rs:53-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/op-host-desktop/src/mcp_integrations.rs:369— crates/op-host-desktop/src/mcp_integrations.rs:369-376 | crates/op-host-desktop/src/mcp_integrations.rs:430-437 — both copies are in the same file, so extract the 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) crates/op-host-desktop/src/mcp_integrations.rs:488— crates/op-host-desktop/src/mcp_integrations.rs:488-495 | crates/op-host-desktop/src/mcp_integrations.rs:513-520 — both copies are in the same file, so extract the 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) crates/op-host-desktop/src/app_handler/pointer_events.rs:48— crates/op-host-desktop/src/app_handler/pointer_events.rs:48-55 | crates/op-host-desktop/src/app_handler/pointer_events.rs:120-127 — both copies are in the same file, so extract the 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) crates/op-host-native/src/backend/skia/path.rs:208— crates/op-host-native/src/backend/skia/path.rs:208-215 | crates/op-host-native/src/backend/skia/path.rs:233-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.
Duplicated block (8 lines × 2) crates/op-host-native/src/widget_host/canvas_pan_cache.rs:79— crates/op-host-native/src/widget_host/canvas_pan_cache.rs:79-86 | crates/op-host-native/src/widget_host/paint_pan_cache.rs:201-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-host-native/src/widget_host/touch_panel_gesture.rs:53— crates/op-host-native/src/widget_host/touch_panel_gesture.rs:53-60 | crates/op-host-native/src/widget_host/touch_panel_gesture.rs:269-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/op-chat-agent/src/design_agent_diagnostics.rs:167— crates/op-chat-agent/src/design_agent_diagnostics.rs:167-172 | crates/op-design-lint/src/detectors/spacing.rs:232-237 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:387— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:387-392 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:350-355 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/op-chrome-extension-core/src/design_md_validate.rs:110— crates/op-chrome-extension-core/src/design_md_validate.rs:110-115 | crates/op-chrome-extension-core/src/design_md_validate.rs:144-150 — both copies are in the same file, so extract the 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) crates/op-collab-relay-locator-hsm/src/server.rs:159— crates/op-collab-relay-locator-hsm/src/server.rs:159-164 | crates/op-collab-relay-locator-hsm/src/server.rs:186-191 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/component_backing.rs:53— crates/op-editor-core/src/component_backing.rs:53-58 | crates/op-editor-core/src/component_backing.rs:65-70 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/icon_path_normalize.rs:377— crates/op-editor-core/src/icon_path_normalize.rs:377-382 | crates/op-editor-core/src/icon_path_normalize.rs:388-393 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/icon_path_normalize.rs:389— crates/op-editor-core/src/icon_path_normalize.rs:389-394 | crates/op-editor-core/src/icon_path_normalize.rs:407-412 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/icon_path_normalize.rs:396— crates/op-editor-core/src/icon_path_normalize.rs:396-401 | crates/op-editor-core/src/icon_path_normalize.rs:406-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/op-editor-core/src/svg_path_data.rs:357— crates/op-editor-core/src/svg_path_data.rs:357-362 | crates/op-editor-core/src/svg_path_data.rs:364-369 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/fills/access.rs:313— crates/op-editor-core/src/fills/access.rs:313-318 | crates/op-editor-core/src/fills/access.rs:334-339 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/command_font_replace.rs:180— crates/op-editor-core/src/command_font_replace.rs:180-185 | crates/op-editor-core/src/hoist_app_state.rs:55-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/collab_avatar_runtime.rs:470— crates/op-editor-ui/src/collab_avatar_runtime.rs:470-475 | crates/op-editor-ui/src/collab_avatar_runtime.rs:491-496 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:201— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:201-209 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:291-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_press_flow.rs:310— crates/op-editor-ui/src/widgets/agent_settings_press_flow.rs:310-315 | crates/op-editor-ui/src/widgets/missing_fonts_flow.rs:108-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/home_surface_palette.rs:128— crates/op-editor-ui/src/widgets/home_surface_palette.rs:128-133 | crates/op-editor-ui/src/widgets/home_surface_palette.rs:174-179 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/preview_device_switcher.rs:57— crates/op-editor-ui/src/widgets/preview_device_switcher.rs:57-62 | crates/op-editor-ui/src/widgets/screen_switcher_pills.rs:81-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/text_input.rs:105— crates/op-editor-ui/src/widgets/text_input.rs:105-110 | crates/op-editor-ui/src/widgets/text_input.rs:167-172 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:329— crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:329-334 | crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:351-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/property_panel_layout_ops.rs:230— crates/op-editor-ui/src/widgets/property_panel_layout_ops.rs:230-235 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:215-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/canvas_path_overlay.rs:183— crates/op-editor-ui/src/widgets/canvas_path_overlay.rs:183-188 | crates/op-editor-ui/src/widgets/canvas_viewport/overlays.rs:72-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/op-engine-jni/src/callbacks.rs:200— crates/op-engine-jni/src/callbacks.rs:200-205 | crates/op-engine-napi/src/callbacks.rs:143-151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/op-figma/src/instance/swap_filter.rs:36— crates/op-figma/src/instance/swap_filter.rs:36-41 | crates/op-figma/src/instance/swap_filter.rs:42-47 — both copies are in the same file, so extract the 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) crates/op-git/src/merge.rs:136— crates/op-git/src/merge.rs:136-141 | crates/op-git/src/merge.rs:518-523 — both copies are in the same file, so extract the 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) crates/op-host-desktop/src/iconify_host.rs:152— crates/op-host-desktop/src/iconify_host.rs:152-157 | crates/op-host-desktop/src/remote_image_host.rs:128-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/op-host-services/src/web_canvas_server/connection.rs:173— crates/op-host-services/src/web_canvas_server/connection.rs:173-178 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:686-691 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/op-acp/src/client.rs:656— crates/op-acp/src/client.rs:656-662 | crates/op-collab-relay-client/src/session.rs:35-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/op-ai-skills/src/budget.rs:187— crates/op-ai-skills/src/budget.rs:187-193 | crates/op-ai-skills/src/budget.rs:239-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:369— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:369-375 | crates/op-orchestrator/src/finalize_enforce_status_bar.rs:262-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/op-cli/src/command_mappers.rs:199— crates/op-cli/src/command_mappers.rs:199-205 | crates/op-cli/src/command_mappers.rs:316-322 — both copies are in the same file, so extract the 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) crates/op-codegen/src/codegen_html.rs:41— crates/op-codegen/src/codegen_html.rs:41-47 | crates/op-codegen/src/codegen_targets.rs:295-301 — before extracting anything, compare `crates/op-codegen/src/codegen_html.rs` and `crates/op-codegen/src/codegen_targets.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/op-codegen/src/codegen_html.rs:110— crates/op-codegen/src/codegen_html.rs:110-116 | crates/op-codegen/src/codegen_targets.rs:359-365 — before extracting anything, compare `crates/op-codegen/src/codegen_html.rs` and `crates/op-codegen/src/codegen_targets.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/op-collab-host/src/runtime/network/guest.rs:218— crates/op-collab-host/src/runtime/network/guest.rs:218-224 | crates/op-collab-host/src/runtime/network/owner.rs:80-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/op-collab-relay-client/src/session.rs:79— crates/op-collab-relay-client/src/session.rs:79-85 | crates/op-collab-relay-client/src/session.rs:89-95 — both copies are in the same file, so extract the 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) crates/op-collab-smoke/src/fault_guest.rs:49— crates/op-collab-smoke/src/fault_guest.rs:49-55 | crates/op-collab-smoke/src/fault_guest.rs:184-190 — both copies are in the same file, so extract the 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) crates/op-design-lint/src/node_util.rs:576— crates/op-design-lint/src/node_util.rs:576-582 | crates/op-orchestrator/src/validation_dump.rs:327-333 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/op-editor-core/src/instance_override.rs:142— crates/op-editor-core/src/instance_override.rs:142-148 | crates/op-editor-core/src/ref_resolve.rs:281-287 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:130— crates/op-editor-core/src/svg_import/path_data.rs:130-136 | crates/op-editor-core/src/svg_import/path_data.rs:144-150 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/svg_import/path_data.rs:154— crates/op-editor-core/src/svg_import/path_data.rs:154-160 | crates/op-editor-core/src/svg_import/path_data.rs:168-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/op-editor-core/src/svg_path_data.rs:233— crates/op-editor-core/src/svg_path_data.rs:233-239 | crates/op-editor-core/src/svg_path_data.rs:244-250 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/export_dialog.rs:305— crates/op-editor-ui/src/widgets/export_dialog.rs:305-311 | crates/op-editor-ui/src/widgets/save_name_dialog.rs:68-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/layer_context_menu.rs:248— crates/op-editor-ui/src/widgets/layer_context_menu.rs:248-254 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:69-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs:58— crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs:58-64 | crates/op-host-desktop/src/remote_image_host.rs:187-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/property_panel_commit.rs:217— crates/op-editor-ui/src/widgets/property_panel_commit.rs:217-223 | crates/op-editor-ui/src/widgets/property_panel_commit.rs:283-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:64— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:64-70 | crates/op-orchestrator/src/validation_dump.rs:300-306 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/op-engine-ffi/src/editor.rs:276— crates/op-engine-ffi/src/editor.rs:276-282 | crates/op-engine-ffi/src/editor.rs:312-318 — both copies are in the same file, so extract the 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) crates/op-engine-jni/src/bindings_editor.rs:37— crates/op-engine-jni/src/bindings_editor.rs:37-43 | crates/op-engine-jni/src/bindings_editor.rs:319-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/op-git/src/ssh.rs:59— crates/op-git/src/ssh.rs:59-65 | crates/op-git/src/ssh.rs:141-147 — both copies are in the same file, so extract the 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) crates/op-host-native/src/backend/skia/path.rs:723— crates/op-host-native/src/backend/skia/path.rs:723-729 | crates/op-host-native/src/boolean_ops.rs:181-187 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:135— crates/op-host-native/src/widget_host/slides_panel.rs:135-141 | crates/op-host-web/src/widget_host/slides_panel.rs:96-102 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 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) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:183— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:183-189 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:218-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Repeated repair: crates/op-orchestrator/src/cleanup.rs crates/op-orchestrator/src/cleanup.rs:385— crates/op-orchestrator/src/cleanup.rs changed 55 times in last 90 days and 28 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is op_orchestrator::cleanup::run_cleanup_passes_with_summary_and_policy at line 385), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): retry a subtask that promises a list but delivers no items”; “fix(agent): unify style drift across structural twins in a grid”; “fix(agent): shrink single-line text that outgrows its rail instead of clipping it”; “fix(agent): shift a pinned control back inside its parent instead of cropping it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/cleanup.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/chat_intent.rs crates/op-host-services/src/chat_intent.rs:333— crates/op-host-services/src/chat_intent.rs changed 18 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is op_host_services::chat_intent::classify_intent_llm_with_timeout_and_cancel at line 333), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(agent): stabilize design execution (#212)”; “fix(agent): inherit artboards for sibling screen continuations”; “fix(ai): constrain retry replay to failed turns”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_intent.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/role_post_pass.rs crates/op-orchestrator/src/role_post_pass.rs:62— crates/op-orchestrator/src/role_post_pass.rs changed 20 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is op_orchestrator::role_post_pass::post_pass_value at line 62), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): repair passes must prove what they claim to fix”; “fix(agent): close deck opacity and cta corner-radius blind spots”; “fix(agent): round missing corners on badges, pills, avatars and status dots”; “fix(agent): keep nested card roles and rescue near-full-bleed orphan cards”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/role_post_pass.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/scaffold.rs crates/op-orchestrator/src/scaffold.rs:640— crates/op-orchestrator/src/scaffold.rs changed 17 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_orchestrator::scaffold::plan_is_sidebar_dashboard at line 640), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(canvas): attach frame-name labels to the frames they name”; “fix(agent): give wrapped canvas rows headroom for frame labels”; “fix(agent): scaffold a deck's screen roots in one insert”; “fix(agent): give loop-built page roots the planner's section gap”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/scaffold.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-desktop/src/sub_agent_session.rs crates/op-host-desktop/src/sub_agent_session.rs:316— crates/op-host-desktop/src/sub_agent_session.rs changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_host_desktop::sub_agent_session::pump_sub_agents at line 316), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): gate root-seed inheritance on real continuation intent”; “fix(agent): inherit artboards for sibling screen continuations”; “fix(editor): degrade instead of panicking on host failure paths”; “fix(desktop): order chat tool events deterministically”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/sub_agent_session.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/model_discovery.rs crates/op-host-services/src/model_discovery.rs:329— crates/op-host-services/src/model_discovery.rs changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_host_services::model_discovery::extract_json_object at line 329), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): align codex cli and node resolution”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(agent): drop hidden models from the codex app-server list”; “fix(desktop): prefer .exe/.cmd/.bat over extensionless npm shims on Windows (#191)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/model_discovery.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-web/src/vscode_bridge.rs crates/op-host-web/src/vscode_bridge.rs:191— crates/op-host-web/src/vscode_bridge.rs changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is op_host_web::vscode_bridge::route_message at line 191), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web): make bridge init survive slow mounts”; “fix(web): preserve account entry in managed embeds”; “fix(editor): improve import and generation reliability”; “fix(mcp): working clipboard copy and real endpoint on the embed settings card”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-web/src/vscode_bridge.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/model_profile.rs crates/op-orchestrator/src/model_profile.rs:434— crates/op-orchestrator/src/model_profile.rs changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_orchestrator::model_profile::resolve_model_profile at line 434), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): treat the Claude Code CLI model aliases as full-tier models”; “fix(ai): stop sending thinking:disabled to GLM-5.3”; “fix(agent): classify the new builtin preset models for reasoning control”; “fix(agent): preserve Kimi K3 design script output”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/model_profile.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/op-vscode/src/vscode/pen-editor-provider.ts packages/op-vscode/src/vscode/pen-editor-provider.ts:253— packages/op-vscode/src/vscode/pen-editor-provider.ts changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is PenEditorProvider.mountEditor at line 253), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(vscode): shift-tolerant redo, cmd+s save relay, and iframe autofocus”; “fix(vscode): keep-last-active only for the mcp route; registry stays focus-following”; “fix(vscode): 405 for non-POST /mcp and keep-last-active mcp routing”; “fix(mcp): working clipboard copy and real endpoint on the embed settings card”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- packages/op-vscode/src/vscode/pen-editor-provider.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/web_canvas_server/online_run_loop.rs crates/op-host-services/src/web_canvas_server/online_run_loop.rs:128— crates/op-host-services/src/web_canvas_server/online_run_loop.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is op_host_services::web_canvas_server::online_run_loop::run_online_web_canvas at line 128), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web): gate unix-only signal + test helpers off the windows build”; “fix(web): request-time epoch snapshots, AI write admission, drain without ceiling”; “fix(web): make the identity reset claims real and cover /mcp in the write barrier”; “fix(web): credential partition hygiene, shutdown write barrier, seed lifecycle”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server/online_run_loop.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/chat_spawn.rs crates/op-host-services/src/chat_spawn.rs:420— crates/op-host-services/src/chat_spawn.rs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is op_host_services::chat_spawn::well_known_install_paths at line 420), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): align codex cli and node resolution”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(agent): keep a customised process PATH ahead of the login shell”; “fix(host): gate login shell probe on windows”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_spawn.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-smoke/src/llm_clients.rs crates/op-smoke/src/llm_clients.rs:65— crates/op-smoke/src/llm_clients.rs changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is SmokeLlmClient::call at line 65), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): ride out provider 429s in the headless smoke client”; “fix(agent): cap the whole non-streaming provider call in op-smoke”; “fix(cli): scale op-smoke's read-idle timeout by the model profile”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-smoke/src/llm_clients.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:473— crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is op_editor_ui::widgets::canvas_viewport_overlay::wrap_segment at line 473), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web): render cached CanvasKit shader fills”; “fix(canvas): keep container stroke above children when painting”; “fix(editor): improve import and generation reliability”; “fix(renderer): per-corner radii reach every FILL path”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/provider_probe.rs crates/op-host-services/src/provider_probe.rs:159— crates/op-host-services/src/provider_probe.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is op_host_services::provider_probe::install_command_for_platform at line 159), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): align codex cli and node resolution”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(agent): update winget package name from GitHub.CopilotCLI to GitHub.Copilot (#193)”; “fix(agent): surface the cli's own error instead of 'not responding'”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/provider_probe.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-html/src/snapshot.rs crates/op-html/src/snapshot.rs:57— crates/op-html/src/snapshot.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is SnapshotError::fmt at line 57), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(html): improve structured import style fidelity”; “fix(html): raise the snapshot capture budget to 40k nodes and 48 MiB”; “fix(html): make web-snapshot text, icon and layout capture faithful”; “fix(html): fold inline-flow blocks into one styled snapshot text node”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-html/src/snapshot.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-mcp/src/batch_design_result.rs crates/op-mcp/src/batch_design_result.rs:115— crates/op-mcp/src/batch_design_result.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is BatchDesign::insert_with_result at line 115), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): degrade instead of panicking on host failure paths”; “fix(mcp): harden batch design and image semantics”; “fix(mcp): an empty input slot is not a competing input”; “merge: sync mesh/shader rendering, web live-sync and platform fixes from remote”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-mcp/src/batch_design_result.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-desktop/src/image_panel_host.rs crates/op-host-desktop/src/image_panel_host.rs:240— crates/op-host-desktop/src/image_panel_host.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is op_host_desktop::image_panel_host::asset_status at line 240), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(editor): async hygiene — safe block_on, bounded acp channels, thread teardown”; “fix(panels): make image popover inputs fully editable”; “fix(editor): embed relinked images and warn on machine-local links”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/image_panel_host.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/chat_subprocess_quirks.rs crates/op-host-services/src/chat_subprocess_quirks.rs:308— crates/op-host-services/src/chat_subprocess_quirks.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is op_host_services::chat_subprocess_quirks::extract_codex_cli_error at line 308), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): match the Codex env allowlist case-insensitively (#232)”; “fix(agent): deflake the subprocess, http-server, and probe tests”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(services): carry cli output into failures as bounded redacted tails”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_subprocess_quirks.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/chat_provider_llm.rs crates/op-host-services/src/chat_provider_llm.rs:62— crates/op-host-services/src/chat_provider_llm.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ChatProviderLlmClient::call at line 62), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(agent): stabilize design execution (#212)”; “fix(agent): default ACP agents to basic capability tier”; “fix(editor): finish block_on_anywhere rollout and narrow design-ack snapshots”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_provider_llm.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/run_tests_screen_groups.rs crates/op-orchestrator/src/run_tests_screen_groups.rs:79— crates/op-orchestrator/src/run_tests_screen_groups.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is op_orchestrator::run_tests_screen_groups::contains_text at line 79), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): inherit artboards for sibling screen continuations”; “fix(agent): backfill generated screen interactions”; “fix(agent): recover rejected radial sections”; “fix(agent): parallelize scoped continuation screens”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/run_tests_screen_groups.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-native/src/widget_host/font_picker_dispatch.rs crates/op-host-native/src/widget_host/font_picker_dispatch.rs:320— crates/op-host-native/src/widget_host/font_picker_dispatch.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is WidgetHostNative::update_font_picker_hover at line 320), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): resolve native font availability through FontMgr”; “fix(editor): polish mobile and tablet players”; “fix(editor): align the font picker's wheel direction with every other list”; “fix(editor): improve import and generation reliability”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/font_picker_dispatch.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/chat_subprocess_safety.rs crates/op-host-services/src/chat_subprocess_safety.rs:178— crates/op-host-services/src/chat_subprocess_safety.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is IsolatedTurn::prepare_for at line 178), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): keep the natively-cased Windows vars for guarded CLIs (#233)”; “fix(ai): carry the CLI's own logged cause into the failure”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(services): carry cli output into failures as bounded redacted tails”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_subprocess_safety.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/cleanup_mobile_chrome.rs crates/op-orchestrator/src/cleanup_mobile_chrome.rs:659— crates/op-orchestrator/src/cleanup_mobile_chrome.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is op_orchestrator::cleanup_mobile_chrome::is_pencil_trailing_tab_section at line 659), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): normalise the tab row, not the wrapper that stacks it over the home indicator”; “fix(agent): harden generated mobile geometry”; “fix(agent): harden mobile rail edge cases”; “fix(agent): enforce mobile content rails”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/cleanup_mobile_chrome.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-image-enrich/src/net/providers.rs crates/op-image-enrich/src/net/providers.rs:313— crates/op-image-enrich/src/net/providers.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is op_image_enrich::net::providers::run_first_search_with_judge at line 313), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): surface openverse failures instead of a silent zero-candidate round”; “fix(agent): rewrite the search query once before the judged ladder falls to Wikimedia”; “fix(ai): route the first-search image client through rustls”; “fix(ai): embed only renderer-decodable stock images and soften isolation fence”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-image-enrich/src/net/providers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-web/src/web_fonts.rs crates/op-host-web/src/web_fonts.rs:305— crates/op-host-web/src/web_fonts.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is op_host_web::web_fonts::request_font_bytes at line 305), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): resolve native font availability through FontMgr”; “fix(editor): alias Microsoft YaHei and YaHei UI as one family (#216)”; “fix(editor): improve import and generation reliability”; “fix(web): rebuild layout scene on system-font load too”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 15:25:11 +08:00' --until='2026-09-22 15:25:11 +08:00' --full-history --no-merges -- crates/op-host-web/src/web_fonts.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (10 lines × 2) crates/op-auth-bridge/src/real_collab_ticket.rs:89— crates/op-auth-bridge/src/real_collab_ticket.rs:89-98 | crates/op-auth-bridge/src/real_collab_ticket.rs:123-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:310— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:310-319 | crates/op-chat-agent/src/design_agent_tools/root_seed.rs:337-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-chrome-extension-core/src/design_md_palette.rs:245— crates/op-chrome-extension-core/src/design_md_palette.rs:245-254 | crates/op-host-services/src/design_md_evidence_normalize.rs:98-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-collab-transport/src/admission.rs:142— crates/op-collab-transport/src/admission.rs:142-151 | crates/op-collab/src/protocol.rs:120-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:132— crates/op-collab-host/src/runtime/network/connection.rs:132-141 | crates/op-collab-host/src/runtime/network/connection.rs:302-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-collab-relay-locator-hsm/src/server.rs:282— crates/op-collab-relay-locator-hsm/src/server.rs:282-291 | crates/op-collab-relay-locator-server/src/hsm.rs:261-270 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-collab-relay-server/src/connection_reauth.rs:251— crates/op-collab-relay-server/src/connection_reauth.rs:251-260 | crates/op-collab-relay-server/src/connection_reauth.rs:295-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:341— crates/op-collab-smoke/src/fault_guest.rs:341-350 | crates/op-collab-smoke/src/fault_owner.rs:397-406 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/op-collab-smoke/src/fault_transport.rs:53— crates/op-collab-smoke/src/fault_transport.rs:53-62 | crates/op-collab-smoke/src/owner.rs:84-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/op-collab-smoke/src/fault_transport.rs:81— crates/op-collab-smoke/src/fault_transport.rs:81-90 | crates/op-collab-smoke/src/guest.rs:33-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/op-editor-core/src/icon_path_normalize.rs:489— crates/op-editor-core/src/icon_path_normalize.rs:489-498 | crates/op-editor-core/src/icon_path_normalize.rs:513-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-editor-core/src/mutators.rs:550— crates/op-editor-core/src/mutators.rs:550-559 | crates/op-editor-core/src/mutators.rs:576-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-editor-core/src/conversion.rs:203— crates/op-editor-core/src/conversion.rs:203-212 | crates/op-editor-core/src/conversion.rs:238-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-editor-core/src/color_picker_snapshot.rs:27— crates/op-editor-core/src/color_picker_snapshot.rs:27-36 | crates/op-editor-ui/src/widgets/variables_panel.rs:329-338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-editor-core/src/fills/edits.rs:156— crates/op-editor-core/src/fills/edits.rs:156-165 | crates/op-editor-core/src/fills/primary.rs:154-163 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/svg_export.rs:538— crates/op-editor-ui/src/svg_export.rs:538-547 | crates/op-host-native/src/backend/skia/path.rs:736-745 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_account.rs:138— crates/op-editor-ui/src/widgets/agent_settings_account.rs:138-148 | crates/op-editor-ui/src/widgets/agent_settings_account.rs:208-217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/toolbar.rs:206— crates/op-editor-ui/src/widgets/toolbar.rs:206-215 | crates/op-editor-ui/src/widgets/toolbar.rs: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.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:248— crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:248-257 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:598-607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:175— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:175-184 | crates/op-editor-ui/src/widgets/variables_panel/paint.rs:671-680 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-engine-jni/src/bindings.rs:204— crates/op-engine-jni/src/bindings.rs:204-213 | crates/op-engine-napi/src/bindings.rs:216-225 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-figma/src/instance.rs:121— crates/op-figma/src/instance.rs:121-130 | crates/op-figma/src/instance.rs:131-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-host-desktop/src/image_panel_host.rs:215— crates/op-host-desktop/src/image_panel_host.rs:215-224 | crates/op-host-web/src/web_image_panel.rs:264-273 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-host-desktop/src/design_session_workers.rs:529— crates/op-host-desktop/src/design_session_workers.rs:529-538 | crates/op-host-desktop/src/design_session_workers.rs:547-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-host-native/src/backend/skia.rs:37— crates/op-host-native/src/backend/skia.rs:37-46 | crates/op-host-native/src/backend/skia/image.rs:29-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
FileTooLong: src/op_ck_bridge.js crates/op-host-web/src/op_ck_bridge.js— FileTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 85% of them inside a single declaration: opCkInit (308-1931). The bar is 500 significant lines; this is 867 over it, 2.73× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: pkg-webgl/op_host_web.js crates/op-host-web/pkg-webgl/op_host_web.js— FileTooLong — 1248 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: __wbg_get_imports (66-1338). The bar is 500 significant lines; this is 748 over it, 2.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: pkg-ck/op_host_web.js crates/op-host-web/pkg-ck/op_host_web.js— FileTooLong — 910 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: __wbg_get_imports (31-892). The bar is 500 significant lines; this is 410 over it, 1.82× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: assets/snapshot-extractor.js crates/op-html/assets/snapshot-extractor.js— FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 254 over it, 1.51× 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: src/fault_owner.rs crates/op-collab-smoke/src/fault_owner.rs— FileTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 147 over it, 1.29× 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: src/design_md_evidence.rs crates/op-host-services/src/design_md_evidence.rs— FileTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 101 over it, 1.20× 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: src/command_apply.rs crates/op-editor-core/src/command_apply.rs— FileTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: EditorState (49-798). The bar is 500 significant lines; this is 97 over it, 1.19× 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: variables_panel/paint.rs crates/op-editor-ui/src/widgets/variables_panel/paint.rs— FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 95 over it, 1.19× 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: agent_settings_images/paint.rs crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs— FileTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 94 over it, 1.19× 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: widgets/property_panel_text.rs crates/op-editor-ui/src/widgets/property_panel_text.rs— FileTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 90 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/runtime.rs crates/op-collab-host/src/runtime.rs— FileTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 90% of them inside a single declaration: CollabRuntime (3 blocks, 72-799). The bar is 500 significant lines; this is 82 over it, 1.16× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: widgets/agent_settings_builtin.rs crates/op-editor-ui/src/widgets/agent_settings_builtin.rs— FileTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 82 over it, 1.16× 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: src/converters.rs crates/op-figma/src/converters.rs— FileTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 80 over it, 1.16× 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: src/web_chat_standard.rs crates/op-host-services/src/web_chat_standard.rs— FileTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 79 over it, 1.16× 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: widgets/workspace_surface_paint.rs crates/op-editor-ui/src/widgets/workspace_surface_paint.rs— FileTooLong — 576 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 76 over it, 1.15× 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: src/mapper_visual.rs crates/op-html/src/mapper_visual.rs— FileTooLong — 575 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 75 over it, 1.15× 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: css/declarations.rs crates/op-html/src/css/declarations.rs— FileTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 71 over it, 1.14× 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: canvaskit/backend.rs crates/op-host-web/src/canvaskit/backend.rs— FileTooLong — 568 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: CanvasKitBackend (2 blocks, 24-716). The bar is 500 significant lines; this is 68 over it, 1.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: widgets/property_panel_dispatch.rs crates/op-editor-ui/src/widgets/property_panel_dispatch.rs— FileTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 66 over it, 1.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: widgets/icons.rs crates/op-editor-ui/src/widgets/icons.rs— FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: Icon (2 blocks, 33-608). The bar is 500 significant lines; this is 62 over it, 1.12× 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: mcp_live/design_md_route.rs crates/op-host-services/src/mcp_live/design_md_route.rs— FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 62 over it, 1.12× 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: widgets/agent_settings_acp.rs crates/op-editor-ui/src/widgets/agent_settings_acp.rs— FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 58 over it, 1.12× 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: widgets/property_panel_sections.rs crates/op-editor-ui/src/widgets/property_panel_sections.rs— FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 58 over it, 1.12× 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: runtime/relay.rs crates/op-collab-host/src/runtime/relay.rs— FileTooLong — 557 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 57 over it, 1.11× 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: src/codec.rs crates/op-collab/src/codec.rs— FileTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 56 over it, 1.11× 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.
Duplicated block (5 lines × 2) crates/op-acp/src/client.rs:117— crates/op-acp/src/client.rs:117-121 | crates/op-acp/src/client.rs:698-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-chat-agent/src/chat_agent_loop.rs:407— crates/op-chat-agent/src/chat_agent_loop.rs:407-411 | crates/op-host-services/src/chat_builtin_http_wire.rs:44-48 — 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) crates/op-chat-agent/src/chat_agent_loop/openai.rs:58— crates/op-chat-agent/src/chat_agent_loop/openai.rs:58-62 | crates/op-engine-ffi/src/editor_chat_turn.rs:142-146 — 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) crates/op-collab/src/apply_tree.rs:345— crates/op-collab/src/apply_tree.rs:345-349 | crates/op-orchestrator/src/validation_dump.rs:188-192 — 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) crates/op-collab-relay-server/src/server.rs:135— crates/op-collab-relay-server/src/server.rs:135-139 | crates/op-host-services/src/mcp_live/connection.rs:59-63 — 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) crates/op-design-lint/src/detectors/spacing.rs:82— crates/op-design-lint/src/detectors/spacing.rs:82-86 | crates/op-design-lint/src/detectors/spacing.rs:90-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-design-lint/src/node_mut.rs:162— crates/op-design-lint/src/node_mut.rs:162-166 | crates/op-figma/src/layout_positioning.rs:106-110 — 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) crates/op-editor-core/src/icon_path_normalize.rs:371— crates/op-editor-core/src/icon_path_normalize.rs:371-375 | crates/op-editor-core/src/icon_path_normalize.rs:391-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-core/src/conversion.rs:91— crates/op-editor-core/src/conversion.rs:91-95 | crates/op-editor-core/src/conversion.rs:161-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-core/src/property_edit_mutators.rs:557— crates/op-editor-core/src/property_edit_mutators.rs:557-561 | crates/op-editor-core/src/property_edit_mutators.rs:582-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-core/src/color_picker.rs:479— crates/op-editor-core/src/color_picker.rs:479-483 | crates/op-editor-core/src/color_picker.rs:485-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-core/src/path_bounds.rs:47— crates/op-editor-core/src/path_bounds.rs:47-51 | crates/op-editor-core/src/path_bounds.rs:53-57 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/scene_bounds.rs:75— crates/op-editor-ui/src/scene_bounds.rs:75-79 | crates/op-editor-ui/src/svg_export/transform.rs:168-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_account.rs:282— crates/op-editor-ui/src/widgets/agent_settings_account.rs:282-286 | crates/op-editor-ui/src/widgets/login_modal.rs:170-174 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_acp.rs:551— crates/op-editor-ui/src/widgets/agent_settings_acp.rs:551-555 | crates/op-editor-ui/src/widgets/agent_settings_press_focus.rs:119-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/canvas_collab_presence.rs:145— crates/op-editor-ui/src/widgets/canvas_collab_presence.rs:145-149 | crates/op-editor-ui/src/widgets/collab_avatar_paint.rs:93-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/home_surface_palette.rs:90— crates/op-editor-ui/src/widgets/home_surface_palette.rs:90-94 | crates/op-editor-ui/src/widgets/home_surface_palette.rs:136-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/property_panel.rs:424— crates/op-editor-ui/src/widgets/property_panel.rs:424-428 | crates/op-editor-ui/src/widgets/property_panel.rs:471-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:178— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:178-182 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:215-219 — 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) crates/op-editor-ui/src/widgets/missing_fonts_flow.rs:58— crates/op-editor-ui/src/widgets/missing_fonts_flow.rs:58-62 | crates/op-host-native/src/widget_host/font_picker_dispatch.rs:402-406 — 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) crates/op-engine-ffi/src/editor_chat.rs:372— crates/op-engine-ffi/src/editor_chat.rs:372-376 | crates/op-host-desktop/src/chat_session.rs:291-295 — before extracting anything, compare `crates/op-engine-ffi/src/editor_chat.rs` and `crates/op-host-desktop/src/chat_session.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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) crates/op-engine-jni/src/callbacks.rs:104— crates/op-engine-jni/src/callbacks.rs:104-111 | crates/op-engine-jni/src/callbacks.rs:133-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-figma/src/node_mapper.rs:116— crates/op-figma/src/node_mapper.rs:116-120 | crates/op-figma/src/node_mapper.rs:282-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-figma/src/instance.rs:210— crates/op-figma/src/instance.rs:210-214 | crates/op-figma/src/instance.rs:641-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-host-desktop/src/chat_session_launch_design.rs:205— crates/op-host-desktop/src/chat_session_launch_design.rs:205-210 | crates/op-host-desktop/src/chat_session_launch_providers.rs:109-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:504— crates/op-auth-bridge/src/collab_claims.rs:504-512 | crates/op-collab/src/profile_validation.rs:99-107 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab/src/profile_validation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/op-chat-agent/src/chat_agent_loop.rs:429— crates/op-chat-agent/src/chat_agent_loop.rs:429-437 | crates/op-host-services/src/chat_builtin_http_wire.rs:72-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/op-cli/src/app_control_cli.rs:194— crates/op-cli/src/app_control_cli.rs:194-202 | crates/op-cli/src/app_control_cli.rs:308-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-cli/src/command_mappers.rs:75— crates/op-cli/src/command_mappers.rs:75-83 | crates/op-cli/src/command_mappers.rs:90-98 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-collab/src/apply_tree.rs:56— crates/op-collab/src/apply_tree.rs:56-64 | crates/op-collab/src/apply_tree.rs:89-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-collab/src/guest_pending.rs:313— crates/op-collab/src/guest_pending.rs:313-321 | crates/op-collab/src/reapply.rs:44-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-collab-policy-file/src/lib.rs:251— crates/op-collab-policy-file/src/lib.rs:251-259 | crates/op-collab-relay-server/src/x25519_boundary.rs:240-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/op-collab-relay-protocol/src/invite.rs:74— crates/op-collab-relay-protocol/src/invite.rs:74-82 | crates/op-collab-relay-protocol/src/locator.rs:254-262 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:167— crates/op-collab-smoke/src/fault_guest.rs:167-175 | crates/op-collab-smoke/src/fault_owner.rs:208-216 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:228— crates/op-collab-smoke/src/fault_guest.rs:228-236 | crates/op-collab-smoke/src/fault_guest.rs:460-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-collab-transport/src/queue.rs:350— crates/op-collab-transport/src/queue.rs:350-358 | crates/op-collab-transport/src/reassembly_budget.rs:86-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-design-lint/src/node_util.rs:366— crates/op-design-lint/src/node_util.rs:366-374 | crates/op-editor-core/src/variables_resolve.rs:91-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/op-editor-core/src/agent_settings_builtin_models.rs:141— crates/op-editor-core/src/agent_settings_builtin_models.rs:141-149 | crates/op-editor-core/src/agent_settings_builtin_models.rs:185-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:380— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:380-388 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:421-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:200— crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:200-208 | crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:284-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/canvas_frame_labels.rs:141— crates/op-editor-ui/src/widgets/canvas_frame_labels.rs:141-149 | crates/op-editor-ui/src/widgets/canvas_frame_labels.rs:166-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/figma_import.rs:262— crates/op-editor-ui/src/widgets/figma_import.rs:262-270 | crates/op-editor-ui/src/widgets/icon_picker_panel.rs:300-308 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/figma_import.rs:350— crates/op-editor-ui/src/widgets/figma_import.rs:350-358 | crates/op-editor-ui/src/widgets/figma_import.rs:367-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_art.rs:429— crates/op-editor-ui/src/widgets/home_surface_paint_art.rs:429-438 | crates/op-editor-ui/src/widgets/home_surface_paint_art.rs:462-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:496— crates/op-editor-ui/src/widgets/prompt_center_panel.rs:496-504 | crates/op-editor-ui/src/widgets/scene_template_panel.rs:559-567 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:73— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:73-81 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:525-533 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/op-host-desktop/src/cursor_icon.rs:35— crates/op-host-desktop/src/cursor_icon.rs:35-43 | crates/op-host-desktop/src/cursor_icon.rs:46-54 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:271— crates/op-host-native/src/widget_host/slides_panel.rs:271-279 | crates/op-host-web/src/widget_host/slides_panel.rs:138-146 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:166— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:166-174 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:55-63 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/op-host-native/src/backend/skia/gradient.rs:36— crates/op-host-native/src/backend/skia/gradient.rs:36-44 | crates/op-host-native/src/backend/skia/gradient.rs:91-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-ai-skills/src/style_guide/card.rs:89— crates/op-ai-skills/src/style_guide/card.rs:89-99 | crates/op-ai-skills/src/style_guide/summary.rs:65-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-ai-skills/src/style_guide/design_md_import.rs:349— crates/op-ai-skills/src/style_guide/design_md_import.rs:349-359 | crates/op-ai-skills/src/style_guide/token_table.rs:204-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-collab-relay-control-plane/src/pairing_wire.rs:108— crates/op-collab-relay-control-plane/src/pairing_wire.rs:108-118 | crates/op-collab-relay-control-plane/src/pairing_wire.rs:187-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-collab-smoke/src/fault_owner.rs:53— crates/op-collab-smoke/src/fault_owner.rs:53-63 | crates/op-collab-smoke/src/fault_owner.rs:224-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-collab-transport/src/driver.rs:484— crates/op-collab-transport/src/driver.rs:484-494 | crates/op-collab-transport/src/driver.rs:556-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-editor-core/src/fills/image.rs:143— crates/op-editor-core/src/fills/image.rs:143-153 | crates/op-editor-core/src/image_node_props.rs:48-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/op-editor-core/src/fills/image.rs:158— crates/op-editor-core/src/fills/image.rs:158-168 | crates/op-editor-core/src/image_node_props.rs:62-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 (11 lines × 2) crates/op-editor-core/src/page_mutators.rs:205— crates/op-editor-core/src/page_mutators.rs:205-215 | crates/op-editor-core/src/page_mutators.rs:379-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_account.rs:182— crates/op-editor-ui/src/widgets/agent_settings_account.rs:182-192 | crates/op-editor-ui/src/widgets/top_bar_paint.rs:651-661 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:432— crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:432-442 | crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:459-469 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_rows.rs:378— crates/op-editor-ui/src/widgets/agent_settings_rows.rs:378-388 | crates/op-editor-ui/src/widgets/agent_settings_rows.rs:431-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/property_panel_flex.rs:384— crates/op-editor-ui/src/widgets/property_panel_flex.rs:384-394 | crates/op-editor-ui/src/widgets/property_panel_text.rs:724-734 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:52— crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:52-62 | crates/op-editor-ui/src/widgets/property_panel_image_node.rs:191-201 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:476— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:476-486 | crates/op-editor-ui/src/widgets/settings_form.rs:37-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_transcript_flow.rs:138— crates/op-editor-ui/src/widgets/ai_chat_transcript_flow.rs:138-148 | crates/op-editor-ui/src/widgets/ai_chat_transcript_flow.rs:172-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-engine-ffi/src/editor_chat_turn.rs:307— crates/op-engine-ffi/src/editor_chat_turn.rs:307-317 | crates/op-host-services/src/chat_builtin_http_wire.rs:93-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/op-engine-ffi/src/editor_chat_design_tools.rs:86— crates/op-engine-ffi/src/editor_chat_design_tools.rs:86-96 | crates/op-host-desktop/src/chat_session.rs:554-564 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/op-host-desktop/src/iconify_host.rs:248— crates/op-host-desktop/src/iconify_host.rs:248-258 | crates/op-host-web/src/iconify_web.rs:415-425 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/op-host-desktop/src/persistence.rs:521— crates/op-host-desktop/src/persistence.rs:521-531 | crates/op-host-desktop/src/persistence.rs:543-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/op-host-native/src/widget_host/agent_settings_touch.rs:84— crates/op-host-native/src/widget_host/agent_settings_touch.rs:84-94 | crates/op-host-native/src/widget_host/touch_panel_gesture.rs:354-364 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-host-native/src/widget_host/mode_transition_host.rs:147— crates/op-host-native/src/widget_host/mode_transition_host.rs:147-157 | crates/op-host-web/src/widget_host/preview_slideshow.rs:103-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:15— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:15-25 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:113-123 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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 × 2) crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:122— crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:122-132 | crates/op-smoke/src/loop_mode.rs:199-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/op-host-web/src/a11y_dom.rs:102— crates/op-host-web/src/a11y_dom.rs:102-112 | crates/op-host-web/src/ime_input.rs:92-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-html/src/text.rs:282— crates/op-html/src/text.rs:282-292 | crates/op-html/src/text_children.rs:142-152 — 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.
WidgetHostNative::paint (cognitive 114) crates/op-host-native/src/widget_host/paint.rs:19— WidgetHostNative::paint has cognitive complexity 114 (threshold 15). Drivers by points: if/else 62 (89 pts), boolean chains 25 (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.
WidgetHostNative::apply_text (cognitive 92) crates/op-host-native/src/widget_host/keyboard.rs:16— WidgetHostNative::apply_text has cognitive complexity 92 (threshold 15). Drivers by points: if/else 56 (84 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_backspace (cognitive 91) crates/op-host-native/src/widget_host/keyboard_delete.rs:13— WidgetHostNative::apply_backspace has cognitive complexity 91 (threshold 15). Drivers by points: if/else 58 (85 pts), match/switch 1 (4 pts), boolean chains 2 (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.
WidgetHostNative::cursor_move_floating_panel_tiers (cognitive 79) crates/op-host-native/src/widget_host/cursor_move_panels.rs:20— WidgetHostNative::cursor_move_floating_panel_tiers has cognitive complexity 79 (threshold 15). Drivers by points: if/else 35 (73 pts), boolean chains 6 (nesting depth added 38). 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.
WidgetHostNative::cursor_move_late_drag_tiers (cognitive 78) crates/op-host-native/src/widget_host/cursor_move_drags.rs:52— WidgetHostNative::cursor_move_late_drag_tiers has cognitive complexity 78 (threshold 15). Drivers by points: if/else 36 (68 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_press_inner (cognitive 78) crates/op-host-native/src/widget_host/press.rs:201— WidgetHostNative::apply_press_inner has cognitive complexity 78 (threshold 15). Drivers by points: if/else 42 (62 pts), boolean chains 10, match/switch 3 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_send (cognitive 73) crates/op-host-native/src/widget_host/keyboard_send.rs:10— WidgetHostNative::apply_send has cognitive complexity 73 (threshold 15). Drivers by points: if/else 49 (66 pts), boolean chains 5, 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.
WidgetHostNative::apply_escape (cognitive 68) crates/op-host-native/src/widget_host/keyboard_escape.rs:13— WidgetHostNative::apply_escape has cognitive complexity 68 (threshold 15). Drivers by points: if/else 58 (64 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
WidgetHostNative::apply_wheel_inner (cognitive 67) crates/op-host-native/src/widget_host/scroll.rs:475— WidgetHostNative::apply_wheel_inner has cognitive complexity 67 (threshold 15). Drivers by points: if/else 40 (63 pts), boolean chains 4 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::cursor_move_property_overlay_tiers (cognitive 66) crates/op-host-native/src/widget_host/cursor_move_overlays.rs:120— WidgetHostNative::cursor_move_property_overlay_tiers has cognitive complexity 66 (threshold 15). Drivers by points: if/else 36 (44 pts), boolean chains 22 (nesting depth added 8). 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.
WidgetHostNative::update_agent_settings_hover (cognitive 65) crates/op-host-native/src/widget_host/geometry_settings_hover.rs:12— WidgetHostNative::update_agent_settings_hover has cognitive complexity 65 (threshold 15). Drivers by points: if/else 48, match/switch 5 (10 pts), boolean chains 7 (nesting depth added 5). 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.
WidgetHostNative::dispatch_git_panel_press (cognitive 62) crates/op-host-native/src/widget_host/git_press.rs:26— WidgetHostNative::dispatch_git_panel_press has cognitive complexity 62 (threshold 15). Drivers by points: if/else 31 (58 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::cursor_hint (cognitive 55) crates/op-host-native/src/widget_host/cursor_hint.rs:29— WidgetHostNative::cursor_hint has cognitive complexity 55 (threshold 15). Drivers by points: if/else 33 (46 pts), boolean chains 5, match/switch 3 (4 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.
WidgetHostNative::apply_pan_gesture (cognitive 55) crates/op-host-native/src/widget_host/scroll_pan.rs:10— WidgetHostNative::apply_pan_gesture has cognitive complexity 55 (threshold 15). Drivers by points: if/else 35 (51 pts), boolean chains 4 (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.
WidgetHostNative::apply_ime_commit (cognitive 52) crates/op-host-native/src/widget_host/ime.rs:139— WidgetHostNative::apply_ime_commit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (35 pts), loops 5 (9 pts), boolean chains 8 (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.
WidgetHostNative::apply_release_with_viewport_inner (cognitive 51) crates/op-host-native/src/widget_host/release.rs:37— WidgetHostNative::apply_release_with_viewport_inner has cognitive complexity 51 (threshold 15). Drivers by points: if/else 41 (47 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WidgetHostNative::cursor_move_modal_tiers (cognitive 46) crates/op-host-native/src/widget_host/cursor_move_modals.rs:13— WidgetHostNative::cursor_move_modal_tiers has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_release (cognitive 44) crates/op-host-native/src/widget_host/release.rs:241— WidgetHostNative::apply_release has cognitive complexity 44 (threshold 15). Drivers by points: if/else 34 (40 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WidgetHostNative::apply_delete (cognitive 43) crates/op-host-native/src/widget_host/keyboard_delete.rs:287— WidgetHostNative::apply_delete has cognitive complexity 43 (threshold 15). Drivers by points: if/else 30 (40 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::cursor_move_status_align_picker_tiers (cognitive 42) crates/op-host-native/src/widget_host/cursor_move_overlays.rs:348— WidgetHostNative::cursor_move_status_align_picker_tiers has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_node_drag_cursor_move (cognitive 41) crates/op-host-native/src/widget_host/input.rs:208— WidgetHostNative::apply_node_drag_cursor_move has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_ime_preedit (cognitive 35) crates/op-host-native/src/widget_host/ime.rs:55— WidgetHostNative::apply_ime_preedit has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 7 (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.
WidgetHostNative::press_menu_modal_tiers (cognitive 35) crates/op-host-native/src/widget_host/press_overlay_tiers.rs:165— WidgetHostNative::press_menu_modal_tiers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (20 pts), match/switch 3 (8 pts), boolean chains 7 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WidgetHostNative::press_mobile_more_sheet_tier (cognitive 33) crates/op-host-native/src/widget_host/press_chrome_tiers.rs:561— WidgetHostNative::press_mobile_more_sheet_tier has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (9 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::paint_left_rail (cognitive 31) crates/op-host-native/src/widget_host/paint_rail.rs:14— WidgetHostNative::paint_left_rail has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, match/switch 1 (3 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.
op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cyclomatic 103) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118— op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::property_panel_dispatch::apply_property_action (cyclomatic 98) crates/op-editor-ui/src/widgets/property_panel_dispatch.rs:186— op_editor_ui::widgets::property_panel_dispatch::apply_property_action has cyclomatic complexity 98 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit (cyclomatic 70) crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:21— op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch (cyclomatic 52) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:117— op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::chat_click_flow::apply_chat_hit (cyclomatic 47) crates/op-editor-ui/src/widgets/chat_click_flow.rs:84— op_editor_ui::widgets::chat_click_flow::apply_chat_hit has cyclomatic complexity 47 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::property_panel_input_layout::editable_input_rects (cyclomatic 39) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:53— op_editor_ui::widgets::property_panel_input_layout::editable_input_rects has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::ai_chat_transcript::build_item (cyclomatic 37) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:178— op_editor_ui::widgets::ai_chat_transcript::build_item 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.
op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker (cyclomatic 36) crates/op-editor-ui/src/widgets/property_panel_layout.rs:213— op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke (cyclomatic 31) crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:409— op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::layer_context_flow::apply_layer_context_ids (cyclomatic 29) crates/op-editor-ui/src/widgets/layer_context_flow.rs:75— op_editor_ui::widgets::layer_context_flow::apply_layer_context_ids 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.
op_editor_ui::widgets::agent_settings_builtin_form::paint_field (cyclomatic 29) crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:189— op_editor_ui::widgets::agent_settings_builtin_form::paint_field has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_editor_ui::widgets::home_surface_paint_panels::paint_composer (cyclomatic 29) crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:31— op_editor_ui::widgets::home_surface_paint_panels::paint_composer 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.
op_editor_ui::widgets::agent_settings_press_flow::apply_agent_settings_hit (cyclomatic 28) crates/op-editor-ui/src/widgets/agent_settings_press_flow.rs:109— op_editor_ui::widgets::agent_settings_press_flow::apply_agent_settings_hit has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::property_panel_commit::commit_property_focus (cyclomatic 27) crates/op-editor-ui/src/widgets/property_panel_commit.rs:281— op_editor_ui::widgets::property_panel_commit::commit_property_focus has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: op_editor_ui::widgets::property_panel_commit::property_focus_initial (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_editor_ui::widgets::scene_template_press_flow::press_scene_template_center (cyclomatic 27) crates/op-editor-ui/src/widgets/scene_template_press_flow.rs:26— op_editor_ui::widgets::scene_template_press_flow::press_scene_template_center has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout (cyclomatic 25) crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:151— op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout 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.
op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds (cyclomatic 24) crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:99— op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds 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.
op_editor_ui::widgets::canvas_viewport_text::paint_text_node (cyclomatic 24) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:278— op_editor_ui::widgets::canvas_viewport_text::paint_text_node 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.
op_editor_ui::svg_export::emit_node (cyclomatic 24) crates/op-editor-ui/src/svg_export.rs:315— op_editor_ui::svg_export::emit_node has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth (cyclomatic 24) crates/op-editor-ui/src/widgets/collab_ui.rs:215— op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth 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.
op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit (cyclomatic 22) crates/op-editor-ui/src/widgets/ai_chat_transcript_hit.rs:22— op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit 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.
op_editor_ui::widgets::home_surface_layout::layout_for_scrolled (cyclomatic 22) crates/op-editor-ui/src/widgets/home_surface_layout.rs:190— op_editor_ui::widgets::home_surface_layout::layout_for_scrolled 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.
op_editor_ui::widgets::home_surface_copy::task_copy (cyclomatic 22) crates/op-editor-ui/src/widgets/home_surface_copy.rs:30— op_editor_ui::widgets::home_surface_copy::task_copy has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::property_panel_typography::font_picker_layout_at_with_density (cyclomatic 22) crates/op-editor-ui/src/widgets/property_panel_typography.rs:311— op_editor_ui::widgets::property_panel_typography::font_picker_layout_at_with_density 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.
op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection (cyclomatic 22) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:608— op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection 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.
op_html::mapper_margin::finish_children (cognitive 50) crates/op-html/src/mapper_margin.rs:166— op_html::mapper_margin::finish_children has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 6 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::css::declarations::expand_background (cognitive 39) crates/op-html/src/css/declarations.rs:359— op_html::css::declarations::expand_background has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (30 pts), loops 4 (6 pts), boolean chains 3 (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.
op_html::text::normalize_segments (cognitive 38) crates/op-html/src/text.rs:359— op_html::text::normalize_segments has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::srcset::parse_srcset (cognitive 35) crates/op-html/src/srcset.rs:188— op_html::srcset::parse_srcset has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (8 pts), match/switch 1 (4 pts), boolean chains 3 (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.
op_html::mapper_visual::map_gradient (cognitive 32) crates/op-html/src/mapper_visual.rs:307— op_html::mapper_visual::map_gradient has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (31 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.
op_html::mapper_grid::wrap_grid_rows (cognitive 31) crates/op-html/src/mapper_grid.rs:27— op_html::mapper_grid::wrap_grid_rows has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::resources_css_urls::unescape_css (cognitive 31) crates/op-html/src/resources_css_urls.rs:213— op_html::resources_css_urls::unescape_css has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::mapper_visual::map_fill (cognitive 29) crates/op-html/src/mapper_visual.rs:35— op_html::mapper_visual::map_fill has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 1 (2 pts), boolean chains 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.
op_html::project_zip_range::parse_html_zip_central_directory (cognitive 29) crates/op-html/src/project_zip_range.rs:160— op_html::project_zip_range::parse_html_zip_central_directory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 6, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::text_children::map_dom_children (cognitive 27) crates/op-html/src/text_children.rs:120— op_html::text_children::map_dom_children has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::html_encoding::encoding_from_meta_attributes (cognitive 27) crates/op-html/src/html_encoding.rs:73— op_html::html_encoding::encoding_from_meta_attributes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (8 pts), boolean chains 6 (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.
op_html::css::cascade::compute_raw (cognitive 26) crates/op-html/src/css/cascade.rs:392— op_html::css::cascade::compute_raw has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (5 pts), match/switch 2 (4 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.
op_html::mapper_visual::map_filter (cognitive 24) crates/op-html/src/mapper_visual.rs:532— op_html::mapper_visual::map_filter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::srcset::pick_from_picture (cognitive 24) crates/op-html/src/srcset.rs:85— op_html::srcset::pick_from_picture has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::mapper_grid::resolved_track_widths (cognitive 23) crates/op-html/src/mapper_grid.rs:196— op_html::mapper_grid::resolved_track_widths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::css::declaration_syntax::split_whitespace_top_level (cognitive 23) crates/op-html/src/css/declaration_syntax.rs:215— op_html::css::declaration_syntax::split_whitespace_top_level has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::resources_css_imports::expand_inner (cognitive 22) crates/op-html/src/resources_css_imports.rs:41— op_html::resources_css_imports::expand_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::transform::split_functions (cognitive 22) crates/op-html/src/transform.rs:318— op_html::transform::split_functions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::mapper_grid::expand_fixed_tracks (cognitive 21) crates/op-html/src/mapper_grid.rs:412— op_html::mapper_grid::expand_fixed_tracks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::special_image::parent_content_box (cognitive 21) crates/op-html/src/special_image.rs:354— op_html::special_image::parent_content_box has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, match/switch 2 (4 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::html_encoding::extract_charset_from_content (cognitive 21) crates/op-html/src/html_encoding.rs:153— op_html::html_encoding::extract_charset_from_content has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::mapper_grid::top_level_tokens (cognitive 20) crates/op-html/src/mapper_grid.rs:518— op_html::mapper_grid::top_level_tokens has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, match/switch 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.
op_html::resources_css_urls::rebase_stylesheet_urls (cognitive 20) crates/op-html/src/resources_css_urls.rs:8— op_html::resources_css_urls::rebase_stylesheet_urls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 pts), 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.
op_html::css::cascade_shared::split_top_level (cognitive 20) crates/op-html/src/css/cascade_shared.rs:75— op_html::css::cascade_shared::split_top_level has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::css::cascade_parser::strip_comments (cognitive 20) crates/op-html/src/css/cascade_parser.rs:349— op_html::css::cascade_parser::strip_comments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::validation_fixes_apply::apply_validation_fixes (cyclomatic 51) crates/op-orchestrator/src/validation_fixes_apply.rs:66— op_orchestrator::validation_fixes_apply::apply_validation_fixes has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::role_defaults::role_defaults (cyclomatic 51) crates/op-orchestrator/src/role_defaults.rs:187— op_orchestrator::role_defaults::role_defaults has cyclomatic complexity 51 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::validation_fixes_apply::collect_node (cyclomatic 50) crates/op-orchestrator/src/validation_fixes_apply.rs:635— op_orchestrator::validation_fixes_apply::collect_node has cyclomatic complexity 50 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::cleanup_equalize_siblings::plan_family_repairs (cyclomatic 47) crates/op-orchestrator/src/cleanup_equalize_siblings.rs:237— op_orchestrator::cleanup_equalize_siblings::plan_family_repairs has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes (cyclomatic 38) crates/op-orchestrator/src/prompt_subagent.rs:148— op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_orchestrator::parse::resolve_numeric_design_token (cyclomatic 32) crates/op-orchestrator/src/parse.rs:551— op_orchestrator::parse::resolve_numeric_design_token has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::style_guide_context::infer_tags_from_prompt (cyclomatic 30) crates/op-orchestrator/src/style_guide_context.rs:25— op_orchestrator::style_guide_context::infer_tags_from_prompt 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.
op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor (cyclomatic 30) crates/op-orchestrator/src/cleanup_slide_padding.rs:106— op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context (cyclomatic 29) crates/op-orchestrator/src/geometry_diagnostics_collect.rs:126— op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context 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.
op_orchestrator::loop_finalize_record::record_same_id_shallow_patches (cyclomatic 29) crates/op-orchestrator/src/loop_finalize_record.rs:219— op_orchestrator::loop_finalize_record::record_same_id_shallow_patches 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.
op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast (cyclomatic 29) crates/op-orchestrator/src/role_post_pass/contrast.rs:6— op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast 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.
op_orchestrator::subtask_completeness::expected_item_count (cyclomatic 28) crates/op-orchestrator/src/subtask_completeness.rs:25— op_orchestrator::subtask_completeness::expected_item_count has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::cleanup_section_margins::unify_transparent_section_margins (cyclomatic 27) crates/op-orchestrator/src/cleanup_section_margins.rs:62— op_orchestrator::cleanup_section_margins::unify_transparent_section_margins has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::concurrent::run_subtask_retry_ladder_with_outcomes (cyclomatic 26) crates/op-orchestrator/src/concurrent.rs:189— op_orchestrator::concurrent::run_subtask_retry_ladder_with_outcomes has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_orchestrator::compact_prompt::build_compact_planning_prompt (cyclomatic 26) crates/op-orchestrator/src/compact_prompt.rs:36— op_orchestrator::compact_prompt::build_compact_planning_prompt has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::repair_record::describe_command (cyclomatic 25) crates/op-orchestrator/src/repair_record.rs:150— op_orchestrator::repair_record::describe_command has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::validation_dump::walk_dump (cyclomatic 25) crates/op-orchestrator/src/validation_dump.rs:75— op_orchestrator::validation_dump::walk_dump has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_orchestrator::radial_repair::radial_stack_repair (cyclomatic 25) crates/op-orchestrator/src/radial_repair.rs:489— op_orchestrator::radial_repair::radial_stack_repair has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_orchestrator::geometry_row_fixes::collect_row_overfull_fixes_with_context (cyclomatic 24) crates/op-orchestrator/src/geometry_row_fixes.rs:313— op_orchestrator::geometry_row_fixes::collect_row_overfull_fixes_with_context 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.
op_orchestrator::spacing_repair::strip_in_value (cyclomatic 24) crates/op-orchestrator/src/spacing_repair.rs:94— op_orchestrator::spacing_repair::strip_in_value 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.
op_orchestrator::role_post_pass::micro_surface_radius::round_missing_semantic_micro_surfaces (cyclomatic 24) crates/op-orchestrator/src/role_post_pass/micro_surface_radius.rs:203— op_orchestrator::role_post_pass::micro_surface_radius::round_missing_semantic_micro_surfaces 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.
op_orchestrator::mobile_reflow::candidate_for_root (cyclomatic 24) crates/op-orchestrator/src/mobile_reflow.rs:127— op_orchestrator::mobile_reflow::candidate_for_root has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_orchestrator::mobile_content_rail::collect_repairs (cyclomatic 24) crates/op-orchestrator/src/mobile_content_rail.rs:295— op_orchestrator::mobile_content_rail::collect_repairs 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.
op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes (cyclomatic 23) crates/op-orchestrator/src/subagent.rs:118— op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes 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.
op_orchestrator::hero_bleed::enforce (cyclomatic 22) crates/op-orchestrator/src/hero_bleed.rs:16— op_orchestrator::hero_bleed::enforce 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.
Duplicated block (12 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:306— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:306-317 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:247-258 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/op-collab/src/codec.rs:244— crates/op-collab/src/codec.rs:244-255 | crates/op-collab/src/codec.rs:363-374 — both copies are in the same file, so extract the 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) crates/op-collab/src/guest_pending.rs:328— crates/op-collab/src/guest_pending.rs:328-339 | crates/op-collab/src/reapply.rs:60-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/op-collab-relay-locator-server/src/http.rs:447— crates/op-collab-relay-locator-server/src/http.rs:447-458 | crates/op-collab-relay-locator-server/src/http.rs:517-528 — both copies are in the same file, so extract the 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) crates/op-collab-smoke/src/fault_guest.rs:62— crates/op-collab-smoke/src/fault_guest.rs:62-73 | crates/op-collab-smoke/src/fault_guest.rs:137-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-core/src/command_style_replace.rs:275— crates/op-editor-core/src/command_style_replace.rs:275-286 | crates/op-editor-core/src/command_style_replace.rs:297-308 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/svg_import/path_data.rs:130— crates/op-editor-core/src/svg_import/path_data.rs:130-141 | crates/op-editor-core/src/svg_import/path_data.rs:154-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-core/src/host_preset_name_draft.rs:47— crates/op-editor-core/src/host_preset_name_draft.rs:47-58 | crates/op-editor-core/src/host_preset_name_draft.rs:72-83 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/svg_import/nodes.rs:131— crates/op-editor-core/src/svg_import/nodes.rs:131-142 | crates/op-editor-core/src/svg_import/nodes.rs:146-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/collab_avatar_runtime.rs:476— crates/op-editor-ui/src/collab_avatar_runtime.rs:476-487 | crates/op-editor-ui/src/collab_avatar_runtime.rs:497-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:188— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:188-199 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:278-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:132— crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:132-143 | crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:169-180 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:139— crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:139-150 | crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:177-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/canvas_layout_transition.rs:143— crates/op-editor-ui/src/widgets/canvas_layout_transition.rs:143-154 | crates/op-preview-core/src/binding_overlay_apply.rs:191-202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/collab_panel.rs:498— crates/op-editor-ui/src/widgets/collab_panel.rs:498-509 | crates/op-editor-ui/src/widgets/collab_panel.rs:553-564 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/figma_import.rs:344— crates/op-editor-ui/src/widgets/figma_import.rs:344-355 | crates/op-editor-ui/src/widgets/figma_import_progress.rs:111-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/property_panel_text.rs:632— crates/op-editor-ui/src/widgets/property_panel_text.rs:632-643 | crates/op-editor-ui/src/widgets/property_panel_text.rs:729-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:402— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:402-413 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:534-545 — both copies are in the same file, so extract the 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) crates/op-figma/src/instance/fingerprint.rs:382— crates/op-figma/src/instance/fingerprint.rs:382-393 | crates/op-figma/src/instance/fingerprint.rs:435-446 — both copies are in the same file, so extract the 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) crates/op-figma/src/tree.rs:54— crates/op-figma/src/tree.rs:54-65 | crates/op-figma/src/tree.rs:75-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-figma/src/boolean_fallback.rs:75— crates/op-figma/src/boolean_fallback.rs:75-86 | crates/op-figma/src/boolean_fallback.rs:140-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-host-desktop/src/chat_acp.rs:396— crates/op-host-desktop/src/chat_acp.rs:396-414 | crates/op-host-services/src/chat_http_server.rs:157-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) crates/op-host-desktop/src/chat_session.rs:295— crates/op-host-desktop/src/chat_session.rs:295-306 | crates/op-host-desktop/src/chat_session.rs:398-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:315— crates/op-host-native/src/widget_host/slides_panel.rs:315-326 | crates/op-host-web/src/widget_host/slides_panel.rs:178-189 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 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) crates/op-host-native/src/widget_host/variables_preset_press.rs:70— crates/op-host-native/src/widget_host/variables_preset_press.rs:70-81 | crates/op-host-web/src/widget_host/variables_preset_press.rs:46-57 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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.
WidgetHostNative::dispatch_git_panel_press (cyclomatic 99) crates/op-host-native/src/widget_host/git_press.rs:26— WidgetHostNative::dispatch_git_panel_press has cyclomatic complexity 99 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHostNative::paint (cyclomatic 86) crates/op-host-native/src/widget_host/paint.rs:19— WidgetHostNative::paint has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_escape (cyclomatic 63) crates/op-host-native/src/widget_host/keyboard_escape.rs:13— WidgetHostNative::apply_escape has cyclomatic complexity 63 (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.
WidgetHostNative::apply_text (cyclomatic 62) crates/op-host-native/src/widget_host/keyboard.rs:16— WidgetHostNative::apply_text has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_backspace (cyclomatic 62) crates/op-host-native/src/widget_host/keyboard_delete.rs:13— WidgetHostNative::apply_backspace has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_send (cyclomatic 56) crates/op-host-native/src/widget_host/keyboard_send.rs:10— WidgetHostNative::apply_send has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_press_inner (cyclomatic 56) crates/op-host-native/src/widget_host/press.rs:201— WidgetHostNative::apply_press_inner has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::update_agent_settings_hover (cyclomatic 52) crates/op-host-native/src/widget_host/geometry_settings_hover.rs:12— WidgetHostNative::update_agent_settings_hover has cyclomatic complexity 52 (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.
WidgetHostNative::cursor_move_property_overlay_tiers (cyclomatic 51) crates/op-host-native/src/widget_host/cursor_move_overlays.rs:120— WidgetHostNative::cursor_move_property_overlay_tiers has cyclomatic complexity 51 (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.
WidgetHostNative::cursor_hint (cyclomatic 45) crates/op-host-native/src/widget_host/cursor_hint.rs:29— WidgetHostNative::cursor_hint has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::cursor_move_late_drag_tiers (cyclomatic 45) crates/op-host-native/src/widget_host/cursor_move_drags.rs:52— WidgetHostNative::cursor_move_late_drag_tiers has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_release_with_viewport_inner (cyclomatic 45) crates/op-host-native/src/widget_host/release.rs:37— WidgetHostNative::apply_release_with_viewport_inner has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHostNative::cursor_move_floating_panel_tiers (cyclomatic 42) crates/op-host-native/src/widget_host/cursor_move_panels.rs:20— WidgetHostNative::cursor_move_floating_panel_tiers 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.
WidgetHostNative::apply_wheel_inner (cyclomatic 41) crates/op-host-native/src/widget_host/scroll.rs:475— WidgetHostNative::apply_wheel_inner 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.
WidgetHostNative::press_home (cyclomatic 38) crates/op-host-native/src/widget_host/home.rs:13— WidgetHostNative::press_home has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHostNative::apply_release (cyclomatic 38) crates/op-host-native/src/widget_host/release.rs:241— WidgetHostNative::apply_release has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHostNative::apply_pan_gesture (cyclomatic 37) crates/op-host-native/src/widget_host/scroll_pan.rs:10— WidgetHostNative::apply_pan_gesture has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_delete (cyclomatic 34) crates/op-host-native/src/widget_host/keyboard_delete.rs:287— WidgetHostNative::apply_delete 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.
WidgetHostNative::apply_ime_commit (cyclomatic 33) crates/op-host-native/src/widget_host/ime.rs:139— WidgetHostNative::apply_ime_commit has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::cursor_move_modal_tiers (cyclomatic 29) crates/op-host-native/src/widget_host/cursor_move_modals.rs:13— WidgetHostNative::cursor_move_modal_tiers 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.
WidgetHostNative::press_menu_modal_tiers (cyclomatic 28) crates/op-host-native/src/widget_host/press_overlay_tiers.rs:165— WidgetHostNative::press_menu_modal_tiers has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHostNative::press_mobile_more_sheet_tier (cyclomatic 27) crates/op-host-native/src/widget_host/press_chrome_tiers.rs:561— WidgetHostNative::press_mobile_more_sheet_tier has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::press_property_overlay_tiers (cyclomatic 26) crates/op-host-native/src/widget_host/press_property_tiers.rs:18— WidgetHostNative::press_property_overlay_tiers has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHostNative::apply_ime_preedit (cyclomatic 25) crates/op-host-native/src/widget_host/ime.rs:55— WidgetHostNative::apply_ime_preedit 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.
WidgetHostNative::cursor_move_status_align_picker_tiers (cyclomatic 24) crates/op-host-native/src/widget_host/cursor_move_overlays.rs:348— WidgetHostNative::cursor_move_status_align_picker_tiers 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.
op_host_services::mcp_serve::registry::rebuild_registry (cognitive 146) crates/op-host-services/src/mcp_serve/registry.rs:9— op_host_services::mcp_serve::registry::rebuild_registry has cognitive complexity 146 (threshold 15). Drivers by points: if/else 141 (144 pts), 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.
op_host_services::chat_http_server::run_opencode_turn (cognitive 98) crates/op-host-services/src/chat_http_server.rs:246— op_host_services::chat_http_server::run_opencode_turn has cognitive complexity 98 (threshold 15). Drivers by points: if/else 32 (71 pts), match/switch 12 (18 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 46). 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.
op_host_services::mcp_serve::sniff::walk_top_level (cognitive 84) crates/op-host-services/src/mcp_serve/sniff.rs:57— op_host_services::mcp_serve::sniff::walk_top_level has cognitive complexity 84 (threshold 15). Drivers by points: if/else 24 (54 pts), loops 8 (18 pts), boolean chains 10, match/switch 1 (2 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_canvas_server::connection::dispatch (cognitive 64) crates/op-host-services/src/web_canvas_server/connection.rs:101— op_host_services::web_canvas_server::connection::dispatch has cognitive complexity 64 (threshold 15). Drivers by points: if/else 34 (39 pts), boolean chains 18, match/switch 4 (7 pts) (nesting depth added 8). 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.
op_host_services::mcp_serve::read_http_request (cognitive 41) crates/op-host-services/src/mcp_serve.rs:403— op_host_services::mcp_serve::read_http_request has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 7, match/switch 3 (4 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::chat_claude::map_message (cognitive 38) crates/op-host-services/src/chat_claude.rs:349— op_host_services::chat_claude::map_message has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). 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.
op_host_services::ai_proxy::proxy_builtin_for_identity (cognitive 34) crates/op-host-services/src/ai_proxy.rs:359— op_host_services::ai_proxy::proxy_builtin_for_identity has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::cli_model_discovery::parse_grok_models (cognitive 32) crates/op-host-services/src/cli_model_discovery.rs:210— op_host_services::cli_model_discovery::parse_grok_models has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 8, 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.
op_host_services::design_md_evidence::evidence_provenance (cognitive 32) crates/op-host-services/src/design_md_evidence.rs:416— op_host_services::design_md_evidence::evidence_provenance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 6 (7 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::cli_model_discovery_antigravity::parse_antigravity_models (cognitive 31) crates/op-host-services/src/cli_model_discovery_antigravity.rs:35— op_host_services::cli_model_discovery_antigravity::parse_antigravity_models has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 10, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::chat_builtin_http_wire::pump_sse_response (cognitive 30) crates/op-host-services/src/chat_builtin_http_wire.rs:30— op_host_services::chat_builtin_http_wire::pump_sse_response has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_chat_standard::stream_modify_route (cognitive 28) crates/op-host-services/src/web_chat_standard.rs:483— op_host_services::web_chat_standard::stream_modify_route has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route (cognitive 26) crates/op-host-services/src/web_canvas_server/connection_ai_routes.rs:38— op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 8 (19 pts), if/else 4 (7 pts) (nesting depth added 14). 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.
op_host_services::web_credentials::validate_and_merge (cognitive 25) crates/op-host-services/src/web_credentials.rs:303— op_host_services::web_credentials::validate_and_merge has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_canvas_server::handle_web_canvas_request (cognitive 24) crates/op-host-services/src/web_canvas_server.rs:460— op_host_services::web_canvas_server::handle_web_canvas_request has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 6 (11 pts), boolean chains 1 (nesting depth added 11). 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.
op_host_services::mcp_live::connection::serve_connection (cognitive 24) crates/op-host-services/src/mcp_live/connection.rs:113— op_host_services::mcp_live::connection::serve_connection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 3, 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.
op_host_services::chat_spawn::well_known_install_paths (cognitive 24) crates/op-host-services/src/chat_spawn.rs:420— op_host_services::chat_spawn::well_known_install_paths has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (10 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.
op_host_services::design_md_evidence_roles::from_sanitized_json (cognitive 24) crates/op-host-services/src/design_md_evidence_roles.rs:11— op_host_services::design_md_evidence_roles::from_sanitized_json has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 4 (6 pts), boolean chains 1 (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.
op_host_services::export_pptx::unexpressible (cognitive 23) crates/op-host-services/src/export_pptx.rs:365— op_host_services::export_pptx::unexpressible has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, match/switch 3 (4 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.
op_host_services::design_md_evidence::validate_evidence (cognitive 23) crates/op-host-services/src/design_md_evidence.rs:535— op_host_services::design_md_evidence::validate_evidence has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 8 (9 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_canvas_server::run_loop::run_web_canvas (cognitive 22) crates/op-host-services/src/web_canvas_server/run_loop.rs:28— op_host_services::web_canvas_server::run_loop::run_web_canvas has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::chat_http_server_error::format_opencode_error (cognitive 22) crates/op-host-services/src/chat_http_server_error.rs:114— op_host_services::chat_http_server_error::format_opencode_error has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 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.
op_host_services::zode_import::import_from_config (cognitive 22) crates/op-host-services/src/zode_import.rs:77— op_host_services::zode_import::import_from_config has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_chat_standard_model_selection::selected_model_id (cognitive 21) crates/op-host-services/src/web_chat_standard_model_selection.rs:5— op_host_services::web_chat_standard_model_selection::selected_model_id has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::chat_intent::turns::run_modify_turn_inner (cognitive 20) crates/op-host-services/src/chat_intent/turns.rs:284— op_host_services::chat_intent::turns::run_modify_turn_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_cursor_move (cognitive 261) crates/op-host-web/src/widget_host/cursor_input.rs:17— WidgetHost::apply_cursor_move has cognitive complexity 261 (threshold 15). Drivers by points: if/else 125 (217 pts), boolean chains 38, match/switch 2 (6 pts) (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_overlay_cursor_move (cognitive 92) crates/op-host-web/src/widget_host/overlay_cursor.rs:96— WidgetHost::apply_overlay_cursor_move has cognitive complexity 92 (threshold 15). Drivers by points: if/else 39 (75 pts), boolean chains 14, match/switch 1 (3 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::paint_editor (cognitive 82) crates/op-host-web/src/widget_host/paint.rs:49— WidgetHost::paint_editor has cognitive complexity 82 (threshold 15). Drivers by points: if/else 48 (74 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::update_agent_settings_hover (cognitive 50) crates/op-host-web/src/widget_host/agent_settings_hover.rs:14— WidgetHost::update_agent_settings_hover has cognitive complexity 50 (threshold 15). Drivers by points: if/else 32, match/switch 6 (11 pts), boolean chains 7 (nesting depth added 5). 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.
WidgetHost::apply_backspace (cognitive 42) crates/op-host-web/src/widget_host/keyboard.rs:133— WidgetHost::apply_backspace has cognitive complexity 42 (threshold 15). Drivers by points: if/else 29 (40 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::update_dropdown_hover (cognitive 41) crates/op-host-web/src/widget_host/overlay_cursor.rs:469— WidgetHost::update_dropdown_hover has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (34 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_escape (cognitive 40) crates/op-host-web/src/widget_host/keyboard_escape.rs:16— WidgetHost::apply_escape has cognitive complexity 40 (threshold 15). Drivers by points: if/else 39, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_delete (cognitive 39) crates/op-host-web/src/widget_host/keyboard.rs:348— WidgetHost::apply_delete has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_text (cognitive 34) crates/op-host-web/src/widget_host/keyboard.rs:17— WidgetHost::apply_text has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26 (34 pts) (nesting depth added 8). 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.
WidgetHost::press_font_and_picker_tiers (cognitive 31) crates/op-host-web/src/widget_host/press_property_tiers.rs:121— WidgetHost::press_font_and_picker_tiers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 1 (nesting depth added 18). 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.
WidgetHost::apply_git_text (cognitive 30) crates/op-host-web/src/widget_host/keyboard_git.rs:7— WidgetHost::apply_git_text has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::focused_input_selected_text (cognitive 28) crates/op-host-web/src/widget_host/keyboard_text_inputs.rs:143— WidgetHost::focused_input_selected_text has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (20 pts), match/switch 2 (5 pts), boolean chains 3 (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.
WidgetHost::press_top_bar_tier (cognitive 27) crates/op-host-web/src/widget_host/press_chrome_tiers.rs:124— WidgetHost::press_top_bar_tier has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (4 pts), boolean chains 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.
WidgetHost::apply_send (cognitive 25) crates/op-host-web/src/widget_host/keyboard.rs:251— WidgetHost::apply_send has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21 (25 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.
WidgetHost::apply_release_with_viewport (cognitive 25) crates/op-host-web/src/widget_host/release_input.rs:36— WidgetHost::apply_release_with_viewport has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
WidgetHost::apply_git_send (cognitive 22) crates/op-host-web/src/widget_host/keyboard_git.rs:162— WidgetHost::apply_git_send has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_node_drag_cursor_move (cognitive 22) crates/op-host-web/src/widget_host/node_drag.rs:119— WidgetHost::apply_node_drag_cursor_move has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WidgetHost::paint_menu_modal_and_panel_layers (cognitive 22) crates/op-host-web/src/widget_host/paint_overlays.rs:23— WidgetHost::paint_menu_modal_and_panel_layers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 2 (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.
WidgetHost::press_rail_overlay_tiers (cognitive 22) crates/op-host-web/src/widget_host/press_chrome_tiers.rs:17— WidgetHost::press_rail_overlay_tiers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 12). 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.
WidgetHost::dispatch_icon_picker_press (cognitive 21) crates/op-host-web/src/widget_host/icon_picker_press.rs:19— WidgetHost::dispatch_icon_picker_press has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, 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.
WidgetHost::press_import_locale_tiers (cognitive 20) crates/op-host-web/src/widget_host/press_overlay_tiers.rs:128— WidgetHost::press_import_locale_tiers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (8 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_release (cognitive 20) crates/op-host-web/src/widget_host/release_input.rs:132— WidgetHost::apply_release has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::press_property_panel_tier (cognitive 19) crates/op-host-web/src/widget_host/press_property_tiers.rs:240— WidgetHost::press_property_panel_tier has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (19 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_wheel_with_canvas_delta (cognitive 19) crates/op-host-web/src/widget_host/wheel_pan.rs:169— WidgetHost::apply_wheel_with_canvas_delta has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_git_backspace (cognitive 18) crates/op-host-web/src/widget_host/keyboard_git.rs:100— WidgetHost::apply_git_backspace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::variables_resolve::replace::replace_in_node (cognitive 72) crates/op-editor-core/src/variables_resolve/replace.rs:43— op_editor_core::variables_resolve::replace::replace_in_node has cognitive complexity 72 (threshold 15). Drivers by points: if/else 20 (46 pts), loops 5 (13 pts), match/switch 4 (13 pts) (nesting depth added 43). 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.
op_editor_core::variables_resolve::resolve_node_for_canvas (cognitive 66) crates/op-editor-core/src/variables_resolve.rs:236— op_editor_core::variables_resolve::resolve_node_for_canvas has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (51 pts), loops 5 (13 pts), match/switch 1 (2 pts) (nesting depth added 39). 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.
op_editor_core::svg_import::path_data::parse_path_d (cognitive 41) crates/op-editor-core/src/svg_import/path_data.rs:12— op_editor_core::svg_import::path_data::parse_path_d has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 4 (10 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::svg_import::scale::scale_svg_path (cognitive 36) crates/op-editor-core/src/svg_import/scale.rs:46— op_editor_core::svg_import::scale::scale_svg_path has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 7, 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.
op_editor_core::host_variables_commit::commit_row_draft (cognitive 33) crates/op-editor-core/src/host_variables_commit.rs:231— op_editor_core::host_variables_commit::commit_row_draft has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 1, match/switch 1 (nesting depth added 16). 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.
op_editor_core::host_settings_commit::commit_settings_focus (cognitive 33) crates/op-editor-core/src/host_settings_commit.rs:48— op_editor_core::host_settings_commit::commit_settings_focus has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 4 (7 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::svg_path_data::absolute_segments (cognitive 31) crates/op-editor-core/src/svg_path_data.rs:55— op_editor_core::svg_path_data::absolute_segments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 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.
op_editor_core::svg_path_data::tokenize_path (cognitive 29) crates/op-editor-core/src/svg_path_data.rs:416— op_editor_core::svg_path_data::tokenize_path has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::svg_import::path_data::tokenize_path (cognitive 29) crates/op-editor-core/src/svg_import/path_data.rs:270— op_editor_core::svg_import::path_data::tokenize_path has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::missing_fonts::component_override_font_family_stacks (cognitive 28) crates/op-editor-core/src/missing_fonts.rs:85— op_editor_core::missing_fonts::component_override_font_family_stacks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (11 pts), match/switch 1 (nesting depth added 15). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 2 function items inside it that branch (scan_json, scan_nodes). 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.
op_editor_core::svg_import::lexer::scan_numbers (cognitive 28) crates/op-editor-core/src/svg_import/lexer.rs:143— op_editor_core::svg_import::lexer::scan_numbers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::svg_import::lexer::parse_attrs (cognitive 27) crates/op-editor-core/src/svg_import/lexer.rs:87— op_editor_core::svg_import::lexer::parse_attrs has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (11 pts), boolean chains 8, if/else 4 (8 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.
op_editor_core::svg_import::xml::parse_svg_tree (cognitive 27) crates/op-editor-core/src/svg_import/xml.rs:95— op_editor_core::svg_import::xml::parse_svg_tree has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 4 (10 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::instance_override::route_display_state (cognitive 27) crates/op-editor-core/src/instance_override.rs:335— op_editor_core::instance_override::route_display_state has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), match/switch 4 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::icon_path_normalize::absolute_segments (cognitive 24) crates/op-editor-core/src/icon_path_normalize.rs:306— op_editor_core::icon_path_normalize::absolute_segments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), match/switch 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.
op_editor_core::instance_child_override::split_instance_child_anchor (cognitive 22) crates/op-editor-core/src/instance_child_override.rs:48— op_editor_core::instance_child_override::split_instance_child_anchor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::svg_import::nodes::element_to_node_ctx (cognitive 20) crates/op-editor-core/src/svg_import/nodes.rs:9— op_editor_core::svg_import::nodes::element_to_node_ctx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 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.
op_editor_core::host_ui_transitions::settings_text_payload (cognitive 20) crates/op-editor-core/src/host_ui_transitions.rs:181— op_editor_core::host_ui_transitions::settings_text_payload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::command_refine::ids_outside_subtree (cognitive 20) crates/op-editor-core/src/command_refine.rs:124— op_editor_core::command_refine::ids_outside_subtree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5 (10 pts) (nesting depth added 8). Of this number, 10 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::variables_resolve::roots_have_tokens::node_has_token (cognitive 19) crates/op-editor-core/src/variables_resolve.rs:358— op_editor_core::variables_resolve::roots_have_tokens::node_has_token has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (3 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.
op_editor_core::prompt_center_catalog::parse_prompt_catalogue (cognitive 19) crates/op-editor-core/src/prompt_center_catalog.rs:285— op_editor_core::prompt_center_catalog::parse_prompt_catalogue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::align::parent_aggregate_bounds (cognitive 19) crates/op-editor-core/src/align.rs:213— op_editor_core::align::parent_aggregate_bounds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::instance_override::resolve_instance_display_node (cognitive 19) crates/op-editor-core/src/instance_override.rs:91— op_editor_core::instance_override::resolve_instance_display_node has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::mutators::duplicate_in_children_with_allocator (cognitive 18) crates/op-editor-core/src/mutators.rs:697— op_editor_core::mutators::duplicate_in_children_with_allocator has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). 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.
op_editor_core::svg_import::xml::find_matching_close (cognitive 18) crates/op-editor-core/src/svg_import/xml.rs:173— op_editor_core::svg_import::xml::find_matching_close has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyMethods: WidgetHostNative crates/op-host-native/src/widget_host.rs:310— TooManyMethods — 652 methods, declared across 108 files: widget_host/geometry.rs (29), widget_host/shortcuts.rs (28), widget_host/overlay_rects.rs (25), widget_host/input.rs (22), +104 more file(s). The bar is 30 methods; this is 622 over it, 21.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WidgetHost crates/op-host-web/src/widget_host.rs:245— TooManyMethods — 427 methods, declared across 80 files: widget_host/preview_frame.rs (30), widget_host/keyboard_edit_ops.rs (24), widget_host/host_lifecycle.rs (21), widget_host/image_panel_dispatch.rs (20), +76 more file(s). The bar is 30 methods; this is 397 over it, 14.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorState crates/op-editor-core/src/state.rs:56— TooManyMethods — 362 methods, declared across 53 files: src/mutators.rs (37), command_node_attrs/state_ops.rs (25), src/property_edit_mutators.rs (25), src/text_edit.rs (23), +49 more file(s). The bar is 30 methods; this is 332 over it, 12.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DesktopApp crates/op-host-desktop/src/main.rs:168— TooManyMethods — 158 methods, declared across 29 files: git_host/repo_ops.rs (15), src/app_state.rs (14), src/keyboard_input.rs (11), app_handler/pointer_events.rs (10), +25 more file(s). The bar is 30 methods; this is 128 over it, 5.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GitPanel crates/op-editor-ui/src/widgets/git_panel.rs:244— TooManyMethods — 134 methods, declared across 19 files: widgets/git_panel_ready.rs (18), widgets/git_panel_diff.rs (13), widgets/git_panel_tracked_picker.rs (12), widgets/git_panel_commit_card.rs (10), +15 more file(s). The bar is 30 methods; this is 104 over it, 4.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SceneTemplatePanel crates/op-editor-ui/src/widgets/scene_template_panel.rs:259— TooManyMethods — 128 methods, declared across 11 files: widgets/scene_template_panel.rs (34), widgets/scene_template_card_paint.rs (20), widgets/scene_template_touch_density.rs (20), widgets/scene_template_panel_paint.rs (12), +7 more file(s). The bar is 30 methods; this is 98 over it, 4.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PreviewSession crates/op-preview-core/src/session.rs:70— TooManyMethods — 113 methods, declared across 11 files: src/input.rs (24), src/session.rs (17), src/session_paint.rs (15), src/present.rs (13), +7 more file(s). The bar is 30 methods; this is 83 over it, 3.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CollabRuntime crates/op-collab-host/src/runtime.rs:72— TooManyMethods — 101 methods, declared across 13 files: src/runtime.rs (28), runtime/effects.rs (20), runtime/effects_wire.rs (11), network/lifecycle.rs (9), +9 more file(s). The bar is 30 methods; this is 71 over it, 3.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorUiState crates/op-editor-core/src/editor_ui_state.rs:44— TooManyMethods — 97 methods, declared across 8 files: editor_ui_state/methods.rs (59), src/host_escape_transitions.rs (19), src/host_keyboard_transitions.rs (5), src/host_ui_transitions.rs (5), +4 more file(s). The bar is 30 methods; this is 67 over it, 3.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeBackend crates/op-host-native/src/backend/skia.rs:91— TooManyMethods — 91 methods, declared across 7 files: backend/skia.rs (35), skia/path.rs (23), skia/text.rs (10), skia/image.rs (9), +3 more file(s). The bar is 30 methods; this is 61 over it, 3.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PropertyPanel crates/op-editor-ui/src/widgets/property_panel.rs:80— TooManyMethods — 87 methods, declared across 8 files: widgets/property_panel_overlay_hit.rs (33), property_panel/hit.rs (16), property_panel/menus.rs (12), widgets/property_panel_compositing.rs (9), +4 more file(s). The bar is 30 methods; this is 57 over it, 2.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpNative packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpNative.kt:11— TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AgentSettings crates/op-editor-core/src/agent_settings.rs:254— TooManyMethods — 69 methods, declared across 4 files: agent_settings/mutators.rs (28), src/agent_settings_builtin_models.rs (17), src/agent_settings_acp_connection.rs (12), src/agent_settings_connection.rs (12). The bar is 30 methods; this is 39 over it, 2.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Session crates/op-engine-ffi/src/lifecycle.rs:29— TooManyMethods — 65 methods, declared across 11 files: src/lifecycle.rs (27), src/editor_collab.rs (15), src/pointer_gate.rs (8), src/editor_collab_presence.rs (4), +7 more file(s). The bar is 30 methods; this is 35 over it, 2.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpSurfaceView packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt:44— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpEngineHost packaging/ios/Sources/OpEngineHost.swift:6— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GitRepo crates/op-git/src/lib.rs:129— TooManyMethods — 53 methods, declared across 7 files: src/merge.rs (11), src/status.rs (11), src/remote.rs (10), src/lib.rs (9), +3 more file(s). The bar is 30 methods; this is 23 over it, 1.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpPlayerView packaging/ios/Sources/OpPlayerView.swift:10— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AIChatPlaceholder crates/op-editor-ui/src/widgets/ai_chat_panel.rs:87— TooManyMethods — 51 methods, declared across 3 files: widgets/ai_chat_panel.rs (38), widgets/ai_chat_panel_hit.rs (12), widgets/ai_chat_panel_footer.rs (1). The bar is 30 methods; this is 21 over it, 1.70× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GuestSessionCore crates/op-collab/src/guest.rs:34— TooManyMethods — 47 methods, declared across 3 files: src/guest.rs (30), src/guest_sync.rs (13), src/guest_pending.rs (4). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VariablesPanel crates/op-editor-ui/src/widgets/variables_panel.rs:127— TooManyMethods — 47 methods, declared across 3 files: widgets/variables_panel.rs (45), variables_panel/hit.rs (1), variables_panel/hover.rs (1). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OwnerSessionCore crates/op-collab/src/session.rs:29— TooManyMethods — 46 methods, declared across 5 files: src/session_roster.rs (17), src/session.rs (10), src/session_undo.rs (10), src/session_sync.rs (5), +1 more file(s). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TopBar crates/op-editor-ui/src/widgets/top_bar.rs:114— TooManyMethods — 46 methods, declared across 5 files: widgets/top_bar_geometry.rs (28), widgets/top_bar.rs (12), widgets/top_bar_window_control.rs (4), widgets/top_bar_paint.rs (1), +1 more file(s). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PromptCenterPanel crates/op-editor-ui/src/widgets/prompt_center_panel.rs:143— TooManyMethods — 44 methods, declared across 2 files: widgets/prompt_center_panel.rs (33), widgets/prompt_center_panel_paint.rs (11). The bar is 30 methods; this is 14 over it, 1.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChatState crates/op-editor-core/src/chat.rs:156— TooManyMethods — 41 methods, declared across 3 files: chat/session.rs (29), chat/messages.rs (11), src/chat_design_apply.rs (1). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
op_figma::instance::apply_instance_overrides_cached (cognitive 248) crates/op-figma/src/instance.rs:102— op_figma::instance::apply_instance_overrides_cached has cognitive complexity 248 (threshold 15). Drivers by points: if/else 67 (186 pts), loops 17 (33 pts), boolean chains 18, match/switch 4 (11 pts) (nesting depth added 142). 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.
op_figma::instance::fingerprint::score (cognitive 52) crates/op-figma/src/instance/fingerprint.rs:202— op_figma::instance::fingerprint::score has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::apply::apply_to_node (cognitive 47) crates/op-figma/src/instance/apply.rs:188— op_figma::instance::apply::apply_to_node has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_figma::clipboard::parse_clipboard_html_styles (cognitive 42) crates/op-figma/src/clipboard.rs:333— op_figma::clipboard::parse_clipboard_html_styles has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (34 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::node_mapper::style_references::resolve_on_node (cognitive 41) crates/op-figma/src/node_mapper/style_references.rs:121— op_figma::node_mapper::style_references::resolve_on_node has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::scale_command_path (cognitive 39) crates/op-figma/src/vector_decoder.rs:96— op_figma::vector_decoder::scale_command_path has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (9 pts), boolean chains 8 (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.
op_figma::vector_decoder::assemble_region_paths (cognitive 36) crates/op-figma/src/vector_decoder.rs:627— op_figma::vector_decoder::assemble_region_paths has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (6 pts), boolean chains 3 (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.
op_figma::instance::assignment::seed_assignments_from_instances::collect_geom (cognitive 34) crates/op-figma/src/instance/assignment.rs:127— op_figma::instance::assignment::seed_assignments_from_instances::collect_geom has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (9 pts), boolean chains 4 (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. This shape REPEATS in the file: 2 other methods here (op_figma::instance::assignment::seed_assignments_from_instances, op_figma::instance::assignment::seed_assignments_from_instances::collect) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
op_figma::boolean_fallback::apply_result_paint_to_artwork (cognitive 34) crates/op-figma/src/boolean_fallback.rs:264— op_figma::boolean_fallback::apply_result_paint_to_artwork has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 5 (15 pts), match/switch 1 (nesting depth added 18). 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.
op_figma::instance::assignment::seed_assignments_from_instances::collect (cognitive 31) crates/op-figma/src/instance/assignment.rs:51— op_figma::instance::assignment::seed_assignments_from_instances::collect has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (9 pts), boolean chains 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. This shape REPEATS in the file: 2 other methods here (op_figma::instance::assignment::seed_assignments_from_instances, op_figma::instance::assignment::seed_assignments_from_instances::collect_geom) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
op_figma::instance::fingerprint::assign_pooled (cognitive 30) crates/op-figma/src/instance/fingerprint.rs:346— op_figma::instance::fingerprint::assign_pooled has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::decode_figma_path_blob (cognitive 28) crates/op-figma/src/vector_decoder.rs:193— op_figma::vector_decoder::decode_figma_path_blob has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::scan_numbers (cognitive 28) crates/op-figma/src/vector_decoder.rs:251— op_figma::vector_decoder::scan_numbers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (8 pts), boolean chains 4 (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.
op_figma::clipboard::decode_html_entities (cognitive 28) crates/op-figma/src/clipboard.rs:258— op_figma::clipboard::decode_html_entities has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::swap_filter::filter_swap_stale_derived (cognitive 28) crates/op-figma/src/instance/swap_filter.rs:23— op_figma::instance::swap_filter::filter_swap_stale_derived has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, loops 3, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::apply::merge_entry_lists (cognitive 27) crates/op-figma/src/instance/apply.rs:89— op_figma::instance::apply::merge_entry_lists has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::converters::convert_vector (cognitive 27) crates/op-figma/src/converters.rs:562— op_figma::converters::convert_vector has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::foreign_session::resolve_group (cognitive 23) crates/op-figma/src/instance/foreign_session.rs:72— op_figma::instance::foreign_session::resolve_group has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::collect_top_level_blocks (cognitive 21) crates/op-figma/src/lib.rs:219— op_figma::collect_top_level_blocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (2 pts), 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.
op_figma::container::fig_to_binary_parts (cognitive 21) crates/op-figma/src/container.rs:113— op_figma::container::fig_to_binary_parts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::node_mapper::style_references::resolve_style_references (cognitive 20) crates/op-figma/src/node_mapper/style_references.rs:9— op_figma::node_mapper::style_references::resolve_style_references has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::decode_vector_network_blob (cognitive 20) crates/op-figma/src/vector_decoder.rs:490— op_figma::vector_decoder::decode_vector_network_blob has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_figma::instance::assignment::guessed_mapping_is_implausible (cognitive 18) crates/op-figma/src/instance/assignment.rs:314— op_figma::instance::assignment::guessed_mapping_is_implausible has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2, match/switch 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::decode_figma_vector_path (cognitive 17) crates/op-figma/src/vector_decoder.rs:356— op_figma::vector_decoder::decode_figma_vector_path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (4 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.
op_figma::instance::fingerprint::assign (cognitive 17) crates/op-figma/src/instance/fingerprint.rs:415— op_figma::instance::fingerprint::assign has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (14 lines × 2) crates/op-chat-agent/src/design_agent_tools.rs:79— crates/op-chat-agent/src/design_agent_tools.rs:79-92 | crates/op-chat-agent/src/design_agent_tools.rs:243-256 — both copies are in the same file, so extract the 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) crates/op-cli/src/command_mappers.rs:233— crates/op-cli/src/command_mappers.rs:233-246 | crates/op-cli/src/command_mappers.rs:290-303 — both copies are in the same file, so extract the 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) crates/op-editor-core/src/svg_import/path_data.rs:65— crates/op-editor-core/src/svg_import/path_data.rs:65-78 | crates/op-editor-core/src/svg_path_data.rs:86-99 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 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) crates/op-editor-core/src/command_node/builders.rs:105— crates/op-editor-core/src/command_node/builders.rs:105-118 | crates/op-figma/src/lib.rs:426-440 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) crates/op-editor-core/src/command_node/builders.rs:164— crates/op-editor-core/src/command_node/builders.rs:164-177 | crates/op-figma/src/lib.rs:515-529 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:310— crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:310-323 | crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:205-218 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/scene_template_card_actions.rs:115— crates/op-editor-ui/src/widgets/scene_template_card_actions.rs:115-128 | crates/op-editor-ui/src/widgets/scene_template_touch_density.rs:274-287 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/file_menu_paint.rs:273— crates/op-editor-ui/src/widgets/file_menu_paint.rs:273-286 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:329-342 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:389— crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:389-402 | crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:404-417 — both copies are in the same file, so extract the 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) crates/op-editor-ui/src/widgets/property_panel_widget.rs:201— crates/op-editor-ui/src/widgets/property_panel_widget.rs:201-214 | crates/op-editor-ui/src/widgets/property_panel_widget.rs:241-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/op-engine-ffi/src/lifecycle.rs:607— crates/op-engine-ffi/src/lifecycle.rs:607-620 | crates/op-engine-ffi/src/lifecycle.rs:691-704 — both copies are in the same file, so extract the 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) crates/op-figma/src/node_mapper.rs:121— crates/op-figma/src/node_mapper.rs:121-134 | crates/op-figma/src/node_mapper.rs:189-202 — both copies are in the same file, so extract the 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) crates/op-host-desktop/src/image_search_session.rs:42— crates/op-host-desktop/src/image_search_session.rs:42-55 | crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:141-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:79— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:79-92 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:165-178 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:99— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:99-112 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:334-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/op-host-services/src/web_credentials.rs:285— crates/op-host-services/src/web_credentials.rs:285-298 | crates/op-host-services/src/web_credentials.rs:415-428 — both copies are in the same file, so extract the 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) crates/op-host-services/src/mcp_serve/sniff.rs:135— crates/op-host-services/src/mcp_serve/sniff.rs:135-148 | crates/op-mcp/src/parser.rs:462-475 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) crates/op-host-web/src/dom_io/html_directory_session.rs:348— crates/op-host-web/src/dom_io/html_directory_session.rs:348-361 | crates/op-host-web/src/dom_io/html_zip_session.rs:380-393 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) crates/op-host-web/src/live_sync.rs:193— crates/op-host-web/src/live_sync.rs:193-206 | crates/op-host-web/src/web_image_panel.rs:387-400 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) crates/op-host-web/src/widget_host/variables_panel_rows.rs:184— crates/op-host-web/src/widget_host/variables_panel_rows.rs:184-197 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:288-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/op-html/src/lib.rs:419— crates/op-html/src/lib.rs:419-432 | crates/op-html/src/mapper_grid.rs:126-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) crates/op-html/src/project_zip.rs:213— crates/op-html/src/project_zip.rs:213-226 | crates/op-html/src/project_zip_range.rs:239-252 — before extracting anything, compare `crates/op-html/src/project_zip.rs` and `crates/op-html/src/project_zip_range.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/op-mcp/src/node_attr_tools.rs:209— crates/op-mcp/src/node_attr_tools.rs:209-222 | crates/op-mcp/src/node_attr_tools.rs:345-358 — both copies are in the same file, so extract the 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) crates/op-mcp/src/selected_ops_tools.rs:21— crates/op-mcp/src/selected_ops_tools.rs:21-34 | crates/op-mcp/src/selected_ops_tools.rs: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) crates/op-orchestrator/src/plan.rs:436— crates/op-orchestrator/src/plan.rs:436-449 | crates/op-orchestrator/src/plan_fallback_card.rs:122-135 — before extracting anything, compare `crates/op-orchestrator/src/plan.rs` and `crates/op-orchestrator/src/plan_fallback_card.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
op_mcp::parser::arguments_field (cognitive 113) crates/op-mcp/src/parser.rs:173— op_mcp::parser::arguments_field has cognitive complexity 113 (threshold 15). Drivers by points: if/else 32 (78 pts), loops 9 (21 pts), boolean chains 12, match/switch 1 (2 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::parser::parse_flat_object_body (cognitive 76) crates/op-mcp/src/parser.rs:393— op_mcp::parser::parse_flat_object_body has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (49 pts), loops 7 (16 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::script_runner::repair_truncated_script (cognitive 52) crates/op-mcp/src/script_runner.rs:500— op_mcp::script_runner::repair_truncated_script has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (37 pts), match/switch 3 (8 pts), boolean chains 4, loops 3 (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.
op_mcp::script_runner::balance_brackets (cognitive 44) crates/op-mcp/src/script_runner.rs:412— op_mcp::script_runner::balance_brackets has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 6 (14 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::script_runner_dotted_keys::repair_dotted_object_keys (cognitive 42) crates/op-mcp/src/script_runner_dotted_keys.rs:29— op_mcp::script_runner_dotted_keys::repair_dotted_object_keys has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 4 (10 pts), boolean chains 6 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_program::explicitly_sized_append_lines (cognitive 38) crates/op-mcp/src/batch_program.rs:381— op_mcp::batch_program::explicitly_sized_append_lines has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 2 (3 pts), boolean chains 2 (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.
op_mcp::script_runner::escape_raw_newlines_in_quoted_strings (cognitive 35) crates/op-mcp/src/script_runner.rs:180— op_mcp::script_runner::escape_raw_newlines_in_quoted_strings has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::codegen_plan_store::validate_plan (cognitive 34) crates/op-mcp/src/codegen_plan_store.rs:173— op_mcp::codegen_plan_store::validate_plan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 8 (16 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.
op_mcp::batch_get::resolve_refs_in_node (cognitive 29) crates/op-mcp/src/batch_get.rs:171— op_mcp::batch_get::resolve_refs_in_node has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (10 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.
op_mcp::batch_program_exec_ops::execute_image (cognitive 28) crates/op-mcp/src/batch_program_exec_ops.rs:230— op_mcp::batch_program_exec_ops::execute_image has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_layered_guidelines::generate_section_guidelines (cognitive 27) crates/op-mcp/src/batch_layered_guidelines.rs:7— op_mcp::batch_layered_guidelines::generate_section_guidelines has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 12 (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.
op_mcp::batch_design_wire::capture_raw_json_value (cognitive 26) crates/op-mcp/src/batch_design_wire.rs:173— op_mcp::batch_design_wire::capture_raw_json_value has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 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.
op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect (cognitive 25) crates/op-mcp/src/batch_design_normalize.rs:83— op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (7 pts), loops 2 (3 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.
op_mcp::codegen_plan_store::submit_chunk_result (cognitive 23) crates/op-mcp/src/codegen_plan_store.rs:514— op_mcp::codegen_plan_store::submit_chunk_result has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design_dsl::assemble_insert_forest (cognitive 22) crates/op-mcp/src/batch_design_dsl.rs:71— op_mcp::batch_design_dsl::assemble_insert_forest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (7 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_program_parse::replace_single_quote_delimiters (cognitive 21) crates/op-mcp/src/batch_program_parse.rs:162— op_mcp::batch_program_parse::replace_single_quote_delimiters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design_wire::parse_item (cognitive 21) crates/op-mcp/src/batch_design_wire.rs:70— op_mcp::batch_design_wire::parse_item has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, match/switch 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.
op_mcp::batch_design::dispatch_batch_design (cognitive 21) crates/op-mcp/src/batch_design.rs:180— op_mcp::batch_design::dispatch_batch_design has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::codegen_plan_store_assembly::assemble_plan (cognitive 20) crates/op-mcp/src/codegen_plan_store_assembly.rs:13— op_mcp::codegen_plan_store_assembly::assemble_plan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design_wire::parse_string (cognitive 18) crates/op-mcp/src/batch_design_wire.rs:281— op_mcp::batch_design_wire::parse_string has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::script_runner_dotted_keys::dotted_key_at (cognitive 17) crates/op-mcp/src/script_runner_dotted_keys.rs:117— op_mcp::script_runner_dotted_keys::dotted_key_at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (5 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.
op_mcp::batch_design_fill_normalize::normalize_fill_item (cognitive 17) crates/op-mcp/src/batch_design_fill_normalize.rs:19— op_mcp::batch_design_fill_normalize::normalize_fill_item has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::parser::params_body_if_present (cognitive 17) crates/op-mcp/src/parser.rs:339— op_mcp::parser::params_body_if_present has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 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.
op_mcp::tool_search::keyword_search (cognitive 16) crates/op-mcp/src/tool_search.rs:88— op_mcp::tool_search::keyword_search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design_dsl::split_operations (cognitive 16) crates/op-mcp/src/batch_design_dsl.rs:212— op_mcp::batch_design_dsl::split_operations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, 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.
Duplicated block (16 lines × 2) crates/op-ai/src/agent_settings_state.rs:148— crates/op-ai/src/agent_settings_state.rs:148-163 | crates/op-editor-core/src/agent_settings.rs:144-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:514— crates/op-auth-bridge/src/collab_claims.rs:514-529 | crates/op-collab/src/profile_validation.rs:109-124 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab/src/profile_validation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 (16 lines × 2) crates/op-cli/src/html_cli.rs:237— crates/op-cli/src/html_cli.rs:237-252 | crates/op-host-desktop/src/html_import_session.rs:191-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) crates/op-editor-core/src/pen.rs:283— crates/op-editor-core/src/pen.rs:283-298 | crates/op-editor-core/src/pen.rs:332-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-editor-core/src/ref_resolve.rs:342— crates/op-editor-core/src/ref_resolve.rs:342-357 | crates/op-editor-core/src/ref_resolve.rs:449-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-editor-core/src/fills/primary.rs:65— crates/op-editor-core/src/fills/primary.rs:65-80 | crates/op-editor-core/src/fills/primary.rs:91-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-editor-ui/src/widgets/toolbar.rs:136— crates/op-editor-ui/src/widgets/toolbar.rs:136-151 | crates/op-editor-ui/src/widgets/toolbar.rs:154-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:601— crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:601-616 | crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:693-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:130— crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:130-145 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:671-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-engine-ffi/src/lifecycle.rs:555— crates/op-engine-ffi/src/lifecycle.rs:555-570 | crates/op-engine-ffi/src/lifecycle.rs:649-664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-host-desktop/src/persistence.rs:249— crates/op-host-desktop/src/persistence.rs:249-264 | crates/op-host-desktop/src/persistence.rs:273-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:379— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:379-394 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:321-336 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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 (16 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:327— crates/op-host-native/src/widget_host/preview_slideshow.rs:327-342 | crates/op-host-web/src/widget_host/preview_slideshow.rs:482-497 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 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 (16 lines × 2) crates/op-host-services/src/export_html_structured.rs:291— crates/op-host-services/src/export_html_structured.rs:291-306 | crates/op-host-services/src/export_pptx.rs:444-461 — before extracting anything, compare `crates/op-host-services/src/export_html_structured.rs` and `crates/op-host-services/src/export_pptx.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/op-html/src/css/cascade_parser.rs:392— crates/op-html/src/css/cascade_parser.rs:392-407 | crates/op-html/src/css/cascade_shared.rs:11-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) crates/op-html/src/css/cascade_parser.rs:396— crates/op-html/src/css/cascade_parser.rs:396-411 | crates/op-html/src/css/cascade_shared.rs:46-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) crates/op-html/src/dom.rs:322— crates/op-html/src/dom.rs:322-337 | crates/op-html/src/srcset.rs:412-427 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) crates/op-html/src/special_image.rs:141— crates/op-html/src/special_image.rs:141-156 | crates/op-html/src/special_image.rs:216-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-html/src/text_children.rs:413— crates/op-html/src/text_children.rs:413-428 | crates/op-html/src/text_children.rs:514-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-orchestrator/src/card_inner_padding.rs:283— crates/op-orchestrator/src/card_inner_padding.rs:283-298 | crates/op-orchestrator/src/touch_target_floor.rs:236-251 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:131— crates/op-host-native/src/widget_host/preview_slideshow.rs:131-146 | crates/op-host-web/src/widget_host/preview_slideshow.rs:282-297 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 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 (16 lines × 2) crates/op-editor-ui/src/widgets/file_menu_paint.rs:52— crates/op-editor-ui/src/widgets/file_menu_paint.rs:52-67 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:74-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:74— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:74-89 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:165-180 — before extracting anything, compare `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt` and `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:174— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:174-189 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:239-254 — before extracting anything, compare `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt` and `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:174` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) packaging/ios/Sources/NativeLoginViewController.swift:638— packaging/ios/Sources/NativeLoginViewController.swift:638-653 | packaging/ios/Sources/UpdateChecker.swift:83-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/ios/Sources/NativeLoginViewController.swift:638` it begins part-way through the construct above it, so those exact lines 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) crates/op-collab-relay-control-plane/src/http_client.rs:203— crates/op-collab-relay-control-plane/src/http_client.rs:203-215 | crates/op-collab-relay-locator-server/src/http.rs:571-583 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/op-editor-core/src/text_edit.rs:81— crates/op-editor-core/src/text_edit.rs:81-93 | crates/op-editor-core/src/text_edit.rs:143-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-editor-host-core/src/settings_io.rs:332— crates/op-editor-host-core/src/settings_io.rs:332-344 | crates/op-host-web/src/web_settings.rs:415-427 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/account_menu.rs:223— crates/op-editor-ui/src/widgets/account_menu.rs:223-235 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:257-269 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_panel_header.rs:452— crates/op-editor-ui/src/widgets/ai_chat_panel_header.rs:452-464 | crates/op-editor-ui/src/widgets/ai_chat_panel_header.rs:467-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:196— crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:196-208 | crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:218-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:160— crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:160-172 | crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:189-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:439— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:439-451 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:447-459 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_art_screens.rs:18— crates/op-editor-ui/src/widgets/home_surface_paint_art_screens.rs:18-30 | crates/op-editor-ui/src/widgets/home_surface_paint_art_screens.rs:148-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-engine-ffi/src/editor_chat.rs:417— crates/op-engine-ffi/src/editor_chat.rs:417-429 | crates/op-host-desktop/src/chat_session.rs:354-369 — before extracting anything, compare `crates/op-engine-ffi/src/editor_chat.rs` and `crates/op-host-desktop/src/chat_session.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/op-figma/src/image_resolver.rs:514— crates/op-figma/src/image_resolver.rs:514-526 | crates/op-figma/src/image_resolver.rs:546-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-host-desktop/src/mcp_config_io.rs:134— crates/op-host-desktop/src/mcp_config_io.rs:134-146 | crates/op-host-desktop/src/mcp_integrations_dsh.rs:110-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:334— crates/op-host-native/src/widget_host/slides_panel.rs:334-346 | crates/op-host-web/src/widget_host/slides_panel.rs:225-237 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:104— crates/op-host-native/src/widget_host/preview_slideshow.rs:104-116 | crates/op-host-web/src/widget_host/preview_slideshow.rs:256-268 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/op-host-services/src/web_canvas_server/online_run_loop.rs:226— crates/op-host-services/src/web_canvas_server/online_run_loop.rs:226-238 | crates/op-host-services/src/web_canvas_server/run_loop.rs:160-172 — before extracting anything, compare `crates/op-host-services/src/web_canvas_server/online_run_loop.rs` and `crates/op-host-services/src/web_canvas_server/run_loop.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/op-host-services/src/cli_model_discovery.rs:217— crates/op-host-services/src/cli_model_discovery.rs:217-229 | crates/op-host-services/src/cli_model_discovery_antigravity.rs:57-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/op-host-services/src/web_canvas_server/online_run_loop.rs:602— crates/op-host-services/src/web_canvas_server/online_run_loop.rs:602-614 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:618-630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-orchestrator/src/cleanup_slide_padding.rs:254— crates/op-orchestrator/src/cleanup_slide_padding.rs:254-266 | crates/op-orchestrator/src/cleanup_slide_padding.rs:357-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-orchestrator/src/finalize_enforce_status_bar.rs:168— crates/op-orchestrator/src/finalize_enforce_status_bar.rs:168-180 | crates/op-orchestrator/src/finalize_enforce_status_bar.rs:232-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.
Duplicated block (13 lines × 2) crates/op-preview-core/src/motion.rs:388— crates/op-preview-core/src/motion.rs:388-400 | crates/op-preview-core/src/motion.rs:427-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-host-web/src/dom_io/html_directory_session.rs:363— crates/op-host-web/src/dom_io/html_directory_session.rs:363-375 | crates/op-host-web/src/dom_io/html_zip_session.rs:402-414 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/op-orchestrator/src/validation_fixes_apply.rs:343— crates/op-orchestrator/src/validation_fixes_apply.rs:343-355 | crates/op-orchestrator/src/validation_fixes_apply.rs:382-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/component_browser_panel.rs:550— crates/op-editor-ui/src/widgets/component_browser_panel.rs:550-562 | crates/op-editor-ui/src/widgets/icon_picker_panel.rs:331-343 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) templates/step0/_generators/tpl_tutorial_storage.py:229— templates/step0/_generators/tpl_tutorial_storage.py:229-242 | templates/step0/_generators/tpl_tutorial_workout.py:230-242 — 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 `templates/step0/_generators/tpl_tutorial_storage.py:229` 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) crates/op-preview-core/src/tests_binding_overlay.rs:230— crates/op-preview-core/src/tests_binding_overlay.rs:230-242 | crates/op-preview-core/src/tests_device_frame.rs:18-30 — 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.
R4 · Test Coverage· No test reaches this file · ×24
No test reaches this file crates/op-host-web/src/op_ck_bridge.js— 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 test reaches this file crates/op-html/assets/snapshot-extractor.js— 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 test reaches this file packages/op-chrome-extension/popup.js— 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 test reaches this file packages/op-chrome-extension/design-capture.js— 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 test reaches this file packages/op-chrome-extension/client.js— 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 test reaches this file crates/op-host-web/src/figma_temp_worker.js— 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 test reaches this file packages/op-chrome-extension/background.js— 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 test reaches this file crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js— 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 test reaches this file crates/op-host-web/src/op_ck_image_cache.js— 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 test reaches this file packages/op-chrome-extension/picker.js— 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 test reaches this file packages/op-chrome-extension/capture.js— 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 test reaches this file packages/op-chrome-extension/i18n.js— 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 test reaches this file packages/op-chrome-extension/account.js— 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 test reaches this file packages/op-chrome-extension/design-evidence.js— 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 test reaches this file packages/op-chrome-extension/scripts/check-locales.mjs— 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 test reaches this file packages/op-chrome-extension/scripts/check-design-evidence.mjs— 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 test reaches this file packages/op-chrome-extension/popup-status.js— 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 test reaches this file REDACTED— 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 test reaches this file packages/op-chrome-extension/scripts/check-sw-imports.mjs— 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 test reaches this file packages/op-chrome-extension/core-registry.js— 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 test reaches this file packages/op-chrome-extension/design-md.js— 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 test reaches this file packages/op-chrome-extension/wasm-core.js— 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 test reaches this file packages/op-vscode/build.mjs— 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 test reaches this file packages/op-chrome-extension/popup-worker-actions.js— 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.
WidgetHost::apply_cursor_move (cyclomatic 148) crates/op-host-web/src/widget_host/cursor_input.rs:17— WidgetHost::apply_cursor_move has cyclomatic complexity 148 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHost::apply_overlay_cursor_move (cyclomatic 53) crates/op-host-web/src/widget_host/overlay_cursor.rs:96— WidgetHost::apply_overlay_cursor_move has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHost::paint_editor (cyclomatic 51) crates/op-host-web/src/widget_host/paint.rs:49— WidgetHost::paint_editor has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHost::update_agent_settings_hover (cyclomatic 43) crates/op-host-web/src/widget_host/agent_settings_hover.rs:14— WidgetHost::update_agent_settings_hover has cyclomatic complexity 43 (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.
WidgetHost::apply_escape (cyclomatic 41) crates/op-host-web/src/widget_host/keyboard_escape.rs:16— WidgetHost::apply_escape has cyclomatic complexity 41 (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.
WidgetHost::apply_backspace (cyclomatic 32) crates/op-host-web/src/widget_host/keyboard.rs:133— WidgetHost::apply_backspace 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.
WidgetHost::apply_text (cyclomatic 27) crates/op-host-web/src/widget_host/keyboard.rs:17— WidgetHost::apply_text has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_delete (cyclomatic 25) crates/op-host-web/src/widget_host/keyboard.rs:348— WidgetHost::apply_delete 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.
WidgetHost::update_dropdown_hover (cyclomatic 25) crates/op-host-web/src/widget_host/overlay_cursor.rs:469— WidgetHost::update_dropdown_hover 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.
WidgetHost::focused_input_selected_text (cyclomatic 24) crates/op-host-web/src/widget_host/keyboard_text_inputs.rs:143— WidgetHost::focused_input_selected_text has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_release_with_viewport (cyclomatic 24) crates/op-host-web/src/widget_host/release_input.rs:36— WidgetHost::apply_release_with_viewport has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_send (cyclomatic 22) crates/op-host-web/src/widget_host/keyboard.rs:251— WidgetHost::apply_send 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.
WidgetHost::paint_menu_modal_and_panel_layers (cyclomatic 21) crates/op-host-web/src/widget_host/paint_overlays.rs:23— WidgetHost::paint_menu_modal_and_panel_layers has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_release (cyclomatic 20) crates/op-host-web/src/widget_host/release_input.rs:132— WidgetHost::apply_release 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.
WidgetHost::apply_wheel_with_canvas_delta (cyclomatic 19) crates/op-host-web/src/widget_host/wheel_pan.rs:169— WidgetHost::apply_wheel_with_canvas_delta has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_git_text (cyclomatic 18) crates/op-host-web/src/widget_host/keyboard_git.rs:7— WidgetHost::apply_git_text 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.
WidgetHost::apply_press (cyclomatic 18) crates/op-host-web/src/widget_host/press.rs:130— WidgetHost::apply_press 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.
WidgetHost::apply_pan_gesture (cyclomatic 18) crates/op-host-web/src/widget_host/wheel_pan.rs:256— WidgetHost::apply_pan_gesture 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.
WidgetHost::dispatch_file_menu_press (cyclomatic 17) crates/op-host-web/src/widget_host/chrome_menu_press.rs:13— WidgetHost::dispatch_file_menu_press has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHost::apply_git_send (cyclomatic 17) crates/op-host-web/src/widget_host/keyboard_git.rs:162— WidgetHost::apply_git_send 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.
WidgetHost::press_topmost_overlay_tiers (cyclomatic 17) crates/op-host-web/src/widget_host/press_overlay_tiers.rs:17— WidgetHost::press_topmost_overlay_tiers 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.
WidgetHost::press_top_bar_tier (cyclomatic 16) crates/op-host-web/src/widget_host/press_chrome_tiers.rs:124— WidgetHost::press_top_bar_tier 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.
op_host_services::mcp_serve::registry::rebuild_registry (cyclomatic 143) crates/op-host-services/src/mcp_serve/registry.rs:9— op_host_services::mcp_serve::registry::rebuild_registry has cyclomatic complexity 143 (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.
op_host_services::chat_http_server::run_opencode_turn (cyclomatic 58) crates/op-host-services/src/chat_http_server.rs:246— op_host_services::chat_http_server::run_opencode_turn has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_host_services::web_canvas_server::connection::dispatch (cyclomatic 57) crates/op-host-services/src/web_canvas_server/connection.rs:101— op_host_services::web_canvas_server::connection::dispatch has cyclomatic complexity 57 (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.
op_host_services::mcp_serve::sniff::walk_top_level (cyclomatic 41) crates/op-host-services/src/mcp_serve/sniff.rs:57— op_host_services::mcp_serve::sniff::walk_top_level 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.
op_host_services::web_canvas_server::handle_web_canvas_request (cyclomatic 39) crates/op-host-services/src/web_canvas_server.rs:460— op_host_services::web_canvas_server::handle_web_canvas_request has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_services::mcp_serve::read_http_request (cyclomatic 31) crates/op-host-services/src/mcp_serve.rs:403— op_host_services::mcp_serve::read_http_request has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_host_services::export_pptx::unexpressible (cyclomatic 26) crates/op-host-services/src/export_pptx.rs:365— op_host_services::export_pptx::unexpressible has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_host_services::mcp_live::connection::serve_connection (cyclomatic 23) crates/op-host-services/src/mcp_live/connection.rs:113— op_host_services::mcp_live::connection::serve_connection 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.
op_host_services::cli_model_discovery_antigravity::parse_antigravity_models (cyclomatic 22) crates/op-host-services/src/cli_model_discovery_antigravity.rs:35— op_host_services::cli_model_discovery_antigravity::parse_antigravity_models 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.
op_host_services::chat_claude::map_message (cyclomatic 21) crates/op-host-services/src/chat_claude.rs:349— op_host_services::chat_claude::map_message 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.
op_host_services::cli_model_discovery::parse_grok_models (cyclomatic 21) crates/op-host-services/src/cli_model_discovery.rs:210— op_host_services::cli_model_discovery::parse_grok_models 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.
op_host_services::ai_proxy::proxy_builtin_for_identity (cyclomatic 20) crates/op-host-services/src/ai_proxy.rs:359— op_host_services::ai_proxy::proxy_builtin_for_identity 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.
op_host_services::web_credentials::validate_and_merge (cyclomatic 20) crates/op-host-services/src/web_credentials.rs:303— op_host_services::web_credentials::validate_and_merge 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.
op_host_services::design_md_evidence::evidence_provenance (cyclomatic 19) crates/op-host-services/src/design_md_evidence.rs:416— op_host_services::design_md_evidence::evidence_provenance 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.
op_host_services::design_md_evidence::validate_evidence (cyclomatic 19) crates/op-host-services/src/design_md_evidence.rs:535— op_host_services::design_md_evidence::validate_evidence 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.
op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route (cyclomatic 18) crates/op-host-services/src/web_canvas_server/connection_ai_routes.rs:38— op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_services::export_html_structured::unexpressible (cyclomatic 18) crates/op-host-services/src/export_html_structured.rs:232— op_host_services::export_html_structured::unexpressible 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.
op_host_services::web_canvas_server::run_loop::run_web_canvas (cyclomatic 17) crates/op-host-services/src/web_canvas_server/run_loop.rs:28— op_host_services::web_canvas_server::run_loop::run_web_canvas 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.
op_host_services::design_md_evidence_roles::from_sanitized_json (cyclomatic 16) crates/op-host-services/src/design_md_evidence_roles.rs:11— op_host_services::design_md_evidence_roles::from_sanitized_json 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.
op_host_services::chat_subprocess_parse::parse_line (cyclomatic 16) crates/op-host-services/src/chat_subprocess_parse.rs:10— op_host_services::chat_subprocess_parse::parse_line has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_html::css::selectors::pseudo_matches (cyclomatic 36) crates/op-html/src/css/selectors.rs:263— op_html::css::selectors::pseudo_matches has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_html::mapper_margin::finish_children (cyclomatic 28) crates/op-html/src/mapper_margin.rs:166— op_html::mapper_margin::finish_children has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_html::css::declarations::expand_background (cyclomatic 26) crates/op-html/src/css/declarations.rs:359— op_html::css::declarations::expand_background 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. This is NOT this file's highest cyclomatic complexity: op_html::css::declarations::expand_declaration (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_html::project_zip_range::parse_html_zip_central_directory (cyclomatic 24) crates/op-html/src/project_zip_range.rs:160— op_html::project_zip_range::parse_html_zip_central_directory 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.
op_html::transform::function_matrix (cyclomatic 23) crates/op-html/src/transform.rs:400— op_html::transform::function_matrix has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_html::css::declaration_syntax::split_whitespace_top_level (cyclomatic 22) crates/op-html/src/css/declaration_syntax.rs:215— op_html::css::declaration_syntax::split_whitespace_top_level 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.
op_html::mapper_visual::map_gradient (cyclomatic 20) crates/op-html/src/mapper_visual.rs:307— op_html::mapper_visual::map_gradient 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.
op_html::mapper_grid::wrap_grid_rows (cyclomatic 20) crates/op-html/src/mapper_grid.rs:27— op_html::mapper_grid::wrap_grid_rows 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.
op_html::srcset::parse_srcset (cyclomatic 19) crates/op-html/src/srcset.rs:188— op_html::srcset::parse_srcset 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.
op_html::html_encoding::encoding_from_meta_attributes (cyclomatic 19) crates/op-html/src/html_encoding.rs:73— op_html::html_encoding::encoding_from_meta_attributes 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.
op_html::special_image::apply_intrinsic_axes (cyclomatic 18) crates/op-html/src/special_image.rs:241— op_html::special_image::apply_intrinsic_axes 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.
op_html::special_image::parent_content_box (cyclomatic 18) crates/op-html/src/special_image.rs:354— op_html::special_image::parent_content_box has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_html::resources_css_urls::unescape_css (cyclomatic 18) crates/op-html/src/resources_css_urls.rs:213— op_html::resources_css_urls::unescape_css 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.
op_html::mapper_grid::top_level_tokens (cyclomatic 17) crates/op-html/src/mapper_grid.rs:518— op_html::mapper_grid::top_level_tokens 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.
op_html::import_html_with_resources (cyclomatic 17) crates/op-html/src/lib.rs:188— op_html::import_html_with_resources 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.
op_html::css::declaration_syntax::split_top_level (cyclomatic 17) crates/op-html/src/css/declaration_syntax.rs:169— op_html::css::declaration_syntax::split_top_level 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. This shape REPEATS in the file: one other method here (op_html::css::declaration_syntax::find_top_level) 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.
op_html::css::declaration_syntax::find_top_level (cyclomatic 17) crates/op-html/src/css/declaration_syntax.rs:287— op_html::css::declaration_syntax::find_top_level 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. This shape REPEATS in the file: one other method here (op_html::css::declaration_syntax::split_top_level) 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.
op_html::mapper_visual_syntax::split_whitespace_top_level (cyclomatic 17) crates/op-html/src/mapper_visual_syntax.rs:88— op_html::mapper_visual_syntax::split_whitespace_top_level 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.
op_html::css::cascade::compute_raw (cyclomatic 16) crates/op-html/src/css/cascade.rs:392— op_html::css::cascade::compute_raw 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.
op_html::css::selectors::attribute_matches (cyclomatic 16) crates/op-html/src/css/selectors.rs:233— op_html::css::selectors::attribute_matches has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Off the main sequence: @zseven-w/op-web-sdk — @zseven-w/op-web-sdk: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: op-config-store — op-config-store: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: op-figma — op-figma: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: op-i18n — op-i18n: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: op-opmerge — op-opmerge: 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: op-preview-contracts — op-preview-contracts: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: op-process-io — op-process-io: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: op-rpc-transport — op-rpc-transport: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: op-util — op-util: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
Off the main sequence: op-collab-relay-protocol — op-collab-relay-protocol: abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: op-auth-bridge — op-auth-bridge: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
Off the main sequence: op-ai-skills — op-ai-skills: abstractness 0.00, instability 0.09, distance 0.91 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
Off the main sequence: op-ai — op-ai: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
Off the main sequence: op-pen-loader — op-pen-loader: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
Off the main sequence: op-editor-core — op-editor-core: abstractness 0.01, instability 0.13, distance 0.86 — zone of pain — concrete and depended on by 20 project(s), so it's rigid to change.
Off the main sequence: op-html — op-html: abstractness 0.00, instability 0.14, distance 0.86 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: op-collab — op-collab: abstractness 0.00, instability 0.17, distance 0.83 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: op-design-lint — op-design-lint: abstractness 0.00, instability 0.17, distance 0.83 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: op-collab-transport — op-collab-transport: abstractness 0.05, instability 0.20, distance 0.75 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: op-editor-ui — op-editor-ui: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 12 project(s), so it's rigid to change.
TooManyFunctions: op_chrome_extension_core::wasm_api crates/op-chrome-extension-core/src/wasm_api.rs:29— TooManyFunctions — 59 free functions. The bar is 30 free functions; this is 29 over it, 1.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.
TooManyFunctions: op_engine_napi::bindings_editor crates/op-engine-napi/src/bindings_editor.rs:27— TooManyFunctions — 45 free functions. The bar is 30 free functions; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_editor_core::host_keyboard_transitions crates/op-editor-core/src/host_keyboard_transitions.rs:47— TooManyFunctions — 38 free functions. The bar is 30 free functions; this is 8 over it, 1.27× 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.
TooManyFunctions: op_cli::app_control_cli crates/op-cli/src/app_control_cli.rs:45— TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_design_lint::node_util crates/op-design-lint/src/node_util.rs:65— TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::validation_dump crates/op-orchestrator/src/validation_dump.rs:23— TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_html::color crates/op-html/src/color.rs:11— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_html::css::selectors crates/op-html/src/css/selectors.rs:68— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::motion_recipes crates/op-orchestrator/src/motion_recipes.rs:38— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_editor_core::agent_indicators crates/op-editor-core/src/agent_indicators.rs:136— TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_editor_core::command_style_replace crates/op-editor-core/src/command_style_replace.rs:95— TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_host_desktop::mcp_integrations crates/op-host-desktop/src/mcp_integrations.rs:22— TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::orchestration_self_check crates/op-orchestrator/src/orchestration_self_check.rs:46— TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_host_web::web_fonts crates/op-host-web/src/web_fonts.rs:24— TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_chrome_extension_core::design_md_validate crates/op-chrome-extension-core/src/design_md_validate.rs:16— TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::cleanup_mobile_chrome crates/op-orchestrator/src/cleanup_mobile_chrome.rs:17— TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::table_repair crates/op-orchestrator/src/table_repair.rs:27— TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_design_lint::detectors::spacing crates/op-design-lint/src/detectors/spacing.rs:54— TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
op_editor_core::variables_resolve::replace::replace_in_node (cyclomatic 30) crates/op-editor-core/src/variables_resolve/replace.rs:43— op_editor_core::variables_resolve::replace::replace_in_node has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_core::svg_import::path_data::parse_path_d (cyclomatic 30) crates/op-editor-core/src/svg_import/path_data.rs:12— op_editor_core::svg_import::path_data::parse_path_d has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_core::variables_resolve::resolve_node_for_canvas (cyclomatic 28) crates/op-editor-core/src/variables_resolve.rs:236— op_editor_core::variables_resolve::resolve_node_for_canvas has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_core::svg_path_data::absolute_segments (cyclomatic 27) crates/op-editor-core/src/svg_path_data.rs:55— op_editor_core::svg_path_data::absolute_segments has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_core::host_settings_commit::commit_settings_focus (cyclomatic 26) crates/op-editor-core/src/host_settings_commit.rs:48— op_editor_core::host_settings_commit::commit_settings_focus 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.
op_editor_core::svg_import::style::parse_svg_color (cyclomatic 22) crates/op-editor-core/src/svg_import/style.rs:147— op_editor_core::svg_import::style::parse_svg_color has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_core::svg_import::scale::scale_svg_path (cyclomatic 20) crates/op-editor-core/src/svg_import/scale.rs:46— op_editor_core::svg_import::scale::scale_svg_path 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.
op_editor_core::scene_template_catalog::parse_scene_template_catalogue (cyclomatic 19) crates/op-editor-core/src/scene_template_catalog.rs:661— op_editor_core::scene_template_catalog::parse_scene_template_catalogue has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: op_editor_core::scene_template_catalog::scene_template_document_route (cyclomatic 81) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_editor_core::svg_import::lexer::parse_attrs (cyclomatic 19) crates/op-editor-core/src/svg_import/lexer.rs:87— op_editor_core::svg_import::lexer::parse_attrs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_editor_core::command_style_replace::apply_replacement (cyclomatic 19) crates/op-editor-core/src/command_style_replace.rs:185— op_editor_core::command_style_replace::apply_replacement 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.
op_editor_core::host_variables_commit::commit_row_draft (cyclomatic 19) crates/op-editor-core/src/host_variables_commit.rs:231— op_editor_core::host_variables_commit::commit_row_draft 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.
op_editor_core::icon_path_normalize::absolute_segments (cyclomatic 18) crates/op-editor-core/src/icon_path_normalize.rs:306— op_editor_core::icon_path_normalize::absolute_segments 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.
op_editor_core::prompt_center_catalog::parse_prompt_catalogue (cyclomatic 18) crates/op-editor-core/src/prompt_center_catalog.rs:285— op_editor_core::prompt_center_catalog::parse_prompt_catalogue 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.
op_editor_core::instance_override::route_display_state (cyclomatic 17) crates/op-editor-core/src/instance_override.rs:335— op_editor_core::instance_override::route_display_state 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.
op_editor_core::svg_path_data::tokenize_path (cyclomatic 16) crates/op-editor-core/src/svg_path_data.rs:416— op_editor_core::svg_path_data::tokenize_path 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.
op_editor_core::variables_resolve::roots_have_tokens::node_has_token (cyclomatic 16) crates/op-editor-core/src/variables_resolve.rs:358— op_editor_core::variables_resolve::roots_have_tokens::node_has_token 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.
op_editor_core::svg_import::path_data::tokenize_path (cyclomatic 16) crates/op-editor-core/src/svg_import/path_data.rs:270— op_editor_core::svg_import::path_data::tokenize_path 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.
TooManyFields: EditorUiState crates/op-editor-core/src/editor_ui_state.rs:44— TooManyFields — 220 stored fields beside 97 methods. The bar is 30 stored fields; this is 190 over it, 7.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: DesktopApp crates/op-host-desktop/src/main.rs:168— TooManyFields — 82 stored fields beside 158 methods. The bar is 30 stored fields; this is 52 over it, 2.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WidgetHostNative crates/op-host-native/src/widget_host.rs:310— TooManyFields — 79 stored fields beside 652 methods. The bar is 30 stored fields; this is 49 over it, 2.63× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PropertyPanel crates/op-editor-ui/src/widgets/property_panel.rs:80— TooManyFields — 73 stored fields beside 87 methods. The bar is 30 stored fields; this is 43 over it, 2.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: NodePayload crates/op-pen-loader/src/payload.rs:66— TooManyFields — 62 stored fields. The bar is 30 stored fields; this is 32 over it, 2.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WidgetHost crates/op-host-web/src/widget_host.rs:245— TooManyFields — 61 stored fields beside 427 methods. The bar is 30 stored fields; this is 31 over it, 2.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AgentSettings crates/op-editor-core/src/agent_settings.rs:254— TooManyFields — 61 stored fields beside 69 methods. The bar is 30 stored fields; this is 31 over it, 2.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: GitPanelState crates/op-editor-core/src/editor_ui_state/git_panel.rs:352— TooManyFields — 52 stored fields beside 5 methods. The bar is 30 stored fields; this is 22 over it, 1.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: NodeSnapshot crates/op-editor-ui/src/widgets/property_panel_snapshot.rs:81— TooManyFields — 46 stored fields. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: StudioPalette crates/op-editor-ui/src/widgets/home_surface_palette.rs:9— TooManyFields — 41 stored fields beside 3 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: VisibleSections crates/op-editor-ui/src/widgets/property_panel_visibility.rs:218— TooManyFields — 41 stored fields. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: HomeLayout crates/op-editor-ui/src/widgets/home_surface_layout.rs:93— TooManyFields — 37 stored fields beside 2 methods. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CollabRuntime crates/op-collab-host/src/runtime.rs:72— TooManyFields — 33 stored fields beside 101 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AIChatPlaceholder crates/op-editor-ui/src/widgets/ai_chat_panel.rs:87— TooManyFields — 33 stored fields beside 51 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PropertyLabels crates/op-editor-ui/src/widgets/property_panel_sections.rs:58— TooManyFields — 33 stored fields beside 1 method. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: GuestSessionCore crates/op-collab/src/guest.rs:34— TooManyFields — 31 stored fields beside 47 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ChatState crates/op-editor-core/src/chat.rs:156— TooManyFields — 31 stored fields beside 41 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
ClassTooLong: CanvasKitBackend crates/op-host-web/src/canvaskit/backend.rs:24— ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 10 methods, 2 blocks, lines 24-716. The bar is 400 significant lines; this is 147 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CollabRuntime crates/op-collab-host/src/runtime.rs:72— ClassTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 101 methods, 3 blocks, lines 72-799. The bar is 400 significant lines; this is 126 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NativeFrameBackend crates/op-host-native/src/backend/frame_backend.rs:14— ClassTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 2 blocks, lines 14-710. The bar is 400 significant lines; this is 112 over it, 1.28× 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: OpEngineHost packaging/ios/Sources/OpEngineHost.swift:6— ClassTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 105 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OpPlayerView packaging/ios/Sources/OpPlayerView.swift:10— ClassTooLong — 487 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 87 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LayerPanel crates/op-editor-ui/src/widgets/layer_panel.rs:78— ClassTooLong — 471 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 3 blocks, lines 78-793. The bar is 400 significant lines; this is 71 over it, 1.18× 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: NativeLoginViewController packaging/ios/Sources/NativeLoginViewController.swift:16— ClassTooLong — 467 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 67 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CollabPanel crates/op-editor-ui/src/widgets/collab_panel.rs:81— ClassTooLong — 450 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 27 methods, 3 blocks, lines 81-648. The bar is 400 significant lines; this is 50 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Icon crates/op-editor-ui/src/widgets/icons.rs:33— ClassTooLong — 449 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 2 blocks, lines 33-608. The bar is 400 significant lines; this is 49 over it, 1.12× 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: CodegenPipeline crates/op-codegen/src/ai/pipeline.rs:65— ClassTooLong — 444 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 2 blocks, lines 65-751. The bar is 400 significant lines; this is 44 over it, 1.11× 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: MainActivity packaging/android/app/src/main/kotlin/tech/zseven/openpencil/MainActivity.kt:43— ClassTooLong — 438 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 38 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ConnectionDriver crates/op-collab-transport/src/driver.rs:129— ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 3 blocks, lines 129-687. The bar is 400 significant lines; this is 32 over it, 1.08× 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: OpSurfaceView packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt:44— ClassTooLong — 422 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 22 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VariablesPanel crates/op-editor-ui/src/widgets/variables_panel.rs:127— ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 3 blocks, lines 127-776. The bar is 400 significant lines; this is 21 over it, 1.05× 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: Session crates/op-engine-ffi/src/lifecycle.rs:29— ClassTooLong — 419 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods, 2 blocks, lines 29-718. The bar is 400 significant lines; this is 19 over it, 1.05× 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: SubprocessProvider crates/op-host-services/src/chat_subprocess.rs:64— ClassTooLong — 416 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 4 blocks, lines 64-792. The bar is 400 significant lines; this is 16 over it, 1.04× 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: NativeLoginOverlay packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:36— ClassTooLong — 404 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 4 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (15 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:65— crates/op-collab-host/src/runtime/network/connection.rs:65-79 | crates/op-collab-host/src/runtime/network/connection.rs:218-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:76— crates/op-collab-smoke/src/fault_guest.rs:76-90 | crates/op-collab-smoke/src/fault_guest.rs:151-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:453— crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:453-467 | crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:226-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) crates/op-engine-ffi/src/editor_model_discovery.rs:84— crates/op-engine-ffi/src/editor_model_discovery.rs:84-98 | crates/op-host-desktop/src/builtin_model_refresh_host.rs:61-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:236— crates/op-host-native/src/widget_host/variables_preset_press.rs:236-250 | crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:72-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/op-host-services/src/chat_spawn.rs:156— crates/op-host-services/src/chat_spawn.rs:156-170 | crates/op-host-services/src/provider_probe.rs:298-312 — before extracting anything, compare `crates/op-host-services/src/chat_spawn.rs` and `crates/op-host-services/src/provider_probe.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/op-host-services/src/web_canvas_server/connection.rs:210— crates/op-host-services/src/web_canvas_server/connection.rs:210-224 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:596-610 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) crates/op-host-services/src/web_canvas_server/online_run_loop.rs:526— crates/op-host-services/src/web_canvas_server/online_run_loop.rs:526-540 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:575-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-host-web/src/dom_io/browser_files.rs:81— crates/op-host-web/src/dom_io/browser_files.rs:81-95 | crates/op-host-web/src/dom_io/browser_files.rs:149-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-orchestrator/src/geometry_card_rail_fixes.rs:142— crates/op-orchestrator/src/geometry_card_rail_fixes.rs:142-156 | crates/op-orchestrator/src/geometry_diagnostics_collect.rs:286-300 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) crates/op-orchestrator/src/card_inner_padding.rs:44— crates/op-orchestrator/src/card_inner_padding.rs:44-58 | crates/op-orchestrator/src/touch_target_floor.rs:23-37 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/op-preview-core/src/motion.rs:163— crates/op-preview-core/src/motion.rs:163-177 | crates/op-preview-core/src/motion.rs:226-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.
Duplicated block (15 lines × 2) crates/op-html/src/text_children.rs:531— crates/op-html/src/text_children.rs:531-545 | crates/op-html/src/text_inline.rs:318-332 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) crates/op-editor-ui/src/widgets/icon_catalog.rs:394— crates/op-editor-ui/src/widgets/icon_catalog.rs:394-408 | crates/op-editor-ui/src/widgets/icon_catalog.rs: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.
Duplicated block (15 lines × 2) templates/step0/_generators/tpl_qa_carousel.py:337— templates/step0/_generators/tpl_qa_carousel.py:337-351 | templates/step0/_generators/tpl_yearreview_carousel.py:404-418 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) templates/step0/_generators/tpl_card_metric.py:112— templates/step0/_generators/tpl_card_metric.py:112-126 | templates/step0/_generators/tpl_card_notice.py:134-149 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) packaging/ios/Sources/AuthCodeFormViewController.swift:201— packaging/ios/Sources/AuthCodeFormViewController.swift:201-215 | packaging/ios/Sources/NativeLoginViewController.swift:220-234 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/ios/Sources/AuthCodeFormViewController.swift:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
EditorState::apply_with_allocator (cognitive 173) crates/op-editor-core/src/command_apply.rs:55— EditorState::apply_with_allocator has cognitive complexity 173 (threshold 15). Drivers by points: if/else 72 (140 pts), boolean chains 20, match/switch 6 (13 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::cmd_set_node_layout_prop (cognitive 78) crates/op-editor-core/src/command_layout_prop.rs:130— EditorState::cmd_set_node_layout_prop has cognitive complexity 78 (threshold 15). Drivers by points: if/else 39 (75 pts), match/switch 2, boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::commit_property_edit_inner (cognitive 56) crates/op-editor-core/src/property_edit_mutators.rs:69— EditorState::commit_property_edit_inner has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (42 pts), match/switch 6 (11 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::active_text_input (cognitive 32) crates/op-editor-core/src/text_input_focus.rs:12— EditorState::active_text_input has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EditorState::resize_selected_bounds (cognitive 27) crates/op-editor-core/src/drag_mutators.rs:142— EditorState::resize_selected_bounds has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3 (nesting depth added 13). 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.
EditorState::active_text_input_mut (cognitive 25) crates/op-editor-core/src/text_input_focus.rs:104— EditorState::active_text_input_mut has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 4, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorState::paste_clipboard_with_allocator (cognitive 24) crates/op-editor-core/src/clipboard.rs:73— EditorState::paste_clipboard_with_allocator has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 12). 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.
EditorState::instantiate_kit_component_under_parent_with_allocator (cognitive 23) crates/op-editor-core/src/uikit_allocator.rs:54— EditorState::instantiate_kit_component_under_parent_with_allocator has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::move_node_to_drop_target (cognitive 22) crates/op-editor-core/src/drag_mutators.rs:298— EditorState::move_node_to_drop_target has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, 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.
EditorState::cmd_set_ellipse_arc (cognitive 20) crates/op-editor-core/src/command_node_attrs/state_ops.rs:337— EditorState::cmd_set_ellipse_arc has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::cmd_batch_insert_with_allocator (cognitive 18) crates/op-editor-core/src/command_node/state_ops.rs:366— EditorState::cmd_batch_insert_with_allocator has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::rename_commit (cognitive 18) crates/op-editor-core/src/rename.rs:107— EditorState::rename_commit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 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.
EditorState::cmd_insert_authored_subtree_with_root_policy (cognitive 17) crates/op-editor-core/src/command_authored_subtree.rs:28— EditorState::cmd_insert_authored_subtree_with_root_policy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
EditorState::cmd_update_node (cognitive 17) crates/op-editor-core/src/command_node/state_ops.rs:93— EditorState::cmd_update_node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EditorState::text_edit_caret_vertical (cognitive 17) crates/op-editor-core/src/text_edit.rs:264— EditorState::text_edit_caret_vertical has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 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.
EditorState::cmd_insert_node_with_allocator (cognitive 16) crates/op-editor-core/src/command_node/state_ops.rs:39— EditorState::cmd_insert_node_with_allocator has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Change coupling: subagent.rs ↔ variables.rs crates/op-orchestrator/src/subagent.rs— `crates/op-orchestrator/src/subagent.rs` and `crates/op-orchestrator/src/variables.rs` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `169e6abe` feat(orchestrator): tree-heuristics, palette-harmonize, post-pass ref…; `8a39bc7b` Merge branch 'v0.8.0-new' of github.com:ZSeven-W/openpencil into v0.8…; `1a601eca` feat(orchestrator): design_system — types + parse + defaults + Progre… — run `git show` on any of them.
Change coupling: plan_normalize.rs ↔ variables.rs crates/op-orchestrator/src/plan_normalize.rs— `crates/op-orchestrator/src/plan_normalize.rs` and `crates/op-orchestrator/src/variables.rs` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `8a39bc7b` Merge branch 'v0.8.0-new' of github.com:ZSeven-W/openpencil into v0.8…; `1a601eca` feat(orchestrator): design_system — types + parse + defaults + Progre…; `c098effa` feat(orchestrator): types — vision validation traits + Progress + config — run `git show` on any of them.
Change coupling: click.rs ↔ press.rs crates/op-host-native/src/widget_host/click.rs— `crates/op-host-native/src/widget_host/click.rs` and `crates/op-host-web/src/widget_host/press.rs` change together 73% of the time (19 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `3dc64c1a` fix(editor): defer transient row actions until release; `d0a7d5e7` refactor(editor): clear remaining button hover fills; `45340f10` refactor(editor): add shared button press feedback — run `git show` on any of them.
Change coupling: agent_settings.rs ↔ settings_io.rs crates/op-editor-core/src/agent_settings.rs— `crates/op-editor-core/src/agent_settings.rs` and `crates/op-host-desktop/src/settings_io.rs` change together 71% of the time (10 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `194c7d01` feat(editor): gate preview mode and widget config behind experimental…; `26e812db` fix(settings): track image generation test status; `ec03f06c` fix(settings): infer ark coding preset by model — run `git show` on any of them.
Change coupling: paint.rs ↔ paint.rs crates/op-host-native/src/widget_host/paint.rs— `crates/op-host-native/src/widget_host/paint.rs` and `crates/op-host-web/src/widget_host/paint.rs` change together 66% of the time (25 of the 38 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 25 shared commits counted here, the most recent 3 are `af15f6cd` feat(editor): canvas toast banner surfaces the online recovery notice; `08f2dc5d` feat(editor): add delayed top-bar tooltips; `ecebc3e7` refactor(editor): move the collab join field onto the unified text input — run `git show` on any of them.
Change coupling: agent_settings_images.rs ↔ press_helpers.rs crates/op-editor-ui/src/widgets/agent_settings_images.rs— `crates/op-editor-ui/src/widgets/agent_settings_images.rs` and `crates/op-host-native/src/widget_host/press_helpers.rs` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `a922bd2d` feat(editor): open the Openverse register link from Settings → Images; `26e812db` fix(settings): track image generation test status; `0c61ba5b` fix(settings): track image search test status — run `git show` on any of them.
Change coupling: ai_chat_hit.rs ↔ press.rs crates/op-editor-ui/src/widgets/ai_chat_hit.rs— `crates/op-editor-ui/src/widgets/ai_chat_hit.rs` and `crates/op-host-web/src/widget_host/press.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `d0a7d5e7` refactor(editor): clear remaining button hover fills; `b846a292` fix(ai): apply rust chat design blocks; `b9d5639a` fix(ai): disable chat input while streaming — run `git show` on any of them.
Change coupling: property_panel_layout.rs ↔ property_dispatch.rs crates/op-editor-ui/src/widgets/property_panel_layout.rs— `crates/op-editor-ui/src/widgets/property_panel_layout.rs` and `crates/op-host-native/src/widget_host/property_dispatch.rs` change together 55% of the time (12 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `3480abaa` feat(editor): merge effect adds into one "+" with a Shadow/Blur menu; `d187eb72` feat(editor): add a Layer Blur button to the effects section; `e2ca2f03` feat(panels): per-fill multi-fill Fill editor (stack/add/delete fills) — run `git show` on any of them.
Change coupling: run_tests_b4.rs ↔ subagent.rs crates/op-orchestrator/src/run_tests_b4.rs— `crates/op-orchestrator/src/run_tests_b4.rs` and `crates/op-orchestrator/src/subagent.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `096feaf0` refactor(ai): collapse subagent protocols onto script-gen via the sha…; `5b33f8f5` feat(agent): orchestrator scaffold, subagent, and validation fixes; `6fb5ff58` feat(orchestrator): mobile screen plans, typography cleanup, parse fixes — run `git show` on any of them.
Change coupling: main.rs ↔ command.rs crates/op-cli/src/main.rs— `crates/op-cli/src/main.rs` and `crates/op-editor-core/src/command.rs` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `507510ee` feat(mcp): expose the scene template catalogue to MCP and the CLI; `a26e1b0f` fix(mcp): support ts move copy targets; `dd34ca85` fix(mcp): accept ts delete page targets — run `git show` on any of them.
Change coupling: main.rs ↔ command_apply.rs crates/op-cli/src/main.rs— `crates/op-cli/src/main.rs` and `crates/op-editor-core/src/command_apply.rs` change together 50% of the time (12 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `507510ee` feat(mcp): expose the scene template catalogue to MCP and the CLI; `a26e1b0f` fix(mcp): support ts move copy targets; `dd34ca85` fix(mcp): accept ts delete page targets — run `git show` on any of them.
Change coupling: property_panel_fill.rs ↔ property_dispatch.rs crates/op-editor-ui/src/widgets/property_panel_fill.rs— `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-host-native/src/widget_host/property_dispatch.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `cb0842a5` feat(panels): reorder multiple fill layers; `e2ca2f03` feat(panels): per-fill multi-fill Fill editor (stack/add/delete fills); `c68aec25` refactor(editor): migrate fill type picker to shared select — run `git show` on any of them.
Change coupling: git_panel_menus.rs ↔ keyboard.rs crates/op-editor-ui/src/widgets/git_panel_menus.rs— `crates/op-editor-ui/src/widgets/git_panel_menus.rs` and `crates/op-host-native/src/widget_host/keyboard.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `94f8be68` refactor(editor): migrate file and git menus to shared menu; `7133ab24` refactor(editor): migrate git auxiliary inputs to shared text state; `82d48154` feat(panels): git-panel commit-detail diff, overflow menu, signature … — run `git show` on any of them.
Change coupling: main.rs ↔ chat_runtime.rs crates/op-host-desktop/src/main.rs— `crates/op-host-desktop/src/main.rs` and `crates/op-host-services/src/chat_runtime.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `fe40be77` refactor(host): move the AI-chat provider cluster to op-web-daemon (P… (at that commit the file was still `crates/op-web-daemon/src/chat_runtime.rs`); `4adfa38b` feat(ai): chat image attachments + per-provider thinking/effort (at that commit the file was still `crates/op-host-desktop/src/chat_runtime.rs`); `c18ad5a7` feat: close six TS-parity gaps in the Rust shell (at that commit the file was still `crates/op-host-desktop/src/chat_runtime.rs`) — run `git show` on any of them.
Change coupling: canvaskit.rs ↔ vscode_bridge.rs crates/op-host-web/src/canvaskit.rs— `crates/op-host-web/src/canvaskit.rs` and `crates/op-host-web/src/vscode_bridge.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `cfb2435f` fix(web): recheck bridge token at fallback completion to close late-i…; `ba9efd43` fix(web): keep bridge ready reachable on late init and stalled reset; `16927aa4` fix(web): serialize bridge sync-reset before ready — run `git show` on any of them.
Change coupling: command.rs ↔ command_node.rs crates/op-editor-core/src/command.rs— `crates/op-editor-core/src/command.rs` and `crates/op-editor-core/src/command_node.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `89fbee20` feat(editor-core): mesh/shader fill state + ref id-remap + chat-sessi…; `0282283c` feat(editor): command-layer ops for MCP layered design; `a26e1b0f` fix(mcp): support ts move copy targets — run `git show` on any of them.
Duplicated block (5 lines × 3) crates/op-design-lint/src/node_util.rs:457— crates/op-design-lint/src/node_util.rs:457-461 | crates/op-editor-core/src/fills/access.rs:107-111 | crates/op-mcp/src/style_ops_tools.rs:474-478 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) crates/op-design-lint/src/detectors/structure.rs:306— crates/op-design-lint/src/detectors/structure.rs:306-310 | crates/op-orchestrator/src/avatar_repair.rs:194-198 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:168-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) crates/op-editor-core/src/svg_path_data.rs:348— crates/op-editor-core/src/svg_path_data.rs:348-352 | crates/op-editor-core/src/svg_path_data.rs:357-361 | crates/op-editor-core/src/svg_path_data.rs:364-368 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/op-editor-ui/src/widgets/layer_context_menu.rs:248— crates/op-editor-ui/src/widgets/layer_context_menu.rs:248-252 | crates/op-editor-ui/src/widgets/layer_context_menu.rs:285-289 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:69-73 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/op-host-services/src/design_md_llm.rs:76— crates/op-host-services/src/design_md_llm.rs:76-80 | crates/op-orchestrator/src/design_system.rs:385-389 | crates/op-orchestrator/src/run.rs:295-299 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) crates/op-chat-agent/src/chat_agent_context.rs:138— crates/op-chat-agent/src/chat_agent_context.rs:138-142 | crates/op-image-enrich/src/net/downscale.rs:189-193 | crates/op-image-enrich/src/net/downscale.rs:235-239 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/op-auth-bridge/src/collab_claims.rs:531— crates/op-auth-bridge/src/collab_claims.rs:531-535 | crates/op-collab-transport/src/admission.rs:700-704 | crates/op-collab/src/profile_validation.rs:126-130 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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 × 3) crates/op-host-native/src/backend/skia/image.rs:524— crates/op-host-native/src/backend/skia/image.rs:524-528 | crates/op-host-web/src/canvaskit/convert.rs:65-69 | crates/op-pen-loader/src/layout_scene.rs:578-582 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) crates/op-orchestrator/src/geometry_diagnostics_collect.rs:116— crates/op-orchestrator/src/geometry_diagnostics_collect.rs:116-120 | crates/op-orchestrator/src/sidebar_archetype.rs:486-490 | crates/op-orchestrator/src/stub_repair.rs:232-236 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (5 lines × 3) crates/op-collab-smoke/src/fault_owner.rs:89— crates/op-collab-smoke/src/fault_owner.rs:89-93 | crates/op-collab-smoke/src/fault_owner.rs:185-189 | crates/op-collab-smoke/src/fault_owner.rs:254-258 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/op-orchestrator/src/category_grid_density.rs:203— crates/op-orchestrator/src/category_grid_density.rs:203-207 | crates/op-orchestrator/src/repair_record.rs:418-422 | crates/op-orchestrator/src/role_post_pass/mobile_category_row.rs:81-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) crates/op-host-web/src/file_actions.rs:134— crates/op-host-web/src/file_actions.rs:134-138 | crates/op-host-web/src/file_actions.rs:195-199 | crates/op-host-web/src/file_actions/save_payload.rs:182-186 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/op-design-lint/src/node_util.rs:506— crates/op-design-lint/src/node_util.rs:506-510 | crates/op-orchestrator/src/validation_dump.rs:284-288 | crates/op-orchestrator/src/validation_fixes_apply.rs:579-583 — before extracting anything, compare `crates/op-orchestrator/src/validation_dump.rs` and `crates/op-orchestrator/src/validation_fixes_apply.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) crates/op-editor-core/src/scene_vars.rs:280— crates/op-editor-core/src/scene_vars.rs:280-284 | crates/op-editor-core/src/scene_vars.rs:365-369 | crates/op-editor-core/src/variables.rs:96-100 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) templates/step0/_generators/tpl_gradient_tech.py:204— templates/step0/_generators/tpl_gradient_tech.py:204-208 | templates/step0/_generators/tpl_lecture_light.py:202-206 | templates/step0/_generators/tpl_pitch_dark.py:178-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl_gradient_tech.py:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `templates/step0/_generators/tpl_gradient_tech.py:211` calls `mono`, `text` and `templates/step0/_generators/tpl_lecture_light.py:210` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) templates/step0/_generators/tpl_brand_concept_sheet.py:54— templates/step0/_generators/tpl_brand_concept_sheet.py:54-58 | templates/step0/_generators/tpl_brand_concept_sheet.py:63-67 | templates/step0/_generators/tpl_logo_qa_board.py:98-102 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The `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.
op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config (cognitive 57) crates/op-host-desktop/src/mcp_integrations_dsh.rs:105— op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (10 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::design_session_workers::finish_design_success (cognitive 45) crates/op-host-desktop/src/design_session_workers.rs:290— op_host_desktop::design_session_workers::finish_design_success has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 4 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::persistence::run_action (cognitive 35) crates/op-host-desktop/src/persistence.rs:372— op_host_desktop::persistence::run_action has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 5 (9 pts) (nesting depth added 18). 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.
op_host_desktop::chat_session::execute_tool_requests (cognitive 33) crates/op-host-desktop/src/chat_session.rs:260— op_host_desktop::chat_session::execute_tool_requests has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 1, 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.
op_host_desktop::design_session::pump_commands (cognitive 30) crates/op-host-desktop/src/design_session.rs:33— op_host_desktop::design_session::pump_commands has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, match/switch 2 (4 pts), 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.
op_host_desktop::chat_acp::run_acp_turn (cognitive 27) crates/op-host-desktop/src/chat_acp.rs:457— op_host_desktop::chat_acp::run_acp_turn has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 10 (13 pts), if/else 4 (12 pts), loops 2 (nesting depth added 11). 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.
op_host_desktop::chat_session_launch::launch_if_pending_inner (cognitive 24) crates/op-host-desktop/src/chat_session_launch.rs:100— op_host_desktop::chat_session_launch::launch_if_pending_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 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.
op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking (cognitive 22) crates/op-host-desktop/src/design_md_host.rs:151— op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::chat_session::pump_with_channel_interleave (cognitive 21) crates/op-host-desktop/src/chat_session.rs:123— op_host_desktop::chat_session::pump_with_channel_interleave has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::commit_diff_semantic::compute_commit_diff (cognitive 20) crates/op-host-desktop/src/commit_diff_semantic.rs:74— op_host_desktop::commit_diff_semantic::compute_commit_diff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2, match/switch 1 (2 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.
op_host_desktop::image_decode_host::decode_worker (cognitive 18) crates/op-host-desktop/src/image_decode_host.rs:196— op_host_desktop::image_decode_host::decode_worker has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 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.
op_host_desktop::mcp_integrations::update_zcode_config (cognitive 17) crates/op-host-desktop/src/mcp_integrations.rs:429— op_host_desktop::mcp_integrations::update_zcode_config has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::sub_agent_session::pump_sub_agents (cognitive 17) crates/op-host-desktop/src/sub_agent_session.rs:316— op_host_desktop::sub_agent_session::pump_sub_agents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::render_cli::prefetch_remote_images (cognitive 17) crates/op-host-desktop/src/render_cli.rs:177— op_host_desktop::render_cli::prefetch_remote_images has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (collect). 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.
op_host_desktop::init_auth_runtime (cognitive 16) crates/op-host-desktop/src/main.rs:507— op_host_desktop::init_auth_runtime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 1 (nesting depth added 10). 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.
op_mcp::parser::arguments_field (cyclomatic 55) crates/op-mcp/src/parser.rs:173— op_mcp::parser::arguments_field 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.
op_mcp::script_runner::repair_truncated_script (cyclomatic 39) crates/op-mcp/src/script_runner.rs:500— op_mcp::script_runner::repair_truncated_script has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_mcp::parser::parse_flat_object_body (cyclomatic 37) crates/op-mcp/src/parser.rs:393— op_mcp::parser::parse_flat_object_body has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_mcp::batch_layered_guidelines::generate_section_guidelines (cyclomatic 26) crates/op-mcp/src/batch_layered_guidelines.rs:7— op_mcp::batch_layered_guidelines::generate_section_guidelines has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_mcp::script_runner::escape_raw_newlines_in_quoted_strings (cyclomatic 25) crates/op-mcp/src/script_runner.rs:180— op_mcp::script_runner::escape_raw_newlines_in_quoted_strings 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.
op_mcp::batch_design_wire::parse_item (cyclomatic 23) crates/op-mcp/src/batch_design_wire.rs:70— op_mcp::batch_design_wire::parse_item 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.
op_mcp::script_runner::balance_brackets (cyclomatic 22) crates/op-mcp/src/script_runner.rs:412— op_mcp::script_runner::balance_brackets 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.
op_mcp::batch_program_exec_ops::execute_image (cyclomatic 21) crates/op-mcp/src/batch_program_exec_ops.rs:230— op_mcp::batch_program_exec_ops::execute_image 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.
op_mcp::script_runner_dotted_keys::repair_dotted_object_keys (cyclomatic 20) crates/op-mcp/src/script_runner_dotted_keys.rs:29— op_mcp::script_runner_dotted_keys::repair_dotted_object_keys 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.
op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect (cyclomatic 20) crates/op-mcp/src/batch_design_normalize.rs:83— op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect 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.
op_mcp::codegen_plan_store::submit_chunk_result (cyclomatic 19) crates/op-mcp/src/codegen_plan_store.rs:514— op_mcp::codegen_plan_store::submit_chunk_result 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.
op_mcp::codegen_plan_store::validate_plan (cyclomatic 17) crates/op-mcp/src/codegen_plan_store.rs:173— op_mcp::codegen_plan_store::validate_plan 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.
op_mcp::batch_program::explicitly_sized_append_lines (cyclomatic 17) crates/op-mcp/src/batch_program.rs:381— op_mcp::batch_program::explicitly_sized_append_lines 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.
op_mcp::batch_get::resolve_refs_in_node (cyclomatic 16) crates/op-mcp/src/batch_get.rs:171— op_mcp::batch_get::resolve_refs_in_node has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: op_mcp::batch_get::node_type (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_design_lint::detectors::spacing::walk_edge_section_padding (cognitive 44) crates/op-design-lint/src/detectors/spacing.rs:431— op_design_lint::detectors::spacing::walk_edge_section_padding has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 4 (11 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::typography::first_solid_color (cognitive 41) crates/op-design-lint/src/detectors/typography.rs:268— op_design_lint::detectors::typography::first_solid_color has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (34 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::siblings::walk_sibling_inconsistencies (cognitive 35) crates/op-design-lint/src/detectors/siblings.rs:73— op_design_lint::detectors::siblings::walk_sibling_inconsistencies has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (13 pts), boolean chains 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.
op_design_lint::detectors::siblings::walk_mixed_padding (cognitive 34) crates/op-design-lint/src/detectors/siblings.rs:351— op_design_lint::detectors::siblings::walk_mixed_padding has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 4 (9 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::structural_quality::walk_redundant_wrappers (cognitive 34) crates/op-design-lint/src/detectors/structural_quality.rs:41— op_design_lint::detectors::structural_quality::walk_redundant_wrappers has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (31 pts), boolean chains 2, loops 1 (nesting depth added 23). 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.
op_design_lint::detectors::siblings::walk_mixed_corner_radius (cognitive 33) crates/op-design-lint/src/detectors/siblings.rs:266— op_design_lint::detectors::siblings::walk_mixed_corner_radius has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::shader_budget::shader_issues (cognitive 24) crates/op-design-lint/src/detectors/shader_budget.rs:118— op_design_lint::detectors::shader_budget::shader_issues has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (2 pts), 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.
op_design_lint::detectors::siblings::check_consistency (cognitive 23) crates/op-design-lint/src/detectors/siblings.rs:151— op_design_lint::detectors::siblings::check_consistency has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::spacing::walk_stacked_horizontal_padding (cognitive 22) crates/op-design-lint/src/detectors/spacing.rs:554— op_design_lint::detectors::spacing::walk_stacked_horizontal_padding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::plan::detect_and_plan (cognitive 21) crates/op-design-lint/src/plan.rs:94— op_design_lint::plan::detect_and_plan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 6 (9 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.
op_design_lint::detectors::top_anchored_bars::find_bar_groups (cognitive 20) crates/op-design-lint/src/detectors/top_anchored_bars.rs:94— op_design_lint::detectors::top_anchored_bars::find_bar_groups has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::typography::collect_low_contrast (cognitive 18) crates/op-design-lint/src/detectors/typography.rs:104— op_design_lint::detectors::typography::collect_low_contrast has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, 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.
op_design_lint::detectors::motion_budget::collect (cognitive 16) crates/op-design-lint/src/detectors/motion_budget.rs:26— op_design_lint::detectors::motion_budget::collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::design_form::classify_root_form (cognitive 16) crates/op-design-lint/src/design_form.rs:105— op_design_lint::design_form::classify_root_form has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×13
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-ai-skills/src/style_guide/token_table.rs:493— crates/op-ai-skills/src/style_guide/token_table.rs:493-523 | crates/op-orchestrator/src/design_type.rs:160-201 | crates/op-orchestrator/src/plan.rs:497-528 | crates/op-orchestrator/src/plan_fallback_card.rs:22-52 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-collab-smoke/src/fault_guest.rs:46— crates/op-collab-smoke/src/fault_guest.rs:46-175 | crates/op-collab-smoke/src/fault_guest.rs:181-238 | crates/op-collab-smoke/src/fault_guest.rs:356-410 | crates/op-collab-smoke/src/fault_guest.rs:448-470 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-design-lint/src/node_util.rs:555— crates/op-design-lint/src/node_util.rs:555-570 | crates/op-editor-core/src/property_edit_mutators.rs:741-754 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:279-297 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:299-313 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/command_style_replace.rs:416— crates/op-editor-core/src/command_style_replace.rs:416-438 | crates/op-editor-core/src/fills/access.rs:157-179 | crates/op-figma/src/clipboard.rs:561-574 | crates/op-orchestrator/src/variable_binding.rs:284-306 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/host_image_panel_transitions.rs:256— crates/op-editor-core/src/host_image_panel_transitions.rs:256-269 | crates/op-editor-core/src/host_image_panel_transitions.rs:278-294 | crates/op-editor-core/src/host_image_panel_transitions.rs:303-319 | crates/op-editor-core/src/host_image_panel_transitions.rs:322-335 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/color_picker_snapshot.rs:24— crates/op-editor-core/src/color_picker_snapshot.rs:24-41 | crates/op-editor-ui/src/widgets/variables_panel.rs:327-348 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:378-394 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:320-336 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/image_crop.rs:224— crates/op-editor-core/src/image_crop.rs:224-238 | crates/op-editor-core/src/property_edit_mutators.rs:666-683 | crates/op-editor-core/src/property_edit_mutators.rs:702-719 | crates/op-editor-core/src/property_edit_mutators.rs:721-738 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:58— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:58-364 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:226-600 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:466-586 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:604-705 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:230— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:230-303 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:344-413 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:459-546 | crates/op-editor-ui/src/widgets/property_panel_layer.rs:167-265 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:159— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:159-182 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:196-219 | crates/op-orchestrator/src/validation_dump.rs:267-281 | crates/op-orchestrator/src/validation_fixes_apply.rs:558-573 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:184— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:184-207 | crates/op-html/src/mapper_node_access.rs:87-110 | crates/op-orchestrator/src/validation_dump.rs:283-297 | crates/op-orchestrator/src/validation_fixes_apply.rs:577-592 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-mcp/src/batch_get.rs:239— crates/op-mcp/src/batch_get.rs:239-251 | crates/op-mcp/src/read_nodes.rs:102-114 | crates/op-mcp/src/style_ops_tools.rs:157-169 | crates/op-mcp/src/style_ops_tools.rs:173-185 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) packaging/ios/Sources/DocumentExportCoordinator.swift:226— packaging/ios/Sources/DocumentExportCoordinator.swift:226-266 | packaging/ios/Sources/DocumentSaveCoordinator.swift:378-418 | packaging/ios/Sources/ImageImportCoordinator.swift:144-193 | packaging/ios/Sources/OpPlayerView.swift:375-407 — 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.
op_figma::instance::apply_instance_overrides_cached (cyclomatic 102) crates/op-figma/src/instance.rs:102— op_figma::instance::apply_instance_overrides_cached has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_figma::instance::fingerprint::score (cyclomatic 31) crates/op-figma/src/instance/fingerprint.rs:202— op_figma::instance::fingerprint::score has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_figma::instance::apply::apply_to_node (cyclomatic 28) crates/op-figma/src/instance/apply.rs:188— op_figma::instance::apply::apply_to_node has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_figma::boolean_fallback::apply_result_paint_to_artwork (cyclomatic 25) crates/op-figma/src/boolean_fallback.rs:264— op_figma::boolean_fallback::apply_result_paint_to_artwork has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_figma::node_mapper::style_references::resolve_on_node (cyclomatic 23) crates/op-figma/src/node_mapper/style_references.rs:121— op_figma::node_mapper::style_references::resolve_on_node 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.
op_figma::vector_decoder::scale_command_path (cyclomatic 23) crates/op-figma/src/vector_decoder.rs:96— op_figma::vector_decoder::scale_command_path 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.
op_figma::instance::swap_filter::filter_swap_stale_derived (cyclomatic 21) crates/op-figma/src/instance/swap_filter.rs:23— op_figma::instance::swap_filter::filter_swap_stale_derived 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.
op_figma::clipboard::parse_clipboard_html_styles (cyclomatic 19) crates/op-figma/src/clipboard.rs:333— op_figma::clipboard::parse_clipboard_html_styles 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.
op_figma::converters::convert_vector (cyclomatic 17) crates/op-figma/src/converters.rs:562— op_figma::converters::convert_vector 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.
op_figma::vector_decoder::decode_vector_network_blob (cyclomatic 16) crates/op-figma/src/vector_decoder.rs:490— op_figma::vector_decoder::decode_vector_network_blob 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.
op_figma::text_mapper::parse_font_weight (cyclomatic 16) crates/op-figma/src/text_mapper.rs:243— op_figma::text_mapper::parse_font_weight 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.
op_figma::instance::assignment::seed_assignments_from_instances::collect_geom (cyclomatic 16) crates/op-figma/src/instance/assignment.rs:127— op_figma::instance::assignment::seed_assignments_from_instances::collect_geom 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.
op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner (cognitive 75) crates/op-chat-agent/src/chat_agent_loop/openai.rs:37— op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner has cognitive complexity 75 (threshold 15). Drivers by points: if/else 24 (56 pts), loops 5 (11 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner (cognitive 73) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:80— op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (50 pts), loops 6 (15 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard (cognitive 60) crates/op-chat-agent/src/design_agent_tools.rs:172— op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard has cognitive complexity 60 (threshold 15). Drivers by points: if/else 30 (57 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.
op_chat_agent::screen_sets::listed_whole_screen_names_en (cognitive 31) crates/op-chat-agent/src/screen_sets.rs:199— op_chat_agent::screen_sets::listed_whole_screen_names_en has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (19 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::design_context::collect_design_facts (cognitive 30) crates/op-chat-agent/src/design_context.rs:84— op_chat_agent::design_context::collect_design_facts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (6 pts), boolean chains 5 (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.
op_chat_agent::screen_sets::listed_whole_screen_names (cognitive 25) crates/op-chat-agent/src/screen_sets.rs:245— op_chat_agent::screen_sets::listed_whole_screen_names has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (14 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::chat_agent_loop::pump_sse (cognitive 21) crates/op-chat-agent/src/chat_agent_loop.rs:394— op_chat_agent::chat_agent_loop::pump_sse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 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.
op_chat_agent::backoff::send_with_backoff (cognitive 19) crates/op-chat-agent/src/backoff.rs:168— op_chat_agent::backoff::send_with_backoff has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::design_agent_tools::quality_scans::scan_header_icon_row_issues::walk (cognitive 18) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:113— op_chat_agent::design_agent_tools::quality_scans::scan_header_icon_row_issues::walk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::design_agent_tools::root_seed::seed_root_frame_if_needed (cognitive 18) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:426— op_chat_agent::design_agent_tools::root_seed::seed_root_frame_if_needed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::design_agent_tools::quality_scans::scan_empty_shells::walk (cognitive 17) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:152— op_chat_agent::design_agent_tools::quality_scans::scan_empty_shells::walk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::design_agent_diagnostics::scan_container_intent (cognitive 17) crates/op-chat-agent/src/design_agent_diagnostics.rs:204— op_chat_agent::design_agent_diagnostics::scan_container_intent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (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.
Duplicated block (6 lines × 3) crates/op-auth-bridge/src/collab_claims.rs:507— crates/op-auth-bridge/src/collab_claims.rs:507-512 | crates/op-collab-transport/src/admission.rs:657-662 | crates/op-collab/src/profile_validation.rs:102-107 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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) crates/op-editor-core/src/instance_override.rs:97— crates/op-editor-core/src/instance_override.rs:97-102 | crates/op-editor-core/src/ref_resolve.rs:227-233 | crates/op-editor-core/src/ref_resolve.rs:381-386 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/op-editor-core/src/property_edit_mutators.rs:764— crates/op-editor-core/src/property_edit_mutators.rs:764-769 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:115-120 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:128-133 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) crates/op-orchestrator/src/geometry_value_readers.rs:82— crates/op-orchestrator/src/geometry_value_readers.rs:82-87 | crates/op-orchestrator/src/role_layout_post_pass.rs:9-14 | crates/op-orchestrator/src/spacing_repair.rs:277-282 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) crates/op-preview-core/src/present.rs:280— crates/op-preview-core/src/present.rs:280-285 | crates/op-preview-core/src/session_paint.rs:114-119 | crates/op-preview-core/src/transition.rs:326-331 — before extracting anything, compare `crates/op-preview-core/src/present.rs` and `crates/op-preview-core/src/session_paint.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:562— crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:562-567 | crates/op-host-desktop/src/design_loop_indicator.rs:310-315 | crates/op-orchestrator/src/subagent.rs:459-464 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:192— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:192-198 | crates/op-editor-core/src/tests_mutators/support.rs:14-19 | crates/op-host-services/src/mcp_serve/finalize_tool.rs:189-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) crates/op-chat-agent/src/backoff.rs:161— crates/op-chat-agent/src/backoff.rs:161-166 | crates/op-host-services/src/web_canvas_server/tenant.rs:731-736 | crates/op-host-web/src/listener.rs:74-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) crates/op-editor-core/src/svg_import.rs:73— crates/op-editor-core/src/svg_import.rs:73-78 | crates/op-editor-core/src/svg_import.rs:120-125 | crates/op-html/src/dom.rs:34-39 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) crates/op-engine-ffi/src/editor_codegen.rs:289— crates/op-engine-ffi/src/editor_codegen.rs:289-294 | crates/op-engine-ffi/src/editor_image_search.rs:261-270 | crates/op-engine-ffi/src/editor_model_discovery.rs:192-201 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) crates/op-mcp/src/batch_direct_ops.rs:378— crates/op-mcp/src/batch_direct_ops.rs:378-383 | crates/op-mcp/src/update_node_data.rs:152-157 | crates/op-mcp/src/write_tools.rs:634-639 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) crates/op-orchestrator/src/loop_finalize.rs:182— crates/op-orchestrator/src/loop_finalize.rs:182-187 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:16-21 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:29-34 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
op_host_desktop::persistence::run_action (cyclomatic 39) crates/op-host-desktop/src/persistence.rs:372— op_host_desktop::persistence::run_action has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::design_session::apply_progress (cyclomatic 29) crates/op-host-desktop/src/design_session.rs:312— op_host_desktop::design_session::apply_progress has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config (cyclomatic 24) crates/op-host-desktop/src/mcp_integrations_dsh.rs:105— op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config 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.
op_host_desktop::chat_acp::run_acp_turn (cyclomatic 22) crates/op-host-desktop/src/chat_acp.rs:457— op_host_desktop::chat_acp::run_acp_turn has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::design_session_workers::finish_design_success (cyclomatic 20) crates/op-host-desktop/src/design_session_workers.rs:290— op_host_desktop::design_session_workers::finish_design_success 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.
op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking (cyclomatic 20) crates/op-host-desktop/src/design_md_host.rs:151— op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking 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.
op_host_desktop::design_session::pump_commands (cyclomatic 19) crates/op-host-desktop/src/design_session.rs:33— op_host_desktop::design_session::pump_commands 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.
op_host_desktop::chat_session_launch::launch_if_pending_inner (cyclomatic 18) crates/op-host-desktop/src/chat_session_launch.rs:100— op_host_desktop::chat_session_launch::launch_if_pending_inner 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.
op_host_desktop::mcp_integrations::config_path (cyclomatic 17) crates/op-host-desktop/src/mcp_integrations.rs:124— op_host_desktop::mcp_integrations::config_path has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::figma_import_session::pump (cyclomatic 17) crates/op-host-desktop/src/figma_import_session.rs:411— op_host_desktop::figma_import_session::pump has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::chat_session::execute_tool_requests (cyclomatic 16) crates/op-host-desktop/src/chat_session.rs:260— op_host_desktop::chat_session::execute_tool_requests 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.
TodoComment crates/op-chat-agent/src/chat_canvas_tools.rs:229— /// (design_session.rs `BeginUndoBatch` TODO). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-codegen/src/ai/assets.rs:8— //! PARITY TODO: consumer-view enrichment (enrichNodeLocallyForAIConsumerView) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-editor-ui/src/widgets/property_panel_interactions.rs:10— //! route path is read-only here; editing it is a v2 TODO). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-host-desktop/src/design_session.rs:99— // TODO(host): wire into op-editor-core history batch mode — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-host-native/src/widget_host/home.rs:144— // TODO(hosted-quota): the free tier becomes its own — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-host-services/src/cli_provider_probe.rs:47— /// TODO(follow-up, needs `provider_probe.rs`): have `connect_provider` forward — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/validation_fixes_b3.rs:135— // TODO: wire a real IconResolver trait when host-side icon lookup — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/validation_fixes_b3.rs:410— // TODO: resolve icon d-string via an `IconResolver` trait when available. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/validation_fixes_b3.rs:430— // TODO: icon resolver — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/validation_fixes_b3.rs:431— // TODO: icon resolver — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/cleanup_nav_surface_tests.rs:105— // TODO(reconcile w/ Kayshen e3ed2f1e "normalize mobile bottom tabs"): the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners (cognitive 86) crates/op-host-web/src/canvaskit/mount_keyboard.rs:12— op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 38, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::canvaskit::mount::mount_ck (cognitive 52) crates/op-host-web/src/canvaskit/mount.rs:14— op_host_web::canvaskit::mount::mount_ck has cognitive complexity 52 (threshold 15). Drivers by points: if/else 38 (48 pts), match/switch 3, boolean chains 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_host_web::dom_io::handle_paste_event (cognitive 41) crates/op-host-web/src/dom_io.rs:553— op_host_web::dom_io::handle_paste_event has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 2 (5 pts), boolean chains 2 (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.
op_host_web::web_settings_validation::validate_credential_semantics (cognitive 24) crates/op-host-web/src/web_settings_validation.rs:486— op_host_web::web_settings_validation::validate_credential_semantics has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 3 (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.
op_host_web::web_settings_storage::apply_stored_snapshots (cognitive 24) crates/op-host-web/src/web_settings_storage.rs:227— op_host_web::web_settings_storage::apply_stored_snapshots has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::widget_host::group_ops::trace_grid_contours (cognitive 21) crates/op-host-web/src/widget_host/group_ops.rs:172— op_host_web::widget_host::group_ops::trace_grid_contours has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::web_fonts::collect_text_font_families (cognitive 20) crates/op-host-web/src/web_fonts.rs:281— op_host_web::web_fonts::collect_text_font_families has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::dom_io::drop_entries::collect_files (cognitive 19) crates/op-host-web/src/dom_io/drop_entries.rs:112— op_host_web::dom_io::drop_entries::collect_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::live_sync_glue::push_document_if_changed (cognitive 18) crates/op-host-web/src/live_sync_glue.rs:461— op_host_web::live_sync_glue::push_document_if_changed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
op_host_web::web_auth_sync::apply_login_status (cognitive 18) crates/op-host-web/src/web_auth_sync.rs:348— op_host_web::web_auth_sync::apply_login_status has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::web_settings::apply_payload (cognitive 17) crates/op-host-web/src/web_settings.rs:398— op_host_web::web_settings::apply_payload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16 (17 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.
Duplicated block (17 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:83— crates/op-collab-host/src/runtime/network/connection.rs:83-99 | crates/op-collab-host/src/runtime/network/connection.rs:266-282 — both copies are in the same file, so extract the 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 (17 lines × 2) crates/op-collab-relay-server/src/connection_reauth.rs:262— crates/op-collab-relay-server/src/connection_reauth.rs:262-278 | crates/op-collab-relay-server/src/connection_reauth.rs:306-322 — both copies are in the same file, so extract the 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 (17 lines × 2) crates/op-editor-core/src/svg_import/scale.rs:51— crates/op-editor-core/src/svg_import/scale.rs:51-67 | crates/op-figma/src/vector_decoder.rs:105-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/op-figma/src/converters.rs:167— crates/op-figma/src/converters.rs:167-183 | crates/op-figma/src/converters.rs:203-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:148— crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:148-164 | crates/op-smoke/src/loop_mode.rs:235-251 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/op-host-services/src/export_html_structured/fallback.rs:79— crates/op-host-services/src/export_html_structured/fallback.rs:79-95 | crates/op-host-services/src/export_pptx/fallback.rs:62-78 — `crates/op-host-services/src/export_html_structured/fallback.rs` and `crates/op-host-services/src/export_pptx/fallback.rs` 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 3 separate duplicated blocks between them, totalling at least 46 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) crates/op-host-services/src/export_html_structured/fallback.rs:102— crates/op-host-services/src/export_html_structured/fallback.rs:102-118 | crates/op-host-services/src/export_pptx/fallback.rs:85-101 — `crates/op-host-services/src/export_html_structured/fallback.rs` and `crates/op-host-services/src/export_pptx/fallback.rs` 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 3 separate duplicated blocks between them, totalling at least 46 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) crates/op-host-web/src/web_settings.rs:531— crates/op-host-web/src/web_settings.rs:531-547 | crates/op-i18n/src/locale.rs:47-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/op-html/src/lib.rs:416— crates/op-html/src/lib.rs:416-432 | crates/op-html/src/mapper_pseudo.rs:91-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) crates/op-smoke/src/main.rs:188— crates/op-smoke/src/main.rs:188-204 | crates/op-smoke/src/main.rs:615-631 — both copies are in the same file, so extract the 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 (17 lines × 2) templates/step0/_generators/tpl_infographic_list.py:187— templates/step0/_generators/tpl_infographic_list.py:187-209 | templates/step0/_generators/tpl_tutorial_report.py:192-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/op-collab-relay-locator-server/src/http.rs:363— crates/op-collab-relay-locator-server/src/http.rs:363-370 | crates/op-collab-relay-locator-server/src/http.rs:438-445 | crates/op-collab-relay-locator-server/src/http.rs:503-510 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/op-editor-core/src/agent_indicators.rs:707— crates/op-editor-core/src/agent_indicators.rs:707-714 | crates/op-editor-host-core/src/chat.rs:109-116 | crates/op-editor-host-core/src/chat.rs:133-142 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) crates/op-mcp/src/write_tools.rs:459— crates/op-mcp/src/write_tools.rs:459-466 | crates/op-mcp/src/write_tools.rs:513-520 | crates/op-mcp/src/write_tools.rs:583-590 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/op-editor-ui/src/widgets/account_menu.rs:132— crates/op-editor-ui/src/widgets/account_menu.rs:132-139 | crates/op-editor-ui/src/widgets/export_quick_menu.rs:144-151 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:37-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/op-html/src/mapper_visual.rs:609— crates/op-html/src/mapper_visual.rs:609-616 | crates/op-html/src/text.rs:504-511 | crates/op-html/src/transform.rs:307-314 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/op-orchestrator/src/geometry_validation.rs:116— crates/op-orchestrator/src/geometry_validation.rs:116-123 | crates/op-orchestrator/src/image_fallback_policy.rs:22-29 | crates/op-orchestrator/src/radial_repair.rs:453-460 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/op-design-lint/src/node_mut.rs:151— crates/op-design-lint/src/node_mut.rs:151-158 | crates/op-editor-core/src/state.rs:346-353 | crates/op-orchestrator/src/validation_dump.rs:443-450 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) crates/op-host-services/src/cli_model_discovery.rs:73— crates/op-host-services/src/cli_model_discovery.rs:73-80 | crates/op-host-services/src/cli_model_discovery.rs:148-155 | crates/op-host-services/src/model_discovery.rs:395-402 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) crates/op-pen-loader/src/widget_payload.rs:121— crates/op-pen-loader/src/widget_payload.rs:121-128 | crates/op-pen-loader/src/widget_payload.rs:157-164 | crates/op-pen-loader/src/widget_payload.rs:179-186 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) templates/step0/_generators/tpl_tutorial_photo.py:316— templates/step0/_generators/tpl_tutorial_photo.py:316-324 | templates/step0/_generators/tpl_tutorial_skincare.py:219-226 | templates/step0/_generators/tpl_tutorial_storage.py:214-221 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl_tutorial_photo.py:316` 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, `templates/step0/_generators/tpl_tutorial_photo.py:326` calls `col` and `templates/step0/_generators/tpl_tutorial_skincare.py:228` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) templates/step0/_generators/tpl_tutorial_photo.py:316— templates/step0/_generators/tpl_tutorial_photo.py:316-324 | templates/step0/_generators/tpl_tutorial_skincare.py:172-179 | templates/step0/_generators/tpl_tutorial_storage.py:179-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl_tutorial_photo.py:316` 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, `templates/step0/_generators/tpl_tutorial_photo.py:326` calls `col` and `templates/step0/_generators/tpl_tutorial_skincare.py:181` 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.
op_ai_skills::frontmatter::entries (cognitive 38) crates/op-ai-skills/src/frontmatter.rs:119— op_ai_skills::frontmatter::entries has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (14 pts), match/switch 1 (6 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::style_guide::design_md_import::header_tags (cognitive 25) crates/op-ai-skills/src/style_guide/design_md_import.rs:279— op_ai_skills::style_guide::design_md_import::header_tags has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::frontmatter::parse_skill_frontmatter (cognitive 24) crates/op-ai-skills/src/frontmatter.rs:189— op_ai_skills::frontmatter::parse_skill_frontmatter has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 5 (9 pts), loops 1 (nesting depth added 14). 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.
op_ai_skills::budget::trim_by_budget_pinned (cognitive 23) crates/op-ai-skills/src/budget.rs:121— op_ai_skills::budget::trim_by_budget_pinned has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::style_guide::parser::extract_radius (cognitive 23) crates/op-ai-skills/src/style_guide/parser.rs:251— op_ai_skills::style_guide::parser::extract_radius has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::style_guide::token_table::extract_table_colors (cognitive 21) crates/op-ai-skills/src/style_guide/token_table.rs:288— op_ai_skills::style_guide::token_table::extract_table_colors has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 1 (3 pts), loops 2 (3 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
op_ai_skills::style_guide::parser::extract_typography (cognitive 19) crates/op-ai-skills/src/style_guide/parser.rs:168— op_ai_skills::style_guide::parser::extract_typography has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::style_guide::key_aesthetics::signature_recipes (cognitive 19) crates/op-ai-skills/src/style_guide/key_aesthetics.rs:44— op_ai_skills::style_guide::key_aesthetics::signature_recipes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
op_ai_skills::style_guide::design_md_import::scan_hex_colors (cognitive 16) crates/op-ai-skills/src/style_guide/design_md_import.rs:347— op_ai_skills::style_guide::design_md_import::scan_hex_colors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::style_guide::token_table::extract_prose_radius (cognitive 16) crates/op-ai-skills/src/style_guide/token_table.rs:449— op_ai_skills::style_guide::token_table::extract_prose_radius has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (9–10 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:212— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:212-221 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:162-170 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) crates/op-design-lint/src/detectors/spacing.rs:55— crates/op-design-lint/src/detectors/spacing.rs:55-64 | crates/op-design-lint/src/detectors/spacing.rs:70-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:94— crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:94-102 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:740-749 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9–10 lines × 2) crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:170— crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:170-179 | crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:295-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/op-host-services/src/mcp_serve/sniff.rs:15— crates/op-host-services/src/mcp_serve/sniff.rs:15-24 | crates/op-host-services/src/mcp_serve/sniff.rs:33-41 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/op-mcp/src/batch_get.rs:354— crates/op-mcp/src/batch_get.rs:354-362 | crates/op-mcp/src/style_ops_tools.rs:354-363 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) crates/op-orchestrator/src/cleanup_root_and_nav.rs:270— crates/op-orchestrator/src/cleanup_root_and_nav.rs:270-279 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:336-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/op-orchestrator/src/validation_fixes_apply.rs:248— crates/op-orchestrator/src/validation_fixes_apply.rs:248-256 | crates/op-orchestrator/src/validation_fixes_apply.rs:297-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/op-preview-core/src/present.rs:180— crates/op-preview-core/src/present.rs:180-188 | crates/op-preview-core/src/present.rs:190-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:244— templates/step0/_generators/tpl_tutorial_skincare.py:244-252 | templates/step0/_generators/tpl_tutorial_storage.py:254-263 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl_tutorial_skincare.py:244` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-builtin-model-discovery/src/lib.rs:217— crates/op-builtin-model-discovery/src/lib.rs:217-223 | crates/op-host-services/src/hub_auth_client.rs:211-217 | crates/op-host-services/src/web_credentials.rs:151-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) crates/op-editor-ui/src/widgets/design_md_line_cache.rs:85— crates/op-editor-ui/src/widgets/design_md_line_cache.rs:85-91 | crates/op-editor-ui/src/widgets/font_picker_cache.rs:77-83 | crates/op-editor-ui/src/widgets/layer_panel_cache.rs:215-221 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) crates/op-editor-ui/src/widgets/toolbar.rs:205— crates/op-editor-ui/src/widgets/toolbar.rs:205-211 | crates/op-editor-ui/src/widgets/toolbar.rs:249-255 | crates/op-editor-ui/src/widgets/toolbar.rs:346-352 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/op-host-desktop/src/mcp_integrations.rs:434— crates/op-host-desktop/src/mcp_integrations.rs:434-440 | crates/op-host-desktop/src/mcp_integrations.rs:443-449 | crates/op-host-desktop/src/mcp_integrations.rs:492-498 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/op-host-services/src/chat_spawn.rs:159— crates/op-host-services/src/chat_spawn.rs:159-165 | crates/op-host-services/src/cli_probe_support.rs:94-104 | crates/op-host-services/src/provider_probe.rs:301-307 — before extracting anything, compare `crates/op-host-services/src/chat_spawn.rs` and `crates/op-host-services/src/provider_probe.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/op-host-services/src/profile_avatar_fetch.rs:187— crates/op-host-services/src/profile_avatar_fetch.rs:187-193 | crates/op-host-services/src/public_https_client.rs:38-44 | crates/op-host-services/src/public_https_client.rs:62-68 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) crates/op-orchestrator/src/geometry_row_fixes.rs:349— crates/op-orchestrator/src/geometry_row_fixes.rs:349-355 | crates/op-orchestrator/src/geometry_row_fixes.rs:495-501 | crates/op-orchestrator/src/geometry_starved_row.rs:146-152 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) crates/op-host-services/src/web_image_generate.rs:375— crates/op-host-services/src/web_image_generate.rs:375-381 | crates/op-host-services/src/web_image_generate.rs:444-450 | crates/op-host-services/src/web_image_generate.rs:514-522 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:477— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:477-484 | crates/op-editor-ui/src/widgets/ai_chat_panel_paint.rs:57-63 | crates/op-editor-ui/src/widgets/settings_form.rs:38-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) templates/step0/_generators/tpl1.py:60— templates/step0/_generators/tpl1.py:60-66 | templates/step0/_generators/tpl2.py:80-86 | templates/step0/_generators/tpl3.py:47-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl1.py:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (20 lines × 2) crates/op-editor-core/src/chat/message.rs:112— crates/op-editor-core/src/chat/message.rs:112-131 | crates/op-editor-core/src/chat/message.rs:138-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/op-editor-ui/src/widgets/property_panel_icon.rs:107— crates/op-editor-ui/src/widgets/property_panel_icon.rs:107-126 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:551-570 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:45— crates/op-host-native/src/widget_host/variables_preset_press.rs:45-64 | crates/op-host-web/src/widget_host/variables_preset_press.rs:22-41 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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) crates/op-host-services/src/export_html_structured.rs:106— crates/op-host-services/src/export_html_structured.rs:106-125 | crates/op-host-services/src/export_pptx.rs:153-172 — before extracting anything, compare `crates/op-host-services/src/export_html_structured.rs` and `crates/op-host-services/src/export_pptx.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) crates/op-orchestrator/src/concurrent.rs:302— crates/op-orchestrator/src/concurrent.rs:302-321 | crates/op-orchestrator/src/concurrent.rs:384-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/op-orchestrator/src/card_inner_padding.rs:253— crates/op-orchestrator/src/card_inner_padding.rs:253-272 | crates/op-orchestrator/src/touch_target_floor.rs:206-225 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) crates/op-pen-loader/src/adapter/geometry.rs:72— crates/op-pen-loader/src/adapter/geometry.rs:72-91 | crates/op-pen-loader/src/layout_repair.rs:691-710 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20 lines × 2) templates/step0/_generators/tpl_tutorial_diy.py:161— templates/step0/_generators/tpl_tutorial_diy.py:161-180 | templates/step0/_generators/tpl_tutorial_workout.py:159-178 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) packaging/ios/Sources/DocumentExportCoordinator.swift:150— packaging/ios/Sources/DocumentExportCoordinator.swift:150-169 | packaging/ios/Sources/DocumentSaveCoordinator.swift:319-338 — before extracting anything, compare `packaging/ios/Sources/DocumentExportCoordinator.swift` and `packaging/ios/Sources/DocumentSaveCoordinator.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/op-design-lint/src/node_util.rs:395— crates/op-design-lint/src/node_util.rs:395-403 | crates/op-pen-loader/src/adapter/geometry.rs:32-40 | crates/op-pen-loader/src/authored_geometry.rs:90-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) crates/op-editor-core/src/color_picker_snapshot.rs:28— crates/op-editor-core/src/color_picker_snapshot.rs:28-36 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:381-389 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:323-331 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/op-editor-core/src/fills/primary.rs:42— crates/op-editor-core/src/fills/primary.rs:42-50 | crates/op-editor-core/src/fills/primary.rs:64-72 | crates/op-editor-core/src/fills/primary.rs:90-98 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/op-host-services/src/doc_io.rs:176— crates/op-host-services/src/doc_io.rs:176-184 | crates/op-host-services/src/doc_io/clean_copy.rs:62-70 | crates/op-host-services/src/doc_io/clean_copy.rs:124-132 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) crates/op-pen-loader/src/widget_payload.rs:28— crates/op-pen-loader/src/widget_payload.rs:28-36 | crates/op-pen-loader/src/widget_payload.rs:48-56 | crates/op-pen-loader/src/widget_payload.rs:68-76 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/op-mcp/src/node_attr_tools.rs:469— crates/op-mcp/src/node_attr_tools.rs:469-477 | crates/op-mcp/src/page_tools.rs:495-503 | crates/op-mcp/src/write_tools.rs:279-289 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (9 lines × 3) crates/op-collab-smoke/src/fault_owner.rs:78— crates/op-collab-smoke/src/fault_owner.rs:78-86 | crates/op-collab-smoke/src/fault_owner.rs:115-123 | crates/op-collab-smoke/src/fault_owner.rs:168-176 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/op-editor-core/src/command_node_attrs/slots.rs:112— crates/op-editor-core/src/command_node_attrs/slots.rs:112-120 | crates/op-editor-core/src/fills/access.rs:65-73 | crates/op-orchestrator/src/variable_binding.rs:309-317 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/op-editor-core/src/fills/access.rs:233— crates/op-editor-core/src/fills/access.rs:233-241 | crates/op-host-services/src/pre_validator.rs:308-316 | crates/op-pen-loader/src/effects.rs:128-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
DesktopApp::handle_key_pressed (cyclomatic 136) crates/op-host-desktop/src/keyboard_input.rs:15— DesktopApp::handle_key_pressed has cyclomatic complexity 136 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DesktopApp::on_redraw_requested (cyclomatic 83) crates/op-host-desktop/src/app_handler/redraw.rs:35— DesktopApp::on_redraw_requested has cyclomatic complexity 83 (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.
DesktopApp::drain_git_action (cyclomatic 64) crates/op-host-desktop/src/git_host.rs:166— DesktopApp::drain_git_action has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DesktopApp::on_left_press (cyclomatic 39) crates/op-host-desktop/src/app_handler/pointer_events.rs:109— DesktopApp::on_left_press has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DesktopApp::handle_menu_action (cyclomatic 39) crates/op-host-desktop/src/menu_action.rs:68— DesktopApp::handle_menu_action has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DesktopApp::window_event (cyclomatic 35) crates/op-host-desktop/src/app_handler.rs:435— DesktopApp::window_event has cyclomatic complexity 35 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DesktopApp::resumed (cyclomatic 32) crates/op-host-desktop/src/app_handler.rs:96— DesktopApp::resumed 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.
DesktopApp::on_cursor_moved (cyclomatic 22) crates/op-host-desktop/src/app_handler/pointer_events.rs:30— DesktopApp::on_cursor_moved 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.
op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners (cyclomatic 94) crates/op-host-web/src/canvaskit/mount_keyboard.rs:12— op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners has cyclomatic complexity 94 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_host_web::canvaskit::mount::mount_ck (cyclomatic 45) crates/op-host-web/src/canvaskit/mount.rs:14— op_host_web::canvaskit::mount::mount_ck has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_host_web::dom_io::handle_paste_event (cyclomatic 22) crates/op-host-web/src/dom_io.rs:553— op_host_web::dom_io::handle_paste_event 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.
op_host_web::web_settings_validation::validate_credential_semantics (cyclomatic 20) crates/op-host-web/src/web_settings_validation.rs:486— op_host_web::web_settings_validation::validate_credential_semantics 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. This is NOT this file's highest cyclomatic complexity: SettingsValidationError::fmt (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_host_web::live_sync_glue::push_document_if_changed (cyclomatic 17) crates/op-host-web/src/live_sync_glue.rs:461— op_host_web::live_sync_glue::push_document_if_changed 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.
op_host_web::web_auth_sync::apply_login_status (cyclomatic 17) crates/op-host-web/src/web_auth_sync.rs:348— op_host_web::web_auth_sync::apply_login_status 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.
op_host_web::widget_host::group_ops::trace_grid_contours (cyclomatic 16) crates/op-host-web/src/widget_host/group_ops.rs:172— op_host_web::widget_host::group_ops::trace_grid_contours 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.
op_host_web::web_settings::apply_payload (cyclomatic 16) crates/op-host-web/src/web_settings.rs:398— op_host_web::web_settings::apply_payload 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.
GitPanel::hit_test (cognitive 88) crates/op-editor-ui/src/widgets/git_panel_hit.rs:14— GitPanel::hit_test has cognitive complexity 88 (threshold 15). Drivers by points: if/else 45 (73 pts), loops 5 (7 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::paint (cognitive 46) crates/op-editor-ui/src/widgets/git_panel/paint.rs:12— GitPanel::paint has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (36 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::branch_picker_hit (cognitive 26) crates/op-editor-ui/src/widgets/git_panel_menus/branch_picker.rs:311— GitPanel::branch_picker_hit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::ready_hit (cognitive 24) crates/op-editor-ui/src/widgets/git_panel_ready.rs:686— GitPanel::ready_hit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GitPanel::paint_branch_picker (cognitive 23) crates/op-editor-ui/src/widgets/git_panel_menus/branch_picker.rs:111— GitPanel::paint_branch_picker has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::paint_tracked_picker (cognitive 22) crates/op-editor-ui/src/widgets/git_panel_tracked_picker.rs:157— GitPanel::paint_tracked_picker has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::paint_ready (cognitive 18) crates/op-editor-ui/src/widgets/git_panel_ready.rs:300— GitPanel::paint_ready has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 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.
GitPanel::paint_empty_card (cognitive 16) crates/op-editor-ui/src/widgets/git_panel_empty.rs:196— GitPanel::paint_empty_card has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (11 lines × 3) crates/op-collab-smoke/src/fault_guest.rs:58— crates/op-collab-smoke/src/fault_guest.rs:58-68 | crates/op-collab-smoke/src/fault_guest.rs:95-105 | crates/op-collab-smoke/src/fault_guest.rs:133-143 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/op-collab-smoke/src/fault_owner.rs:298— crates/op-collab-smoke/src/fault_owner.rs:298-308 | crates/op-collab-smoke/src/fault_owner.rs:414-424 | crates/op-collab-smoke/src/fault_owner.rs:464-474 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/op-editor-ui/src/widgets/home_surface_connect.rs:89— crates/op-editor-ui/src/widgets/home_surface_connect.rs:89-99 | crates/op-editor-ui/src/widgets/home_surface_paint.rs:511-521 | crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:216-226 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (11 lines × 3) crates/op-host-desktop/src/design_md_host.rs:105— crates/op-host-desktop/src/design_md_host.rs:105-115 | crates/op-host-services/src/design_md_llm.rs:31-41 | crates/op-host-web/src/web_design_md.rs:288-298 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (11 lines × 3) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:34— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:34-44 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:103-113 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:338-348 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/op-host-web/src/live_sync.rs:133— crates/op-host-web/src/live_sync.rs:133-143 | crates/op-host-web/src/live_sync.rs:194-204 | crates/op-host-web/src/web_image_panel.rs:388-398 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) crates/op-preview-core/src/present.rs:281— crates/op-preview-core/src/present.rs:281-291 | crates/op-preview-core/src/session_paint.rs:55-65 | crates/op-preview-core/src/session_paint.rs:115-125 — before extracting anything, compare `crates/op-preview-core/src/present.rs` and `crates/op-preview-core/src/session_paint.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/op-orchestrator/src/cleanup.rs:139— crates/op-orchestrator/src/cleanup.rs:139-149 | crates/op-orchestrator/src/cleanup.rs:199-209 | crates/op-orchestrator/src/mobile_content_rail.rs:24-34 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Low cohesion: NativeBackend (LCOM4 28) crates/op-host-native/src/backend/skia.rs:91— NativeBackend's methods fall into 28 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 28 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: AgentSettings (LCOM4 6) crates/op-editor-core/src/agent_settings.rs:254— AgentSettings'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: ConfiguredBuiltinProvider (LCOM4 5) crates/op-host-services/src/chat_builtin_http.rs:51— ConfiguredBuiltinProvider's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RealCollabTicketProvider (LCOM4 4) crates/op-auth-bridge/src/real_collab_ticket.rs:53— RealCollabTicketProvider's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ChatState (LCOM4 4) crates/op-editor-core/src/chat.rs:156— ChatState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: EditorState (LCOM4 4) crates/op-editor-core/src/state.rs:56— EditorState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ChatSession (LCOM4 4) crates/op-editor-host-core/src/chat.rs:229— ChatSession's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VariablesPanel (LCOM4 4) crates/op-editor-ui/src/widgets/variables_panel.rs:127— VariablesPanel'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.
EditorState::apply_with_allocator (cyclomatic 177) crates/op-editor-core/src/command_apply.rs:55— EditorState::apply_with_allocator has cyclomatic complexity 177 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorState::cmd_set_node_layout_prop (cyclomatic 69) crates/op-editor-core/src/command_layout_prop.rs:130— EditorState::cmd_set_node_layout_prop has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorState::commit_property_edit_inner (cyclomatic 69) crates/op-editor-core/src/property_edit_mutators.rs:69— EditorState::commit_property_edit_inner has cyclomatic complexity 69 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
EditorState::active_text_input (cyclomatic 30) crates/op-editor-core/src/text_input_focus.rs:12— EditorState::active_text_input 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.
EditorState::active_text_input_mut (cyclomatic 26) crates/op-editor-core/src/text_input_focus.rs:104— EditorState::active_text_input_mut has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorState::cmd_set_ellipse_arc (cyclomatic 17) crates/op-editor-core/src/command_node_attrs/state_ops.rs:337— EditorState::cmd_set_ellipse_arc 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.
EditorState::move_node_to_drop_target (cyclomatic 17) crates/op-editor-core/src/drag_mutators.rs:298— EditorState::move_node_to_drop_target 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.
DesktopApp::on_redraw_requested (cognitive 96) crates/op-host-desktop/src/app_handler/redraw.rs:35— DesktopApp::on_redraw_requested has cognitive complexity 96 (threshold 15). Drivers by points: if/else 66 (82 pts), boolean chains 9, loops 2 (3 pts), match/switch 2 (nesting depth added 17). 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.
DesktopApp::handle_key_pressed (cognitive 95) crates/op-host-desktop/src/keyboard_input.rs:15— DesktopApp::handle_key_pressed has cognitive complexity 95 (threshold 15). Drivers by points: if/else 17 (40 pts), boolean chains 34, match/switch 6 (13 pts), loops 2 (8 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopApp::drain_git_action (cognitive 71) crates/op-host-desktop/src/git_host.rs:166— DesktopApp::drain_git_action has cognitive complexity 71 (threshold 15). Drivers by points: if/else 20 (45 pts), match/switch 6 (21 pts), boolean chains 5 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopApp::on_left_press (cognitive 70) crates/op-host-desktop/src/app_handler/pointer_events.rs:109— DesktopApp::on_left_press has cognitive complexity 70 (threshold 15). Drivers by points: if/else 32 (61 pts), match/switch 2 (8 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopApp::resumed (cognitive 47) crates/op-host-desktop/src/app_handler.rs:96— DesktopApp::resumed has cognitive complexity 47 (threshold 15). Drivers by points: if/else 25 (41 pts), boolean chains 3, match/switch 3 (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.
DesktopApp::handle_menu_action (cognitive 28) crates/op-host-desktop/src/menu_action.rs:68— DesktopApp::handle_menu_action has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 2 (4 pts), boolean chains 3 (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.
DesktopApp::on_cursor_moved (cognitive 25) crates/op-host-desktop/src/app_handler/pointer_events.rs:30— DesktopApp::on_cursor_moved has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (21 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:424— crates/op-auth-bridge/src/collab_claims.rs:424-444 | crates/op-collab-transport/src/admission.rs:588-608 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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) crates/op-chat-agent/src/design_agent_diagnostics.rs:522— crates/op-chat-agent/src/design_agent_diagnostics.rs:522-542 | crates/op-image-enrich/src/targets.rs:623-643 — 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 (21 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:352— crates/op-host-native/src/widget_host/preview_slideshow.rs:352-372 | crates/op-host-web/src/widget_host/preview_slideshow.rs:507-527 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 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) crates/op-html/src/css/cascade.rs:626— crates/op-html/src/css/cascade.rs:626-646 | crates/op-html/src/css/declarations_deferred.rs:87-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21 lines × 2) crates/op-chrome-extension-core/src/design_md_palette.rs:141— crates/op-chrome-extension-core/src/design_md_palette.rs:141-161 | crates/op-chrome-extension-core/src/design_md_render.rs:282-302 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21 lines × 2) crates/op-editor-host-core/src/settings_io_checked.rs:38— crates/op-editor-host-core/src/settings_io_checked.rs:38-58 | crates/op-host-web/src/web_settings_validation.rs:367-387 — 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 (21 lines × 2) templates/step0/_generators/tpl_tutorial_diy.py:302— templates/step0/_generators/tpl_tutorial_diy.py:302-322 | templates/step0/_generators/tpl_tutorial_report.py:270-290 — 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 `templates/step0/_generators/tpl_tutorial_diy.py:302` it begins part-way through the construct above it, so those 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.
op_pen_loader::adapter::node_payload::node_to_payload_with_text_context (cyclomatic 27) crates/op-pen-loader/src/adapter/node_payload.rs:11— op_pen_loader::adapter::node_payload::node_to_payload_with_text_context has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_pen_loader::payload::legacy_normalize::normalize_node_value (cyclomatic 23) crates/op-pen-loader/src/payload/legacy_normalize.rs:179— op_pen_loader::payload::legacy_normalize::normalize_node_value 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.
op_pen_loader::layout_repair::repair_inferred_horizontal_container (cyclomatic 21) crates/op-pen-loader/src/layout_repair.rs:176— op_pen_loader::layout_repair::repair_inferred_horizontal_container 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.
op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence (cyclomatic 16) crates/op-pen-loader/src/payload/legacy_normalize.rs:76— op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence 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.
op_pen_loader::layout_repair::repair_vertical_container (cyclomatic 16) crates/op-pen-loader/src/layout_repair.rs:63— op_pen_loader::layout_repair::repair_vertical_container has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: op_pen_loader::layout_repair::base (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_pen_loader::layout_repair::repair_split_metric_column_content (cyclomatic 16) crates/op-pen-loader/src/layout_repair.rs:296— op_pen_loader::layout_repair::repair_split_metric_column_content has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: op_pen_loader::layout_repair::base (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_image_enrich::net::providers::catalog::fetch_openverse_json (cognitive 37) crates/op-image-enrich/src/net/providers/catalog.rs:77— op_image_enrich::net::providers::catalog::fetch_openverse_json has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 19). 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.
op_image_enrich::net::providers::catalog::fetch_openverse_token_with_source (cognitive 24) crates/op-image-enrich/src/net/providers/catalog.rs:421— op_image_enrich::net::providers::catalog::fetch_openverse_token_with_source has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_image_enrich::net::fetch::fetch_judged_wikimedia (cognitive 18) crates/op-image-enrich/src/net/fetch.rs:241— op_image_enrich::net::fetch::fetch_judged_wikimedia has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), 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.
op_image_enrich::net::judge::select_with_judge (cognitive 16) crates/op-image-enrich/src/net/judge.rs:80— op_image_enrich::net::judge::select_with_judge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_image_enrich::apply::apply_result (cognitive 16) crates/op-image-enrich/src/apply.rs:48— op_image_enrich::apply::apply_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 3). 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.
op_image_enrich::net::providers::relevance::retain_relevant_hits_enforcing (cognitive 16) crates/op-image-enrich/src/net/providers/relevance.rs:364— op_image_enrich::net::providers::relevance::retain_relevant_hits_enforcing has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 6. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
op_engine_ffi::op_pointer (cognitive 35) crates/op-engine-ffi/src/lib.rs:412— op_engine_ffi::op_pointer has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::desc::parse_create (cognitive 27) crates/op-engine-ffi/src/desc.rs:276— op_engine_ffi::desc::parse_create has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 6, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_engine_ffi::editor_chat_turn::pump_sse_response (cognitive 21) crates/op-engine-ffi/src/editor_chat_turn.rs:218— op_engine_ffi::editor_chat_turn::pump_sse_response has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::input::apply_tap (cognitive 21) crates/op-engine-ffi/src/input.rs:124— op_engine_ffi::input::apply_tap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::editor_chat::execute_tool_requests (cognitive 21) crates/op-engine-ffi/src/editor_chat.rs:359— op_engine_ffi::editor_chat::execute_tool_requests has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::render::paint_into_canvas (cognitive 18) crates/op-engine-ffi/src/render.rs:102— op_engine_ffi::render::paint_into_canvas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×6
Duplicated block (18 lines × 2) crates/op-collab/src/diff_index.rs:128— crates/op-collab/src/diff_index.rs:128-145 | crates/op-editor-core/src/command_refine.rs:187-204 — before extracting anything, compare `crates/op-collab/src/diff_index.rs` and `crates/op-editor-core/src/command_refine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 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 × 2) crates/op-collab/src/guest_pending.rs:40— crates/op-collab/src/guest_pending.rs:40-57 | crates/op-collab/src/guest_pending.rs:93-110 — both copies are in the same file, so extract the 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) crates/op-collab-relay-server/src/connection.rs:496— crates/op-collab-relay-server/src/connection.rs:496-513 | crates/op-collab-relay-server/src/connection_wait.rs:57-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) crates/op-orchestrator/src/category_grid_reflow.rs:182— crates/op-orchestrator/src/category_grid_reflow.rs:182-199 | crates/op-orchestrator/src/repair_record.rs:475-492 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) crates/op-pen-loader/src/layout_scene.rs:97— crates/op-pen-loader/src/layout_scene.rs:97-114 | crates/op-pen-loader/src/layout_scene.rs:142-159 — both copies are in the same file, so extract the 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) templates/step0/_generators/tpl_cityguide_carousel.py:416— templates/step0/_generators/tpl_cityguide_carousel.py:416-433 | templates/step0/_generators/tpl_toolkit_carousel.py:345-362 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11–12 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_account.rs:98— crates/op-editor-ui/src/widgets/agent_settings_account.rs:98-109 | crates/op-editor-ui/src/widgets/agent_settings_account.rs:253-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/op-editor-ui/src/widgets/component_browser_panel.rs:546— crates/op-editor-ui/src/widgets/component_browser_panel.rs:546-557 | crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:124-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 2) crates/op-host-native/src/backend/skia/path.rs:439— crates/op-host-native/src/backend/skia/path.rs:439-449 | crates/op-host-native/src/backend/skia/path.rs:532-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/op-mcp/src/parser.rs:174— crates/op-mcp/src/parser.rs:174-184 | crates/op-mcp/src/parser.rs:395-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/op-pen-loader/src/style_payload.rs:537— crates/op-pen-loader/src/style_payload.rs:537-547 | crates/op-preview-core/src/session_paint.rs:610-621 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11–12 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:98— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:98-109 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:188-198 — before extracting anything, compare `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt` and `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 3) crates/op-design-lint/src/node_util.rs:383— crates/op-design-lint/src/node_util.rs:383-392 | crates/op-pen-loader/src/adapter/geometry.rs:22-31 | crates/op-pen-loader/src/authored_geometry.rs:80-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) crates/op-editor-core/src/path_bounds.rs:20— crates/op-editor-core/src/path_bounds.rs:20-29 | crates/op-editor-core/src/svg_path_bounds.rs:16-25 | crates/op-editor-core/src/svg_path_data.rs:171-180 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10 lines × 3) crates/op-html/src/css/cascade_shared.rs:54— crates/op-html/src/css/cascade_shared.rs:54-63 | crates/op-html/src/css/declaration_syntax.rs:194-203 | crates/op-html/src/css/declaration_syntax.rs:310-319 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) crates/op-collab-relay-control-plane/src/http_client.rs:217— crates/op-collab-relay-control-plane/src/http_client.rs:217-226 | crates/op-collab-relay-control-plane/src/issuer.rs:150-159 | crates/op-collab-relay-control-plane/src/publish.rs:393-402 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10 lines × 3) crates/op-orchestrator/src/cleanup_bottom_nav_repairs.rs:84— crates/op-orchestrator/src/cleanup_bottom_nav_repairs.rs:84-93 | crates/op-orchestrator/src/cleanup_clip_row_stroke.rs:39-48 | crates/op-orchestrator/src/cleanup_container_geometry.rs:40-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10 lines × 3) templates/step0/_generators/tpl2.py:172— templates/step0/_generators/tpl2.py:172-181 | templates/step0/_generators/tpl3.py:106-115 | templates/step0/_generators/tpl_quote_card.py:126-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl2.py:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner (cyclomatic 36) crates/op-chat-agent/src/chat_agent_loop/openai.rs:37— op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner (cyclomatic 35) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:80— op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard (cyclomatic 34) crates/op-chat-agent/src/design_agent_tools.rs:172— op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard 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.
op_chat_agent::design_context::collect_design_facts (cyclomatic 16) crates/op-chat-agent/src/design_context.rs:84— op_chat_agent::design_context::collect_design_facts 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.
op_chat_agent::design_agent_diagnostics::scan_container_intent (cyclomatic 16) crates/op-chat-agent/src/design_agent_diagnostics.rs:204— op_chat_agent::design_agent_diagnostics::scan_container_intent 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.
op_design_lint::plan::detect_and_plan (cyclomatic 23) crates/op-design-lint/src/plan.rs:94— op_design_lint::plan::detect_and_plan has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_design_lint::detectors::spacing::walk_edge_section_padding (cyclomatic 19) crates/op-design-lint/src/detectors/spacing.rs:431— op_design_lint::detectors::spacing::walk_edge_section_padding 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.
op_design_lint::detectors::typography::first_solid_color (cyclomatic 19) crates/op-design-lint/src/detectors/typography.rs:268— op_design_lint::detectors::typography::first_solid_color 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.
op_design_lint::fixes::set_property (cyclomatic 18) crates/op-design-lint/src/fixes.rs:14— op_design_lint::fixes::set_property has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_design_lint::detectors::siblings::check_consistency (cyclomatic 16) crates/op-design-lint/src/detectors/siblings.rs:151— op_design_lint::detectors::siblings::check_consistency 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.
op_ai_skills::style_guide::token_table::extract_table_colors (cyclomatic 19) crates/op-ai-skills/src/style_guide/token_table.rs:288— op_ai_skills::style_guide::token_table::extract_table_colors 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.
op_ai_skills::style_guide::parser::extract_typography (cyclomatic 17) crates/op-ai-skills/src/style_guide/parser.rs:168— op_ai_skills::style_guide::parser::extract_typography 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.
op_ai_skills::budget::trim_by_budget_pinned (cyclomatic 16) crates/op-ai-skills/src/budget.rs:121— op_ai_skills::budget::trim_by_budget_pinned 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.
op_ai_skills::frontmatter::entries (cyclomatic 16) crates/op-ai-skills/src/frontmatter.rs:119— op_ai_skills::frontmatter::entries has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_ai_skills::frontmatter::parse_skill_frontmatter (cyclomatic 16) crates/op-ai-skills/src/frontmatter.rs:189— op_ai_skills::frontmatter::parse_skill_frontmatter has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_pen_loader::payload::legacy_normalize::normalize_node_value (cognitive 73) crates/op-pen-loader/src/payload/legacy_normalize.rs:179— op_pen_loader::payload::legacy_normalize::normalize_node_value has cognitive complexity 73 (threshold 15). Drivers by points: if/else 14 (60 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 52). 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.
op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence (cognitive 45) crates/op-pen-loader/src/payload/legacy_normalize.rs:76— op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (34 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_pen_loader::style_payload::shader_payload (cognitive 27) crates/op-pen-loader/src/style_payload.rs:293— op_pen_loader::style_payload::shader_payload has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_pen_loader::layout_repair::repair_inferred_horizontal_container (cognitive 27) crates/op-pen-loader/src/layout_repair.rs:176— op_pen_loader::layout_repair::repair_inferred_horizontal_container has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 3 (6 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.
op_pen_loader::style_payload::fill_fallback_color (cognitive 20) crates/op-pen-loader/src/style_payload.rs:402— op_pen_loader::style_payload::fill_fallback_color has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (3 pts) (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.
op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token (cognitive 53) crates/op-editor-host-core/src/codegen_session.rs:236— op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (29 pts), match/switch 4 (15 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_host_core::settings_io::apply_payload_with_options (cognitive 27) crates/op-editor-host-core/src/settings_io.rs:316— op_editor_host_core::settings_io::apply_payload_with_options has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24 (27 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_editor_host_core::chat::chat_history_from_transcript (cognitive 24) crates/op-editor-host-core/src/chat.rs:335— op_editor_host_core::chat::chat_history_from_transcript has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_host_core::settings_io_checked::validate_credential_entries (cognitive 22) crates/op-editor-host-core/src/settings_io_checked.rs:194— op_editor_host_core::settings_io_checked::validate_credential_entries has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_host_core::codegen_runtime_state::pump_codegen_state (cognitive 17) crates/op-editor-host-core/src/codegen_runtime_state.rs:103— op_editor_host_core::codegen_runtime_state::pump_codegen_state has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::vectorizeSvg (cognitive 49) crates/op-html/assets/snapshot-extractor.js:586— (anonymous)::vectorizeSvg has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 10, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::buildImage (cognitive 21) crates/op-html/assets/snapshot-extractor.js:776— (anonymous)::buildImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (2 pts), 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.
(anonymous)::buildInlineRun (cognitive 21) crates/op-html/assets/snapshot-extractor.js:1054— (anonymous)::buildInlineRun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::shapeToPathData (cognitive 19) crates/op-html/assets/snapshot-extractor.js:485— (anonymous)::shapeToPathData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::buildTextLines (cognitive 18) crates/op-html/assets/snapshot-extractor.js:359— (anonymous)::buildTextLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: prompt.rs → plan_normalize.rs, run_tests_b4.rs, variables.rs crates/op-orchestrator/src/prompt.rs— `crates/op-orchestrator/src/prompt.rs` changes together with 3 other files — `crates/op-orchestrator/src/plan_normalize.rs`, `crates/op-orchestrator/src/run_tests_b4.rs`, `crates/op-orchestrator/src/variables.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: mcp_serve.rs → command.rs, command_apply.rs, lib.rs, parser.rs, write_tools.rs crates/op-host-desktop/src/mcp_serve.rs— `crates/op-host-desktop/src/mcp_serve.rs` changes together with 5 other files — `crates/op-editor-core/src/command.rs`, `crates/op-editor-core/src/command_apply.rs`, `crates/op-mcp/src/lib.rs`, `crates/op-mcp/src/parser.rs`, `crates/op-mcp/src/write_tools.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: editor_ui_state.rs → git_panel_ready.rs, property_panel_action.rs, git_host.rs, git_press.rs, overlay_rects.rs crates/op-editor-core/src/editor_ui_state.rs— `crates/op-editor-core/src/editor_ui_state.rs` changes together with 5 other files — `crates/op-editor-ui/src/widgets/git_panel_ready.rs`, `crates/op-editor-ui/src/widgets/property_panel_action.rs`, `crates/op-host-desktop/src/git_host.rs`, `crates/op-host-native/src/widget_host/git_press.rs`, `crates/op-host-native/src/widget_host/overlay_rects.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: tests.rs → ai_chat_hit.rs, ai_chat_panel_hit.rs, ai_chat_panel_paint.rs crates/op-editor-ui/src/widgets/ai_chat_panel/tests.rs— `crates/op-editor-ui/src/widgets/ai_chat_panel/tests.rs` changes together with 3 other files — `crates/op-editor-ui/src/widgets/ai_chat_hit.rs`, `crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs`, `crates/op-editor-ui/src/widgets/ai_chat_panel_paint.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: chat.rs → ai_chat_hit.rs, click.rs, press.rs crates/op-editor-core/src/chat.rs— `crates/op-editor-core/src/chat.rs` changes together with 3 other files — `crates/op-editor-ui/src/widgets/ai_chat_hit.rs`, `crates/op-host-native/src/widget_host/click.rs`, `crates/op-host-web/src/widget_host/press.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Duplicated block (19 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:326— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:326-344 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:284-302 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) crates/op-editor-ui/src/widgets/property_panel_text.rs:297— crates/op-editor-ui/src/widgets/property_panel_text.rs:297-315 | crates/op-editor-ui/src/widgets/property_panel_text.rs:334-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/op-engine-ffi/src/editor_model_discovery.rs:225— crates/op-engine-ffi/src/editor_model_discovery.rs:225-243 | crates/op-host-desktop/src/builtin_model_refresh_host.rs:118-136 — 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 (19 lines × 2) crates/op-host-native/src/widget_host/press_helpers.rs:58— crates/op-host-native/src/widget_host/press_helpers.rs:58-76 | crates/op-host-web/src/widget_host/shape_create.rs:69-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (19 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:218— crates/op-host-native/src/widget_host/preview_slideshow.rs:218-236 | crates/op-host-web/src/widget_host/preview_slideshow.rs:369-387 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 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–16 lines × 2) crates/op-figma/src/instance/assignment.rs:52— crates/op-figma/src/instance/assignment.rs:52-67 | crates/op-figma/src/instance/assignment.rs:128-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) crates/op-host-web/src/vscode_bridge.rs:168— crates/op-host-web/src/vscode_bridge.rs:168-183 | crates/op-host-web/src/vscode_bridge/early_listener.rs:117-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–16 lines × 2) crates/op-mcp/src/script_runner.rs:648— crates/op-mcp/src/script_runner.rs:648-662 | crates/op-orchestrator/src/parse.rs:74-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–16 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:149— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:149-163 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:328-343 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:149` 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 (15–16 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:120— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:120-135 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:207-221 — before extracting anything, compare `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt` and `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:102— crates/op-editor-core/src/svg_import/path_data.rs:102-111 | crates/op-editor-core/src/svg_import/path_data.rs:172-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) crates/op-editor-ui/src/widgets/figma_import.rs:361— crates/op-editor-ui/src/widgets/figma_import.rs:361-372 | crates/op-editor-ui/src/widgets/figma_import_progress.rs:155-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–12 lines × 2) crates/op-engine-jni/src/callbacks.rs:114— crates/op-engine-jni/src/callbacks.rs:114-125 | crates/op-engine-jni/src/callbacks.rs:138-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:224— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:224-235 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:100-109 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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–12 lines × 2) crates/op-host-web/src/live_sync.rs:103— crates/op-host-web/src/live_sync.rs:103-114 | crates/op-host-web/src/live_sync.rs:164-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168 · crates/op-host-web/src/op_ck_bridge.js:572 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (11 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241 · crates/op-host-web/src/op_ck_bridge.js:1013 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (11 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431 · crates/op-host-web/src/op_ck_bridge.js:1909 — the 2 copies are spread across 2 files, 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) crates/op-host-web/src/op_ck_bridge.js:1517— crates/op-host-web/src/op_ck_bridge.js:1517 · crates/op-host-web/src/op_ck_bridge.js:1636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2 locations) packages/op-chrome-extension/design-capture.js:61— packages/op-chrome-extension/design-capture.js:61 · packages/op-chrome-extension/design-evidence.js:28 — 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.
AIChatPlaceholder::hit_test_with_canonical (cyclomatic 65) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:60— AIChatPlaceholder::hit_test_with_canonical has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AIChatPlaceholder::paint (cyclomatic 26) crates/op-editor-ui/src/widgets/ai_chat_panel/widget_paint.rs:23— AIChatPlaceholder::paint has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AIChatPlaceholder::footer_hover_at (cyclomatic 19) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:581— AIChatPlaceholder::footer_hover_at has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AIChatPlaceholder::resize_edge_at (cyclomatic 18) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:411— AIChatPlaceholder::resize_edge_at has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_collab_relay_server::connection::relay_paired (cyclomatic 25) crates/op-collab-relay-server/src/connection.rs:477— op_collab_relay_server::connection::relay_paired 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.
op_collab_relay_server::connection::serve_connection (cyclomatic 23) crates/op-collab-relay-server/src/connection.rs:92— op_collab_relay_server::connection::serve_connection has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_collab_relay_server::connection_wait::wait_for_pair (cyclomatic 20) crates/op-collab-relay-server/src/connection_wait.rs:33— op_collab_relay_server::connection_wait::wait_for_pair has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_collab_relay_server::parse_arg_values (cyclomatic 17) crates/op-collab-relay-server/src/main.rs:121— op_collab_relay_server::parse_arg_values has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
opCkInit::measureParagraph (cognitive 92) crates/op-host-web/src/op_ck_bridge.js:1609— opCkInit::measureParagraph has cognitive complexity 92 (threshold 15). Drivers by points: if/else 19 (49 pts), loops 8 (20 pts), ternaries 6 (15 pts), boolean chains 8 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opCkInit::drawImageWithOptions (cognitive 53) crates/op-host-web/src/op_ck_bridge.js:1353— opCkInit::drawImageWithOptions has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 6 (13 pts), boolean chains 9, loops 2 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opCkInit::registeredCoverageSegments (cognitive 22) crates/op-host-web/src/op_ck_bridge.js:917— opCkInit::registeredCoverageSegments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opCkInit::textFirstBaseline (cognitive 20) crates/op-host-web/src/op_ck_bridge.js:1504— opCkInit::textFirstBaseline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 4, loops 1 (2 pts) (nesting depth added 3). 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.
op_collab_host::runtime::network::connection::drive_guest (cognitive 80) crates/op-collab-host/src/runtime/network/connection.rs:188— op_collab_host::runtime::network::connection::drive_guest has cognitive complexity 80 (threshold 15). Drivers by points: if/else 15 (49 pts), match/switch 8 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_host::runtime::network::connection::drive_owner_peer (cognitive 67) crates/op-collab-host/src/runtime/network/connection.rs:41— op_collab_host::runtime::network::connection::drive_owner_peer has cognitive complexity 67 (threshold 15). Drivers by points: if/else 12 (40 pts), match/switch 7 (22 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_host::runtime::network::owner::run_inner (cognitive 66) crates/op-collab-host/src/runtime/network/owner.rs:67— op_collab_host::runtime::network::owner::run_inner has cognitive complexity 66 (threshold 15). Drivers by points: if/else 12 (36 pts), match/switch 11 (25 pts), loops 3 (5 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_host::runtime::network::guest::run_inner (cognitive 19) crates/op-collab-host/src/runtime/network/guest.rs:209— op_collab_host::runtime::network::guest::run_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_smoke::main (cognitive 70) crates/op-smoke/src/main.rs:214— op_smoke::main has cognitive complexity 70 (threshold 15). Drivers by points: if/else 24 (36 pts), match/switch 16 (30 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_smoke::image_fill::fill_images (cognitive 23) crates/op-smoke/src/image_fill.rs:61— op_smoke::image_fill::fill_images has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_smoke::audit_rubric::interactivity_report (cognitive 20) crates/op-smoke/src/audit_rubric.rs:141— op_smoke::audit_rubric::interactivity_report has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_smoke::loop_mode::run_loop (cognitive 16) crates/op-smoke/src/loop_mode.rs:305— op_smoke::loop_mode::run_loop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 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.
op_opmerge::merge_core (cognitive 43) crates/op-opmerge/src/lib.rs:167— op_opmerge::merge_core has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 3 (7 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_opmerge::apply_overrides (cognitive 41) crates/op-opmerge/src/lib.rs:565— op_opmerge::apply_overrides has cognitive complexity 41 (threshold 15). Drivers by points: if/else 6 (24 pts), loops 4 (14 pts), match/switch 2 (3 pts) (nesting depth added 29). 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.
op_opmerge::remap_colliding_image_ids (cognitive 23) crates/op-opmerge/src/lib.rs:351— op_opmerge::remap_colliding_image_ids has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_opmerge::collect (cognitive 19) crates/op-opmerge/src/lib.rs:434— op_opmerge::collect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 pts), match/switch 2 (3 pts) (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.
op_codegen::codegen_html::emit_node_html (cognitive 27) crates/op-codegen/src/codegen_html.rs:40— op_codegen::codegen_html::emit_node_html has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_codegen::ai::pipeline_preflight::plan_structure_issue (cognitive 24) crates/op-codegen/src/ai/pipeline_preflight.rs:225— op_codegen::ai::pipeline_preflight::plan_structure_issue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (7 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.
op_codegen::codegen_targets::emit_node_jsx (cognitive 22) crates/op-codegen/src/codegen_targets.rs:294— op_codegen::codegen_targets::emit_node_jsx has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_codegen::ai::parse::infer_imports_from_code (cognitive 16) crates/op-codegen/src/ai/parse.rs:149— op_codegen::ai::parse::infer_imports_from_code has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 1, loops 1 (nesting depth added 10). 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.
op_collab::ticket_json::decode_ticket_string (cognitive 26) crates/op-collab/src/ticket_json.rs:127— op_collab::ticket_json::decode_ticket_string has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (5 pts), boolean chains 2, 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.
op_collab::guest::validate_welcome (cognitive 19) crates/op-collab/src/guest.rs:505— op_collab::guest::validate_welcome has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab::codec::validate_presence (cognitive 17) crates/op-collab/src/codec.rs:745— op_collab::codec::validate_presence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab::diff_fields::collect_property_changes (cognitive 16) crates/op-collab/src/diff_fields.rs:12— op_collab::diff_fields::collect_property_changes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuestSessionCore::handle_undo_result (cognitive 20) crates/op-collab/src/guest_sync.rs:290— GuestSessionCore::handle_undo_result has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuestSessionCore::finalize_install (cognitive 17) crates/op-collab/src/guest.rs:322— GuestSessionCore::finalize_install has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (4 pts), match/switch 1 (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.
GuestSessionCore::handle_snapshot (cognitive 16) crates/op-collab/src/guest_sync.rs:92— GuestSessionCore::handle_snapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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.
GuestSessionCore::prepare_commit_install (cognitive 16) crates/op-collab/src/guest_sync.rs:192— GuestSessionCore::prepare_commit_install has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (15–17 lines × 2) crates/op-collab-transport/src/driver.rs:421— crates/op-collab-transport/src/driver.rs:421-435 | crates/op-collab-transport/src/driver.rs:504-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–17 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:120— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:120-134 | crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:151-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–17 lines × 2) crates/op-host-web/src/preview_pump.rs:58— crates/op-host-web/src/preview_pump.rs:58-72 | crates/op-host-web/src/tooltip_pump.rs:42-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–17 lines × 2) REDACTED:131— REDACTED:131-147 | REDACTED:165-179 — both copies are in the same file, so extract the 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–17 lines × 2) crates/op-editor-core/src/instance_child_override.rs:22— crates/op-editor-core/src/instance_child_override.rs:22-38 | crates/op-editor-core/src/ref_resolve.rs:490-505 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16–17 lines × 2) crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:285— crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:285-301 | crates/op-editor-ui/src/widgets/property_panel_code_error.rs:268-283 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16–17 lines × 2) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:311— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:311-326 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:429-445 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16–17 lines × 2) crates/op-engine-ffi/src/editor_chat_design_tools.rs:67— crates/op-engine-ffi/src/editor_chat_design_tools.rs:67-83 | crates/op-host-desktop/src/chat_session.rs:537-552 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14–15 lines × 2) crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:55— crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:55-69 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:243-256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14–15 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:300— crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:300-314 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:429-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/op-image-enrich/src/net/providers/catalog.rs:111— crates/op-image-enrich/src/net/providers/catalog.rs:111-125 | crates/op-image-enrich/src/net/providers/catalog.rs:459-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/op-orchestrator/src/run_tests_b4.rs:46— crates/op-orchestrator/src/run_tests_b4.rs:46-60 | crates/op-orchestrator/src/run_tests_b4.rs:67-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 3) crates/op-editor-ui/src/widgets/property_panel_fill.rs:559— crates/op-editor-ui/src/widgets/property_panel_fill.rs:559-570 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:231-242 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:420-431 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) crates/op-host-services/src/export_html.rs:60— crates/op-host-services/src/export_html.rs:60-71 | crates/op-host-services/src/export_hyperframes.rs:204-215 | crates/op-host-services/src/export_pptx.rs:101-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (12 lines × 3) crates/op-orchestrator/src/board_trailing_void.rs:114— crates/op-orchestrator/src/board_trailing_void.rs:114-125 | crates/op-orchestrator/src/cleanup_section_margins.rs:293-304 | crates/op-orchestrator/src/cleanup_slide_padding.rs:399-410 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) packaging/ios/Sources/AccountCenterViewController.swift:229— packaging/ios/Sources/AccountCenterViewController.swift:229-240 | packaging/ios/Sources/NativeLoginViewController.swift:644-655 | packaging/ios/Sources/UpdateChecker.swift:89-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/ios/Sources/AccountCenterViewController.swift:229` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 4) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:283— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:283-291 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:381-389 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:509-517 | crates/op-editor-ui/src/widgets/property_panel_layer.rs:227-235 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:235— crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:235-243 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:265-273 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:231-239 | crates/op-orchestrator/src/cleanup_typography.rs:103-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (9 lines × 4) crates/op-mcp/src/node_attr_tools.rs:102— crates/op-mcp/src/node_attr_tools.rs:102-110 | crates/op-mcp/src/node_attr_tools.rs:140-148 | crates/op-mcp/src/node_attr_tools.rs:255-263 | crates/op-mcp/src/node_attr_tools.rs:313-323 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) crates/op-editor-core/src/command_style_replace.rs:417— crates/op-editor-core/src/command_style_replace.rs:417-425 | crates/op-editor-core/src/fills/access.rs:158-166 | crates/op-figma/src/clipboard.rs:562-570 | crates/op-orchestrator/src/variable_binding.rs:285-293 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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 × 4) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:74— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:74-81 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:526-533 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:471-478 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:608-615 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) crates/op-auth-bridge/prebuilt_provenance.rs:490— crates/op-auth-bridge/prebuilt_provenance.rs:490-497 | crates/op-cli/src/html_cli.rs:254-261 | crates/op-host-desktop/src/html_import_session.rs:208-215 | crates/op-html/src/resources_image_metadata.rs:167-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (8 lines × 4) crates/op-editor-core/src/agent_indicators.rs:706— crates/op-editor-core/src/agent_indicators.rs:706-713 | crates/op-editor-host-core/src/chat.rs:108-115 | crates/op-editor-host-core/src/chat.rs:132-139 | crates/op-editor-host-core/src/chat.rs:143-150 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 4) crates/op-codegen/src/lib.rs:253— crates/op-codegen/src/lib.rs:253-260 | crates/op-design-lint/src/node_util.rs:414-421 | crates/op-editor-core/src/fills/access.rs:13-20 | crates/op-mcp/src/style_ops_tools.rs:433-440 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (10 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9 · crates/op-host-web/src/op_ck_bridge.js:9 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (10 lines × 2 locations) crates/op-html/assets/snapshot-extractor.js:420— crates/op-html/assets/snapshot-extractor.js:420 · crates/op-html/assets/snapshot-extractor.js:765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2 locations) packages/op-chrome-extension/client.js:94— packages/op-chrome-extension/client.js:94 · packages/op-chrome-extension/client.js:452 — 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 (10 lines × 2 locations) packages/op-vscode/src/vscode/shell-messages.ts:36— packages/op-vscode/src/vscode/shell-messages.ts:36 · packages/op-vscode/src/vscode/shell-messages.ts:87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151 · crates/op-host-web/src/op_ck_bridge.js:544 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (9 lines × 2 locations) crates/op-html/assets/snapshot-extractor.js:1071— crates/op-html/assets/snapshot-extractor.js:1071 · crates/op-html/assets/snapshot-extractor.js:1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2 locations) packages/op-chrome-extension/account.js:130— packages/op-chrome-extension/account.js:130 · packages/op-chrome-extension/client.js:432 — the 2 copies are spread across 2 files, 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 (9 lines × 2 locations) packages/op-chrome-extension/background.js:178— packages/op-chrome-extension/background.js:178 · packages/op-chrome-extension/design-md.js:34 — 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.
AC1 · Text alternatives· <canvas> without a text alternative · ×3
<canvas> without a text alternative crates/op-host-services/src/web_static/index.html:45— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative crates/op-host-web/smoke/step-1b.html:37— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative crates/op-web-sdk/smoke/index.html:22— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure· Page without a main landmark · ×3
Page without a main landmark crates/op-host-services/src/web_static/missing_bundle.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark crates/op-web-sdk/smoke/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark packages/op-chrome-extension/popup.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
GitPanel::hit_test (cyclomatic 56) crates/op-editor-ui/src/widgets/git_panel_hit.rs:14— GitPanel::hit_test has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GitPanel::paint (cyclomatic 26) crates/op-editor-ui/src/widgets/git_panel/paint.rs:12— GitPanel::paint 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.
GitPanel::ready_hit (cyclomatic 21) crates/op-editor-ui/src/widgets/git_panel_ready.rs:686— GitPanel::ready_hit has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CollabPanel::paint (cyclomatic 40) crates/op-editor-ui/src/widgets/collab_panel.rs:122— CollabPanel::paint 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.
CollabPanel::hit_test (cyclomatic 25) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:11— CollabPanel::hit_test 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.
CollabPanel::hover_at (cyclomatic 22) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:115— CollabPanel::hover_at 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.
opCkInit::measureParagraph (cyclomatic 39) crates/op-host-web/src/op_ck_bridge.js:1609— opCkInit::measureParagraph has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
opCkInit::drawImageWithOptions (cyclomatic 34) crates/op-host-web/src/op_ck_bridge.js:1353— opCkInit::drawImageWithOptions 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.
opCkInit::textFirstBaseline (cyclomatic 16) crates/op-host-web/src/op_ck_bridge.js:1504— opCkInit::textFirstBaseline 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.
op_collab_host::runtime::network::connection::drive_guest (cyclomatic 34) crates/op-collab-host/src/runtime/network/connection.rs:188— op_collab_host::runtime::network::connection::drive_guest 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.
op_collab_host::runtime::network::owner::run_inner (cyclomatic 33) crates/op-collab-host/src/runtime/network/owner.rs:67— op_collab_host::runtime::network::owner::run_inner has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_collab_host::runtime::network::connection::drive_owner_peer (cyclomatic 29) crates/op-collab-host/src/runtime/network/connection.rs:41— op_collab_host::runtime::network::connection::drive_owner_peer 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.
collectDesignEvidenceInPage::walkRules (cyclomatic 31) packages/op-chrome-extension/design-capture.js:363— collectDesignEvidenceInPage::walkRules has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
collectDesignEvidenceInPage::toHex (cyclomatic 19) packages/op-chrome-extension/design-capture.js:104— collectDesignEvidenceInPage::toHex 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.
collectDesignEvidenceInPage::componentSample (cyclomatic 19) packages/op-chrome-extension/design-capture.js:311— collectDesignEvidenceInPage::componentSample has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TopBar::button_rect_with_measure (cyclomatic 24) crates/op-editor-ui/src/widgets/top_bar_geometry.rs:359— TopBar::button_rect_with_measure 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.
TopBar::hit_test_with_git_rect (cyclomatic 23) crates/op-editor-ui/src/widgets/top_bar.rs:401— TopBar::hit_test_with_git_rect has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TopBar::paint_chrome (cyclomatic 23) crates/op-editor-ui/src/widgets/top_bar_paint.rs:17— TopBar::paint_chrome 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.
op_editor_host_core::settings_io::apply_payload_with_options (cyclomatic 23) crates/op-editor-host-core/src/settings_io.rs:316— op_editor_host_core::settings_io::apply_payload_with_options has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token (cyclomatic 23) crates/op-editor-host-core/src/codegen_session.rs:236— op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token 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.
op_editor_host_core::codegen_runtime_state::pump_codegen_state (cyclomatic 16) crates/op-editor-host-core/src/codegen_runtime_state.rs:103— op_editor_host_core::codegen_runtime_state::pump_codegen_state has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AIChatPlaceholder::hit_test_with_canonical (cognitive 145) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:60— AIChatPlaceholder::hit_test_with_canonical has cognitive complexity 145 (threshold 15). Drivers by points: if/else 56 (125 pts), boolean chains 12, loops 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 74). 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.
AIChatPlaceholder::paint (cognitive 35) crates/op-editor-ui/src/widgets/ai_chat_panel/widget_paint.rs:23— AIChatPlaceholder::paint has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 6 (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.
AIChatPlaceholder::footer_hover_at (cognitive 20) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:581— AIChatPlaceholder::footer_hover_at has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 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.
LayerPanel::paint (cognitive 87) crates/op-editor-ui/src/widgets/layer_panel.rs:394— LayerPanel::paint has cognitive complexity 87 (threshold 15). Drivers by points: if/else 49 (77 pts), boolean chains 6, loops 2, match/switch 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayerPanel::hit_test (cognitive 24) crates/op-editor-ui/src/widgets/layer_panel_hit.rs:117— LayerPanel::hit_test has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5 (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.
LayerPanel::drop_target_at (cognitive 18) crates/op-editor-ui/src/widgets/layer_panel_hit.rs:45— LayerPanel::drop_target_at has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabPanel::paint (cognitive 85) crates/op-editor-ui/src/widgets/collab_panel.rs:122— CollabPanel::paint has cognitive complexity 85 (threshold 15). Drivers by points: if/else 36 (72 pts), loops 5 (10 pts), boolean chains 2, match/switch 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabPanel::hit_test (cognitive 47) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:11— CollabPanel::hit_test has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabPanel::hover_at (cognitive 35) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:115— CollabPanel::hover_at has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collectDesignEvidenceInPage::walkRules (cognitive 71) packages/op-chrome-extension/design-capture.js:363— collectDesignEvidenceInPage::walkRules has cognitive complexity 71 (threshold 15). Drivers by points: if/else 20 (56 pts), boolean chains 9, loops 2 (4 pts), error handling 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.
collectDesignEvidenceInPage::toHex (cognitive 24) packages/op-chrome-extension/design-capture.js:104— collectDesignEvidenceInPage::toHex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (8 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collectDesignEvidenceInPage::componentSample (cognitive 16) packages/op-chrome-extension/design-capture.js:311— collectDesignEvidenceInPage::componentSample has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, other 1, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TopBar::paint_chrome (cognitive 43) crates/op-editor-ui/src/widgets/top_bar_paint.rs:17— TopBar::paint_chrome has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (33 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TopBar::hit_test_with_git_rect (cognitive 26) crates/op-editor-ui/src/widgets/top_bar.rs:401— TopBar::hit_test_with_git_rect has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TopBar::button_rect_with_measure (cognitive 20) crates/op-editor-ui/src/widgets/top_bar_geometry.rs:359— TopBar::button_rect_with_measure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_preview_core::binding_overlay_apply::apply_value (cognitive 40) crates/op-preview-core/src/binding_overlay_apply.rs:12— op_preview_core::binding_overlay_apply::apply_value has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (39 pts), match/switch 1 (nesting depth added 20). 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.
op_preview_core::binding_sites::collect_binding_sites_under (cognitive 40) crates/op-preview-core/src/binding_sites.rs:73— op_preview_core::binding_sites::collect_binding_sites_under has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (30 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 2 (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.
op_preview_core::motion::collect_load_warnings (cognitive 32) crates/op-preview-core/src/motion.rs:37— op_preview_core::motion::collect_load_warnings has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 5 (16 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_relay_server::connection::relay_paired (cognitive 39) crates/op-collab-relay-server/src/connection.rs:477— op_collab_relay_server::connection::relay_paired has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (29 pts), match/switch 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_relay_server::connection::serve_connection (cognitive 23) crates/op-collab-relay-server/src/connection.rs:92— op_collab_relay_server::connection::serve_connection has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 11 (13 pts), if/else 8 (9 pts), boolean chains 1 (nesting depth added 3). 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.
op_collab_relay_server::connection_wait::wait_for_pair (cognitive 20) crates/op-collab-relay-server/src/connection_wait.rs:33— op_collab_relay_server::connection_wait::wait_for_pair has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (8 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.
PreviewMotionState::observe_transitions (cognitive 30) crates/op-preview-core/src/motion.rs:130— PreviewMotionState::observe_transitions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewMotionState::start_node_animation (cognitive 25) crates/op-preview-core/src/motion.rs:417— PreviewMotionState::start_node_animation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts), match/switch 1 (2 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.
PreviewMotionState::observe_in_view (cognitive 23) crates/op-preview-core/src/motion.rs:280— PreviewMotionState::observe_in_view has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewSession::reconcile (cognitive 26) crates/op-preview-core/src/app_mode.rs:194— PreviewSession::reconcile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (6 pts), match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewSession::pinned_nav_candidate (cognitive 19) crates/op-preview-core/src/present.rs:157— PreviewSession::pinned_nav_candidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 3 (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.
PreviewSession::enter_with_host_motion_preference (cognitive 16) crates/op-preview-core/src/session.rs:296— PreviewSession::enter_with_host_motion_preference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×3
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/op-editor-core/src/property_edit_mutators.rs:500— crates/op-editor-core/src/property_edit_mutators.rs:500-509 | crates/op-editor-core/src/property_edit_mutators.rs:511-520 | crates/op-editor-core/src/property_edit_mutators.rs:522-531 | crates/op-editor-core/src/property_edit_mutators.rs:533-542 | crates/op-editor-core/src/property_edit_mutators.rs:600-609 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/op-orchestrator/src/absolute_child_clamp.rs:141— crates/op-orchestrator/src/absolute_child_clamp.rs:141-164 | crates/op-orchestrator/src/absolute_child_clamp.rs:279-302 | crates/op-orchestrator/src/none_stack_inset.rs:24-47 | crates/op-orchestrator/src/section_shell_fill_repair.rs:144-171 | crates/op-orchestrator/src/text_fit.rs:200-223 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) templates/step0/_generators/tpl_bookreview_carousel.py:230— templates/step0/_generators/tpl_bookreview_carousel.py:230-247 | templates/step0/_generators/tpl_cityguide_carousel.py:251-283 | templates/step0/_generators/tpl_opinion_carousel.py:211-221 | templates/step0/_generators/tpl_story_carousel.py:214-226 | templates/step0/_generators/tpl_yearreview_carousel.py:311-329 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (24 lines × 2) crates/op-chrome-extension-core/src/op_export.rs:76— crates/op-chrome-extension-core/src/op_export.rs:76-99 | crates/op-cli/src/html_cli.rs:264-287 — 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 (24 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:298— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:298-321 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:252-275 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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 (24 lines × 2) crates/op-mcp/src/script_runner.rs:509— crates/op-mcp/src/script_runner.rs:509-532 | crates/op-mcp/src/script_runner.rs:562-585 — both copies are in the same file, so extract the 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 (23 lines × 2) crates/op-host-services/src/chat_builtin_http.rs:286— crates/op-host-services/src/chat_builtin_http.rs:286-308 | crates/op-host-services/src/chat_runtime.rs:103-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (23 lines × 2) crates/op-orchestrator/src/validation_dump.rs:214— crates/op-orchestrator/src/validation_dump.rs:214-236 | crates/op-orchestrator/src/validation_dump.rs:364-386 — both copies are in the same file, so extract the 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 (23 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:267— templates/step0/_generators/tpl_tutorial_skincare.py:267-289 | templates/step0/_generators/tpl_tutorial_storage.py:277-299 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `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 (22 lines × 2) crates/op-cli/src/html_cli.rs:153— crates/op-cli/src/html_cli.rs:153-174 | crates/op-cli/src/html_cli.rs:181-202 — both copies are in the same file, so extract the 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 (22 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:153— crates/op-collab-host/src/runtime/network/connection.rs:153-174 | crates/op-collab-host/src/runtime/network/connection.rs:320-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/op-host-services/src/import_html_url.rs:254— crates/op-host-services/src/import_html_url.rs:254-275 | crates/op-host-services/src/web_credentials.rs:217-238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14–17 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:37— crates/op-editor-core/src/svg_import/path_data.rs:37-53 | crates/op-editor-core/src/svg_path_data.rs:65-78 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 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–17 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:110— crates/op-host-native/src/widget_host/slides_panel.rs:110-126 | crates/op-host-web/src/widget_host/slides_panel.rs:76-89 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 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–17 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262-278 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:225-238 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–17 lines × 2) crates/op-host-desktop/src/app_state.rs:545— crates/op-host-desktop/src/app_state.rs:545-557 | crates/op-host-desktop/src/app_state.rs:579-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–17 lines × 2) templates/step0/_generators/tpl_tutorial_carousel.py:362— templates/step0/_generators/tpl_tutorial_carousel.py:362-374 | templates/step0/_generators/tpl_yearreview_carousel.py:508-524 — 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 `templates/step0/_generators/tpl_tutorial_carousel.py:362` 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–17 lines × 2) packaging/ios/Sources/AuthCodeFormViewController.swift:164— packaging/ios/Sources/AuthCodeFormViewController.swift:164-180 | packaging/ios/Sources/NativeLoginViewController.swift:183-195 — 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 `packaging/ios/Sources/NativeLoginViewController.swift:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) crates/op-editor-core/src/host_support_allocator.rs:187— crates/op-editor-core/src/host_support_allocator.rs:187-200 | crates/op-editor-core/src/host_support_allocator.rs:232-245 | crates/op-editor-core/src/host_support_allocator.rs:289-302 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) crates/op-host-services/src/doc_io.rs:283— crates/op-host-services/src/doc_io.rs:283-296 | crates/op-host-services/src/web_canvas_server/doc_routes.rs:99-112 | crates/op-host-web/src/file_actions.rs:384-397 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (14 lines × 3) crates/op-mcp/src/parser.rs:240— crates/op-mcp/src/parser.rs:240-253 | crates/op-mcp/src/parser.rs:275-288 | crates/op-mcp/src/parser.rs:458-471 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–14 lines × 2) crates/op-host-native/src/backend/skia.rs:536— crates/op-host-native/src/backend/skia.rs:536-549 | crates/op-host-native/src/backend/skia.rs:565-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) crates/op-html/src/resources.rs:513— crates/op-html/src/resources.rs:513-524 | crates/op-html/src/resources.rs:560-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) templates/step0/_generators/tpl_compare_three_way.py:261— templates/step0/_generators/tpl_compare_three_way.py:261-274 | templates/step0/_generators/tpl_infographic_list.py:234-245 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:329— crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:329-341 | crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:398-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/op-html/src/resources_css_urls.rs:16— crates/op-html/src/resources_css_urls.rs:16-29 | crates/op-html/src/resources_css_urls.rs:192-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/op-orchestrator/src/cleanup_section_margins.rs:134— crates/op-orchestrator/src/cleanup_section_margins.rs:134-147 | crates/op-orchestrator/src/cleanup_slide_padding.rs:130-142 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–13 lines × 2) crates/op-editor-core/src/instance_override.rs:119— crates/op-editor-core/src/instance_override.rs:119-127 | crates/op-editor-core/src/ref_resolve.rs:241-253 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–13 lines × 2) crates/op-editor-host-core/src/codegen_runtime_state.rs:44— crates/op-editor-host-core/src/codegen_runtime_state.rs:44-56 | crates/op-host-web/src/codegen_web.rs:151-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9–13 lines × 2) crates/op-orchestrator/src/cleanup_section_margins.rs:226— crates/op-orchestrator/src/cleanup_section_margins.rs:226-234 | crates/op-orchestrator/src/cleanup_slide_padding.rs:296-308 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint.rs:512— crates/op-editor-ui/src/widgets/home_surface_paint.rs:512-524 | crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:217-228 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 2) crates/op-host-desktop/src/image_panel_host.rs:187— crates/op-host-desktop/src/image_panel_host.rs:187-199 | crates/op-host-web/src/web_image_panel.rs:345-356 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12–13 lines × 2) crates/op-preview-core/src/present.rs:300— crates/op-preview-core/src/present.rs:300-312 | crates/op-preview-core/src/session_paint.rs:137-148 — before extracting anything, compare `crates/op-preview-core/src/present.rs` and `crates/op-preview-core/src/session_paint.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/op-editor-ui/src/widgets/property_panel_fill.rs:530— crates/op-editor-ui/src/widgets/property_panel_fill.rs:530-540 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:202-212 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:325-336 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:391-401 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/op-orchestrator/src/board_trailing_void.rs:127— crates/op-orchestrator/src/board_trailing_void.rs:127-137 | crates/op-orchestrator/src/cleanup_section_margins.rs:281-291 | crates/op-orchestrator/src/cleanup_slide_padding.rs:421-431 | crates/op-orchestrator/src/geometry_validation.rs:132-142 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) templates/step0/_generators/tpl_cityguide_carousel.py:438— templates/step0/_generators/tpl_cityguide_carousel.py:438-448 | templates/step0/_generators/tpl_opinion_carousel.py:413-426 | templates/step0/_generators/tpl_story_carousel.py:431-443 | templates/step0/_generators/tpl_yearreview_carousel.py:544-554 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8–11 lines × 3) crates/op-host-services/src/chat_spawn.rs:179— crates/op-host-services/src/chat_spawn.rs:179-186 | crates/op-host-services/src/cli_probe_support.rs:112-122 | crates/op-host-services/src/provider_probe.rs:330-337 — before extracting anything, compare `crates/op-host-services/src/chat_spawn.rs` and `crates/op-host-services/src/provider_probe.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–11 lines × 3) crates/op-host-web/src/agent_indicator_sync.rs:71— crates/op-host-web/src/agent_indicator_sync.rs:71-81 | crates/op-host-web/src/preview_pump.rs:66-73 | crates/op-host-web/src/tooltip_pump.rs:50-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8–11 lines × 3) crates/op-pen-loader/src/adapter/entry.rs:119— crates/op-pen-loader/src/adapter/entry.rs:119-128 | crates/op-pen-loader/src/adapter/pages.rs:31-41 | crates/op-pen-loader/src/adapter/pages.rs:49-56 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10–11 lines × 2) crates/op-editor-ui/src/widgets/layer_panel.rs:490— crates/op-editor-ui/src/widgets/layer_panel.rs:490-500 | crates/op-editor-ui/src/widgets/layer_panel.rs:678-687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/op-editor-ui/src/widgets/property_panel_image_node.rs:152— crates/op-editor-ui/src/widgets/property_panel_image_node.rs:152-161 | crates/op-editor-ui/src/widgets/property_panel_text.rs:279-289 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_caret.rs:142— crates/op-editor-ui/src/widgets/agent_settings_caret.rs:142-152 | crates/op-editor-ui/src/widgets/property_panel_text_input.rs:62-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–10 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:144— crates/op-editor-core/src/svg_import/path_data.rs:144-151 | crates/op-editor-core/src/svg_import/path_data.rs:168-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) crates/op-host-desktop/src/figma_import_session/publish.rs:178— crates/op-host-desktop/src/figma_import_session/publish.rs:178-185 | crates/op-host-desktop/src/figma_import_session/publish.rs:200-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) crates/op-host-services/src/import_html_url.rs:54— crates/op-host-services/src/import_html_url.rs:54-63 | crates/op-mcp/src/import_common.rs:131-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7–8 lines × 2) crates/op-editor-ui/src/widgets/font_picker_cache.rs:78— crates/op-editor-ui/src/widgets/font_picker_cache.rs:78-85 | crates/op-editor-ui/src/widgets/layer_panel_cache.rs:216-222 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 2) crates/op-figma/src/vector_decoder.rs:214— crates/op-figma/src/vector_decoder.rs:214-220 | crates/op-figma/src/vector_decoder.rs:224-231 — both copies are in the same file, so extract the 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–8 lines × 2) crates/op-host-desktop/src/design_md_host.rs:381— crates/op-host-desktop/src/design_md_host.rs:381-388 | crates/op-host-desktop/src/design_md_host.rs:491-497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 4) crates/op-codegen/src/lib.rs:270— crates/op-codegen/src/lib.rs:270-274 | crates/op-design-lint/src/node_util.rs:431-435 | crates/op-editor-core/src/fills/access.rs:30-34 | crates/op-mcp/src/style_ops_tools.rs:450-454 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (5 lines × 4) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:681— crates/op-editor-ui/src/widgets/prompt_center_panel.rs:681-685 | crates/op-editor-ui/src/widgets/variables_panel/geometry.rs:84-88 | crates/op-host-native/src/widget_host/variables_preset_press.rs:267-271 | crates/op-host-web/src/widget_host/variables_preset_press.rs:169-173 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 × 4) crates/op-design-lint/src/node_util.rs:556— crates/op-design-lint/src/node_util.rs:556-560 | crates/op-editor-core/src/property_edit_mutators.rs:743-747 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:281-285 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:301-305 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409 · crates/op-host-web/src/op_ck_bridge.js:1761 — the 2 copies are spread across 2 files, 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 (7 lines × 2 locations) packages/op-chrome-extension/background.js:223— packages/op-chrome-extension/background.js:223 · packages/op-chrome-extension/popup.js:316 — 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.
Duplicated block (7 lines × 2 locations) packages/op-chrome-extension/design-capture.js:402— packages/op-chrome-extension/design-capture.js:402 · packages/op-chrome-extension/design-capture.js:413 — 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 (6 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312 · crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:324 — both copies are in the same file, so extract the 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 locations) crates/op-host-web/src/op_ck_bridge.js:182— crates/op-host-web/src/op_ck_bridge.js:182 · crates/op-host-web/src/op_ck_bridge.js:221 — 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 (6 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:1557— crates/op-host-web/src/op_ck_bridge.js:1557 · crates/op-host-web/src/op_ck_bridge.js:1648 — 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.
op_cli::command_from_positionals (cyclomatic 52) crates/op-cli/src/main.rs:366— op_cli::command_from_positionals has cyclomatic complexity 52 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_cli::parse_args (cyclomatic 17) crates/op-cli/src/main.rs:278— op_cli::parse_args 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. This is NOT this file's highest cyclomatic complexity: op_cli::run (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PropertyPanel::paint (cyclomatic 52) crates/op-editor-ui/src/widgets/property_panel/paint.rs:31— PropertyPanel::paint has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PropertyPanel::hit_test_action_logical (cyclomatic 32) crates/op-editor-ui/src/widgets/property_panel/hit.rs:78— PropertyPanel::hit_test_action_logical 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.
LayerPanel::paint (cyclomatic 41) crates/op-editor-ui/src/widgets/layer_panel.rs:394— LayerPanel::paint 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.
LayerPanel::hit_test (cyclomatic 17) crates/op-editor-ui/src/widgets/layer_panel_hit.rs:117— LayerPanel::hit_test 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.
op_chrome_extension_core::design_md_validate::is_valid (cyclomatic 35) crates/op-chrome-extension-core/src/design_md_validate.rs:16— op_chrome_extension_core::design_md_validate::is_valid has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_chrome_extension_core::design_md_validate::treatment_json_is_valid (cyclomatic 20) crates/op-chrome-extension-core/src/design_md_validate.rs:286— op_chrome_extension_core::design_md_validate::treatment_json_is_valid 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.
op_auth_bridge::collab_union_policy::canonicalize (cyclomatic 26) crates/op-auth-bridge/src/collab_union_policy.rs:367— op_auth_bridge::collab_union_policy::canonicalize 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.
op_auth_bridge::collab_claims::validate_claims (cyclomatic 17) crates/op-auth-bridge/src/collab_claims.rs:309— op_auth_bridge::collab_claims::validate_claims 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.
op_engine_ffi::desc::parse_create (cyclomatic 25) crates/op-engine-ffi/src/desc.rs:276— op_engine_ffi::desc::parse_create has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_engine_ffi::op_pointer (cyclomatic 24) crates/op-engine-ffi/src/lib.rs:412— op_engine_ffi::op_pointer 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.
OwnerSessionCore::handle_undo_request (cyclomatic 20) crates/op-collab/src/session_undo.rs:77— OwnerSessionCore::handle_undo_request 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.
OwnerSessionCore::handle_submit (cyclomatic 18) crates/op-collab/src/session_submit.rs:14— OwnerSessionCore::handle_submit 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.
GuestSessionCore::accept_frame (cyclomatic 19) crates/op-collab/src/guest_sync.rs:21— GuestSessionCore::accept_frame has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GuestSessionCore::handle_undo_result (cyclomatic 16) crates/op-collab/src/guest_sync.rs:290— GuestSessionCore::handle_undo_result 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.
PromptCenterPanel::hit_test (cyclomatic 19) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:258— PromptCenterPanel::hit_test 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.
PromptCenterPanel::hover_at (cyclomatic 16) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:207— PromptCenterPanel::hover_at 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.
PreviewSession::reconcile (cyclomatic 19) crates/op-preview-core/src/app_mode.rs:194— PreviewSession::reconcile 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.
PreviewSession::dispatch_input_inner (cyclomatic 16) crates/op-preview-core/src/input_event.rs:342— PreviewSession::dispatch_input_inner 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.
op_host_web.debugString (cyclomatic 18) crates/op-host-web/pkg-ck/op_host_web.js:923— op_host_web.debugString 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.
op_host_web.debugString (cyclomatic 18) crates/op-host-web/pkg-webgl/op_host_web.js:1362— op_host_web.debugString 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.
op_image_enrich::net::providers::catalog::fetch_openverse_json (cyclomatic 16) crates/op-image-enrich/src/net/providers/catalog.rs:77— op_image_enrich::net::providers::catalog::fetch_openverse_json 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.
op_image_enrich::net::providers::relevance::retain_relevant_hits_enforcing (cyclomatic 16) crates/op-image-enrich/src/net/providers/relevance.rs:364— op_image_enrich::net::providers::relevance::retain_relevant_hits_enforcing has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PropertyPanel::paint (cognitive 68) crates/op-editor-ui/src/widgets/property_panel/paint.rs:31— PropertyPanel::paint has cognitive complexity 68 (threshold 15). Drivers by points: if/else 37 (54 pts), boolean chains 14 (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.
PropertyPanel::hit_test_action_logical (cognitive 42) crates/op-editor-ui/src/widgets/property_panel/hit.rs:78— PropertyPanel::hit_test_action_logical has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (32 pts), match/switch 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserState::handle_action (cognitive 53) crates/op-collab-transport/src/discovery_bonjour_browser.rs:251— BrowserState::handle_action has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (42 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 29). 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.
BrowserState::emit_service (cognitive 20) crates/op-collab-transport/src/discovery_bonjour_browser.rs:505— BrowserState::emit_service has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SceneTemplatePanel::hit_test (cognitive 46) crates/op-editor-ui/src/widgets/scene_template_hit.rs:100— SceneTemplatePanel::hit_test has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 3 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SceneTemplatePanel::hover_at (cognitive 16) crates/op-editor-ui/src/widgets/scene_template_hit.rs:26— SceneTemplatePanel::hover_at has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GitRepo::candidate_op_files (cognitive 39) crates/op-git/src/candidates.rs:34— GitRepo::candidate_op_files has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 2 (7 pts) (nesting depth added 28). 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.
GitRepo::merge_branch_isolated (cognitive 18) crates/op-git/src/merge.rs:255— GitRepo::merge_branch_isolated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chrome_extension_core::design_md_validate::is_valid (cognitive 32) crates/op-chrome-extension-core/src/design_md_validate.rs:16— op_chrome_extension_core::design_md_validate::is_valid has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 11, loops 2, match/switch 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.
op_chrome_extension_core::design_md_validate::treatment_json_is_valid (cognitive 23) crates/op-chrome-extension-core/src/design_md_validate.rs:286— op_chrome_extension_core::design_md_validate::treatment_json_is_valid has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, loops 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.
op_auth_bridge::collab_union_policy::canonicalize (cognitive 31) crates/op-auth-bridge/src/collab_union_policy.rs:367— op_auth_bridge::collab_union_policy::canonicalize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 12, 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.
op_auth_bridge::collab_claims::validate_claims (cognitive 16) crates/op-auth-bridge/src/collab_claims.rs:309— op_auth_bridge::collab_claims::validate_claims has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_collab_relay_client::bridge::owner::run_owner (cognitive 31) crates/op-collab-relay-client/src/bridge/owner.rs:287— op_collab_relay_client::bridge::owner::run_owner has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (5 pts), loops 3 (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.
op_collab_relay_client::session::pump (cognitive 27) crates/op-collab-relay-client/src/session.rs:191— op_collab_relay_client::session::pump has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromptCenterPanel::hit_test (cognitive 31) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:258— PromptCenterPanel::hit_test has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromptCenterPanel::hover_at (cognitive 22) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:207— PromptCenterPanel::hover_at has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SheetParser::parse_range (cognitive 28) crates/op-html/src/css/cascade_parser.rs:158— SheetParser::parse_range has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SheetParser::at_block (cognitive 19) crates/op-html/src/css/cascade_parser.rs:256— SheetParser::at_block has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_compound (cognitive 28) crates/op-html/src/css/selectors_parser.rs:145— Parser::parse_compound has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_number (cognitive 18) crates/op-html/src/length.rs:478— Parser::parse_number has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodegenPipeline::step_chunks (cognitive 25) crates/op-codegen/src/ai/pipeline.rs:355— CodegenPipeline::step_chunks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodegenPipeline::apply_plan (cognitive 17) crates/op-codegen/src/ai/pipeline.rs:235— CodegenPipeline::apply_plan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SlidesPanelTabs::paint (cognitive 25) crates/op-editor-ui/src/widgets/slides_panel_tabs.rs:286— SlidesPanelTabs::paint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SlidesPanelTabs::layout_rects (cognitive 17) crates/op-editor-ui/src/widgets/slides_panel_tabs.rs:147— SlidesPanelTabs::layout_rects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_host_web.debugString (cognitive 24) crates/op-host-web/pkg-ck/op_host_web.js:923— op_host_web.debugString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_host_web.debugString (cognitive 24) crates/op-host-web/pkg-webgl/op_host_web.js:1362— op_host_web.debugString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DesignMdPanel::section_lines (cognitive 22) crates/op-editor-ui/src/widgets/design_md_panel.rs:280— DesignMdPanel::section_lines has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignMdPanel::hit_test (cognitive 20) crates/op-editor-ui/src/widgets/design_md_panel.rs:406— DesignMdPanel::hit_test has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabRuntime::route_guest_output_inner (cognitive 19) crates/op-collab-host/src/runtime/effects.rs:348— CollabRuntime::route_guest_output_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 5). 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.
CollabRuntime::connection_closed (cognitive 17) crates/op-collab-host/src/runtime/effects.rs:512— CollabRuntime::connection_closed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_smoke::fault_owner::retry_exactly_once (cognitive 19) crates/op-collab-smoke/src/fault_owner.rs:47— op_collab_smoke::fault_owner::retry_exactly_once has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 8, match/switch 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.
op_collab_smoke::guest::run (cognitive 18) crates/op-collab-smoke/src/guest.rs:20— op_collab_smoke::guest::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_transport::discovery_bonjour::interface_advertisements (cognitive 19) crates/op-collab-transport/src/discovery_bonjour.rs:342— op_collab_transport::discovery_bonjour::interface_advertisements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_transport::discovery_bonjour::publisher_worker (cognitive 16) crates/op-collab-transport/src/discovery_bonjour.rs:178— op_collab_transport::discovery_bonjour::publisher_worker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_process_io::process_tree::terminate_process_tree (cognitive 19) crates/op-process-io/src/process_tree.rs:353— op_process_io::process_tree::terminate_process_tree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_process_io::process_tree::terminate_tokio_process_tree (cognitive 17) crates/op-process-io/src/process_tree.rs:406— op_process_io::process_tree::terminate_tokio_process_tree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (4 pts), boolean chains 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.
op_host_web.__wbg_load (cognitive 19) crates/op-host-web/pkg-ck/op_host_web.js:1151— op_host_web.__wbg_load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web.__wbg_load (cognitive 19) crates/op-host-web/pkg-webgl/op_host_web.js:1632— op_host_web.__wbg_load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OwnerSessionCore::handle_undo_request (cognitive 18) crates/op-collab/src/session_undo.rs:77— OwnerSessionCore::handle_undo_request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OwnerSessionCore::handle_submit (cognitive 16) crates/op-collab/src/session_submit.rs:14— OwnerSessionCore::handle_submit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 3, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeBackend::draw_text (cognitive 18) crates/op-host-native/src/backend/skia/text.rs:186— NativeBackend::draw_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeBackend::cached_raster_svg_path (cognitive 16) crates/op-host-native/src/backend/skia/path.rs:100— NativeBackend::cached_raster_svg_path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/op-engine-jni/src/bindings_editor.rs:65— crates/op-engine-jni/src/bindings_editor.rs:65-89 | crates/op-engine-jni/src/bindings_editor.rs:109-131 | crates/op-engine-jni/src/bindings_editor.rs:142-172 | crates/op-engine-jni/src/bindings_editor.rs:193-217 | crates/op-engine-jni/src/bindings_editor.rs:361-382 | crates/op-engine-jni/src/bindings_editor.rs:417-439 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) templates/step0/_generators/tpl_cards.py:84— templates/step0/_generators/tpl_cards.py:84-95 | templates/step0/_generators/tpl_journal_card.py:191-201 | templates/step0/_generators/tpl_lecture_light.py:155-165 | templates/step0/_generators/tpl_pitch_dark.py:143-153 | templates/step0/_generators/tpl_quote_card.py:89-99 | templates/step0/_generators/tpl_quote_card.py:103-116 — 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.
Duplicated block (31–32 lines × 2) crates/op-collab-relay-server/src/connection.rs:546— crates/op-collab-relay-server/src/connection.rs:546-577 | crates/op-collab-relay-server/src/connection_wait.rs:97-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (31–32 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:337— crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:337-367 | crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:394-425 — both copies are in the same file, so extract the 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 (31 lines × 2) crates/op-html/src/css/declaration_syntax.rs:172— crates/op-html/src/css/declaration_syntax.rs:172-202 | crates/op-html/src/css/declaration_syntax.rs:288-318 — both copies are in the same file, so extract the 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 (31 lines × 2) crates/op-orchestrator/src/mobile_content_rail.rs:87— crates/op-orchestrator/src/mobile_content_rail.rs:87-117 | crates/op-orchestrator/src/mobile_content_rail.rs:119-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28–30 lines × 2) crates/op-editor-core/src/svg_import/lexer.rs:11— crates/op-editor-core/src/svg_import/lexer.rs:11-40 | crates/op-editor-core/src/svg_import/xml.rs:96-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (28–30 lines × 2) crates/op-orchestrator/src/finalize_enforce_status_bar.rs:57— crates/op-orchestrator/src/finalize_enforce_status_bar.rs:57-86 | crates/op-orchestrator/src/unify_shared_status_bar.rs:161-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20–22 lines × 2) crates/op-engine-jni/src/bindings.rs:218— crates/op-engine-jni/src/bindings.rs:218-237 | crates/op-engine-napi/src/bindings.rs:229-250 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20–22 lines × 2) crates/op-orchestrator/src/orchestration_self_check.rs:375— crates/op-orchestrator/src/orchestration_self_check.rs:375-396 | crates/op-orchestrator/src/role_post_pass/mobile_cards.rs:22-41 — 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 (18–22 lines × 2) crates/op-host-desktop/src/app_state.rs:442— crates/op-host-desktop/src/app_state.rs:442-463 | crates/op-host-desktop/src/app_state.rs:490-507 — both copies are in the same file, so extract the 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–22 lines × 2) templates/step0/_generators/tpl_tutorial_photo.py:317— templates/step0/_generators/tpl_tutorial_photo.py:317-334 | templates/step0/_generators/tpl_tutorial_storage.py:231-252 — 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 `templates/step0/_generators/tpl_tutorial_photo.py:317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) crates/op-ai-skills/src/style_guide/design_md_import.rs:155— crates/op-ai-skills/src/style_guide/design_md_import.rs:155-175 | crates/op-chrome-extension-core/src/design_md_render.rs:533-551 — 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 (19–21 lines × 2) crates/op-host-desktop/src/font_import_host.rs:38— crates/op-host-desktop/src/font_import_host.rs:38-56 | crates/op-host-desktop/src/font_import_host.rs:84-104 — both copies are in the same file, so extract the 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–20 lines × 2) crates/op-ai-skills/src/resolve.rs:64— crates/op-ai-skills/src/resolve.rs:64-83 | crates/op-orchestrator/src/prompt_style_skills.rs:296-313 — 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 (18–20 lines × 2) crates/op-mcp/src/node_attr_tools.rs:246— crates/op-mcp/src/node_attr_tools.rs:246-263 | crates/op-mcp/src/node_attr_tools.rs:304-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–20 lines × 2) crates/op-pen-loader/src/adapter/entry.rs:28— crates/op-pen-loader/src/adapter/entry.rs:28-47 | crates/op-pen-loader/src/adapter/entry.rs:67-83 — both copies are in the same file, so extract the 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 (17–20 lines × 2) crates/op-pen-loader/src/style_payload.rs:470— crates/op-pen-loader/src/style_payload.rs:470-489 | crates/op-preview-core/src/session_paint.rs:535-551 — 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 (18–19 lines × 2) crates/op-editor-ui/src/widgets/property_panel_compositing.rs:325— crates/op-editor-ui/src/widgets/property_panel_compositing.rs:325-343 | crates/op-editor-ui/src/widgets/property_panel_text.rs:498-515 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18–19 lines × 2) crates/op-mcp/src/batch_program.rs:568— crates/op-mcp/src/batch_program.rs:568-586 | crates/op-mcp/src/batch_program_exec_ops.rs:204-221 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 3) crates/op-auth-bridge/src/collab_claims.rs:455— crates/op-auth-bridge/src/collab_claims.rs:455-472 | crates/op-collab-transport/src/admission.rs:619-636 | crates/op-collab/src/profile_validation.rs:79-96 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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) crates/op-auth-bridge/src/collab_claims.rs:541— crates/op-auth-bridge/src/collab_claims.rs:541-558 | crates/op-collab-transport/src/admission.rs:681-698 | crates/op-collab/src/profile_validation.rs:143-160 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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) crates/op-ai-skills/src/resolve.rs:128— crates/op-ai-skills/src/resolve.rs:128-144 | crates/op-orchestrator/src/prompt_style_skills.rs:341-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–18 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:172— templates/step0/_generators/tpl_tutorial_skincare.py:172-188 | templates/step0/_generators/tpl_tutorial_storage.py:179-196 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) crates/op-pen-loader/src/adapter/shapes.rs:8— crates/op-pen-loader/src/adapter/shapes.rs:8-24 | crates/op-pen-loader/src/adapter/shapes.rs:28-44 | crates/op-pen-loader/src/adapter/shapes.rs:51-67 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) templates/step0/_generators/tpl_cityguide_carousel.py:462— templates/step0/_generators/tpl_cityguide_carousel.py:462-479 | templates/step0/_generators/tpl_toolkit_carousel.py:434-455 | templates/step0/_generators/tpl_yearreview_carousel.py:569-585 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16 lines × 3) crates/op-design-lint/src/detectors/spacing.rs:253— crates/op-design-lint/src/detectors/spacing.rs:253-268 | crates/op-host-services/src/pre_validator.rs:139-154 | crates/op-orchestrator/src/validation_scroll_guard.rs:58-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (16 lines × 3) crates/op-mcp/src/parser.rs:99— crates/op-mcp/src/parser.rs:99-114 | crates/op-mcp/src/parser.rs:359-374 | crates/op-orchestrator/src/plan.rs:168-183 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12–16 lines × 2) crates/op-image-enrich/src/targets.rs:403— crates/op-image-enrich/src/targets.rs:403-418 | crates/op-image-enrich/src/targets.rs:560-571 — both copies are in the same file, so extract the 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–16 lines × 2) templates/step0/_generators/tpl_compare_do_dont.py:159— templates/step0/_generators/tpl_compare_do_dont.py:159-170 | templates/step0/_generators/tpl_journal_card.py:137-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12–15 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:45— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:45-59 | crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:200-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:62— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:62-73 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:248-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–14 lines × 2) crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:432— crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:432-442 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:172-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–14 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:313— crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:313-323 | crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:430-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–13 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:243— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:243-255 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:195-204 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–13 lines × 2) templates/step0/_generators/tpl_toolkit_carousel.py:269— templates/step0/_generators/tpl_toolkit_carousel.py:269-281 | templates/step0/_generators/tpl_tutorial_carousel.py:418-427 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 4) crates/op-mcp/src/batch_get.rs:240— crates/op-mcp/src/batch_get.rs:240-251 | crates/op-mcp/src/read_nodes.rs:103-114 | crates/op-mcp/src/style_ops_tools.rs:158-169 | crates/op-mcp/src/style_ops_tools.rs:174-185 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12 lines × 4) crates/op-mcp/src/import_common.rs:62— crates/op-mcp/src/import_common.rs:62-73 | crates/op-mcp/src/write_tools.rs:106-117 | crates/op-mcp/src/write_tools.rs:175-186 | crates/op-mcp/src/write_tools_import_svg.rs:58-69 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9–11 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:236— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:236-246 | crates/op-editor-ui/src/widgets/property_panel_interactions.rs:311-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–11 lines × 2) crates/op-host-native/src/backend/skia/gradient.rs:46— crates/op-host-native/src/backend/skia/gradient.rs:46-56 | crates/op-host-native/src/backend/skia/gradient.rs:101-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 5) crates/op-orchestrator/src/absolute_child_clamp.rs:144— crates/op-orchestrator/src/absolute_child_clamp.rs:144-153 | crates/op-orchestrator/src/absolute_child_clamp.rs:282-291 | crates/op-orchestrator/src/none_stack_inset.rs:27-36 | crates/op-orchestrator/src/section_shell_fill_repair.rs:145-154 | crates/op-orchestrator/src/text_fit.rs:203-212 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 5) templates/step0/_generators/tpl_journal_card.py:191— templates/step0/_generators/tpl_journal_card.py:191-200 | templates/step0/_generators/tpl_lecture_light.py:155-164 | templates/step0/_generators/tpl_pitch_dark.py:143-152 | templates/step0/_generators/tpl_quote_card.py:89-98 | templates/step0/_generators/tpl_quote_card.py:103-115 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `templates/step0/_generators/tpl_pitch_dark.py:136` calls `neon_rule`, `rect`, `linear` and `templates/step0/_generators/tpl_quote_card.py:85` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 9) crates/op-collab/src/diff_index.rs:134— crates/op-collab/src/diff_index.rs:134-142 | crates/op-editor-core/src/command_refine.rs:193-201 | crates/op-host-services/src/chat_system_prompt.rs:205-213 | crates/op-mcp/src/batch_get.rs:445-453 | crates/op-mcp/src/open_document.rs:172-180 | crates/op-mcp/src/tools.rs:45-53 | crates/op-orchestrator/src/validation_dump.rs:252-260 | crates/op-orchestrator/src/validation_fixes_apply.rs:650-658 | crates/op-orchestrator/src/validation_fixes_b3.rs:500-508 — before extracting anything, compare `crates/op-collab/src/diff_index.rs` and `crates/op-editor-core/src/command_refine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 9) crates/op-host-desktop/src/git_jobs.rs:95— crates/op-host-desktop/src/git_jobs.rs:95-103 | crates/op-host-desktop/src/git_jobs.rs:207-215 | crates/op-host-desktop/src/git_jobs.rs:245-253 | crates/op-host-desktop/src/git_jobs.rs:289-297 | crates/op-host-desktop/src/git_jobs.rs:345-353 | crates/op-host-desktop/src/iconify_host.rs:67-75 | crates/op-host-desktop/src/update_check.rs:103-111 | crates/op-host-services/src/acp_agent_probe_host.rs:107-115 | crates/op-host-services/src/provider_probe_host.rs:69-77 — there are 9 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 7) crates/op-orchestrator/src/category_grid_reflow.rs:120— crates/op-orchestrator/src/category_grid_reflow.rs:120-128 | crates/op-orchestrator/src/geometry_bottom_gap.rs:81-89 | crates/op-orchestrator/src/geometry_validation.rs:223-231 | crates/op-orchestrator/src/geometry_validation.rs:388-396 | crates/op-orchestrator/src/radial_repair.rs:433-441 | crates/op-orchestrator/src/sidebar_archetype.rs:18-26 | crates/op-orchestrator/src/stub_repair.rs:10-18 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 7) crates/op-mcp/src/node_attr_tools.rs:32— crates/op-mcp/src/node_attr_tools.rs:32-40 | crates/op-mcp/src/node_attr_tools.rs:102-110 | crates/op-mcp/src/node_attr_tools.rs:140-148 | crates/op-mcp/src/node_attr_tools.rs:178-188 | crates/op-mcp/src/node_attr_tools.rs:255-263 | crates/op-mcp/src/node_attr_tools.rs:313-323 | crates/op-mcp/src/scalar_vars.rs:48-58 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7–9 lines × 2) crates/op-config-store/src/lib.rs:308— crates/op-config-store/src/lib.rs:308-314 | crates/op-git/src/lib.rs:166-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7–9 lines × 2) crates/op-pen-loader/src/editor_scene.rs:16— crates/op-pen-loader/src/editor_scene.rs:16-24 | crates/op-pen-loader/src/layout_scene.rs:81-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–9 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:252— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:252-260 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:354-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/op-host-services/src/design_md_llm.rs:73— crates/op-host-services/src/design_md_llm.rs:73-80 | crates/op-orchestrator/src/design_system.rs:381-389 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 5) crates/op-editor-core/src/property_edit_mutators.rs:501— crates/op-editor-core/src/property_edit_mutators.rs:501-507 | crates/op-editor-core/src/property_edit_mutators.rs:512-518 | crates/op-editor-core/src/property_edit_mutators.rs:523-529 | crates/op-editor-core/src/property_edit_mutators.rs:534-540 | crates/op-editor-core/src/property_edit_mutators.rs:601-607 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) crates/op-orchestrator/src/chip_repair.rs:31— crates/op-orchestrator/src/chip_repair.rs:31-37 | crates/op-orchestrator/src/radial_repair.rs:782-788 | crates/op-orchestrator/src/ring_repair.rs:358-364 | crates/op-orchestrator/src/sidebar_archetype.rs:467-473 | crates/op-orchestrator/src/stub_repair.rs:217-223 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (5–6 lines × 2) crates/op-figma/src/instance.rs:413— crates/op-figma/src/instance.rs:413-417 | crates/op-figma/src/instance/assignment.rs:28-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5–6 lines × 2) crates/op-orchestrator/src/avatar_repair.rs:194— crates/op-orchestrator/src/avatar_repair.rs:194-198 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:168-173 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (4–6 lines × 4) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:168— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:168-171 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:205-208 | crates/op-orchestrator/src/validation_dump.rs:276-281 | crates/op-orchestrator/src/validation_fixes_apply.rs:568-573 — before extracting anything, compare `crates/op-orchestrator/src/validation_dump.rs` and `crates/op-orchestrator/src/validation_fixes_apply.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–6 lines × 4) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:193— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:193-196 | crates/op-html/src/mapper_node_access.rs:99-102 | crates/op-orchestrator/src/validation_dump.rs:292-297 | crates/op-orchestrator/src/validation_fixes_apply.rs:587-592 — before extracting anything, compare `crates/op-orchestrator/src/validation_dump.rs` and `crates/op-orchestrator/src/validation_fixes_apply.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–5 lines × 3) crates/op-editor-core/src/command_style_replace.rs:434— crates/op-editor-core/src/command_style_replace.rs:434-438 | crates/op-editor-core/src/fills/access.rs:175-179 | crates/op-orchestrator/src/variable_binding.rs:298-301 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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 (4–5 lines × 3) crates/op-editor-ui/src/widgets/ai_chat_mcp_notice.rs:87— crates/op-editor-ui/src/widgets/ai_chat_mcp_notice.rs:87-91 | crates/op-editor-ui/src/widgets/panel_control_metrics.rs:116-119 | crates/op-preview-core/src/mode_transition.rs:186-190 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 5) crates/op-chat-agent/src/chat_canvas_tools.rs:417— crates/op-chat-agent/src/chat_canvas_tools.rs:417-424 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:223-230 | crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:452-459 | crates/op-orchestrator/src/card_inner_padding.rs:312-319 | crates/op-orchestrator/src/touch_target_floor.rs:265-272 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) crates/op-engine-jni/src/bindings_editor.rs:704— crates/op-engine-jni/src/bindings_editor.rs:704-711 | crates/op-engine-jni/src/bindings_editor.rs:755-762 | crates/op-engine-jni/src/bindings_editor.rs:770-777 | crates/op-engine-jni/src/bindings_text.rs:19-26 | crates/op-engine-jni/src/bindings_text.rs:43-50 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13 lines × 3) crates/op-mcp/src/import_html_tool.rs:25— crates/op-mcp/src/import_html_tool.rs:25-37 | crates/op-mcp/src/import_snapshot_tool.rs:26-38 | crates/op-mcp/src/write_tools_import_svg.rs:29-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (13 lines × 3) templates/step0/_generators/tpl_tutorial_photo.py:335— templates/step0/_generators/tpl_tutorial_photo.py:335-347 | templates/step0/_generators/tpl_tutorial_skincare.py:276-288 | templates/step0/_generators/tpl_tutorial_storage.py:286-298 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `templates/step0/_generators/tpl_tutorial_skincare.py:275` calls `stroke` and `templates/step0/_generators/tpl_tutorial_photo.py:334` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:1266— crates/op-host-web/src/op_ck_bridge.js:1266 · crates/op-host-web/src/op_ck_bridge.js:1285 — both copies are in the same file, so extract the 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 (17 lines × 2 locations) packages/op-chrome-extension/design-capture.js:606— packages/op-chrome-extension/design-capture.js:606 · packages/op-chrome-extension/design-evidence.js:233 — the 2 copies are spread across 2 files, 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.
R10 · Code Duplication· Duplicated block with local edits (16 matched lines × 2 locations) · ×2
Duplicated block with local edits (16 matched lines × 2 locations) packages/op-chrome-extension/capture.js:210— packages/op-chrome-extension/capture.js:210 · packages/op-chrome-extension/picker.js:294 — the two spans are one implementation copied and then locally edited — 149 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.
Duplicated block with local edits (16 matched lines × 2 locations) packages/op-chrome-extension/popup.js:187— packages/op-chrome-extension/popup.js:187 · packages/op-chrome-extension/popup.js:214 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both spans, 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.
Duplicated block (13 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380 · crates/op-host-web/src/op_ck_bridge.js:977 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (13 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:761— crates/op-host-web/src/op_ck_bridge.js:761 · crates/op-host-web/src/op_ck_bridge.js:783 — 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 (12 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253 · crates/op-host-web/src/op_ck_bridge.js:1124 — the 2 copies are spread across 2 files, 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 (12 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:1778— crates/op-host-web/src/op_ck_bridge.js:1778 · crates/op-host-web/src/op_ck_bridge.js:1791 — 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.
R10 · Code Duplication· Duplicated block with local edits (12 matched lines × 2 locations) · ×2
Duplicated block with local edits (12 matched lines × 2 locations) packages/op-web-sdk-react/src/design-view.tsx:25— packages/op-web-sdk-react/src/design-view.tsx:25 · packages/op-web-sdk-vue/src/design-view.ts:21 — the two spans are one implementation copied and then locally edited — 67 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.
Duplicated block with local edits (12 matched lines × 2 locations) packages/scripts/sync-version.mjs:258— packages/scripts/sync-version.mjs:258 · packages/scripts/sync-version.mjs:281 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both spans, 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.
Dead file (~6 LoC) packaging/harmony/entry/hvigorfile.ts— no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~6 LoC) packaging/harmony/hvigorfile.ts— no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
op_ck_bridge.opCkInit (cyclomatic 366) crates/op-host-web/src/op_ck_bridge.js:308— op_ck_bridge.opCkInit has cyclomatic complexity 366 (threshold 15). Of this number, 196 points are the body's own statements and 170 belong to 42 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
design-capture.collectDesignEvidenceInPage (cyclomatic 184) packages/op-chrome-extension/design-capture.js:19— design-capture.collectDesignEvidenceInPage has cyclomatic complexity 184 (threshold 15). Of this number, 47 points are the body's own statements and 137 belong to 25 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_ck_bridge.opCkInit (cyclomatic 125) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:28— op_ck_bridge.opCkInit has cyclomatic complexity 125 (threshold 15). Of this number, 49 points are the body's own statements and 76 belong to 22 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_host_web.__wbg_get_imports (cyclomatic 69) crates/op-host-web/pkg-webgl/op_host_web.js:66— op_host_web.__wbg_get_imports has cyclomatic complexity 69 (threshold 15). Most of this is not in the body itself: 1 of the 69 points is its own statement and the rest belongs to 60 function literals inside it that branch (lines 69, 89, 95, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SubprocessProvider::send_inner (cyclomatic 63) crates/op-host-services/src/chat_subprocess.rs:280— SubprocessProvider::send_inner has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_ck_image_cache.createWebImageCaches (cyclomatic 51) crates/op-host-web/src/op_ck_image_cache.js:91— op_ck_image_cache.createWebImageCaches has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 1 of the 51 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 111, 290, 340, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Orchestrator::run (cyclomatic 48) crates/op-orchestrator/src/run_orchestrator.rs:23— Orchestrator::run has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_host_web.__wbg_get_imports (cyclomatic 47) crates/op-host-web/pkg-ck/op_host_web.js:31— op_host_web.__wbg_get_imports has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 40 function literals inside it that branch (lines 49, 55, 783, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
VariablesPanel::hit_test (cyclomatic 46) crates/op-editor-ui/src/widgets/variables_panel/hit.rs:11— VariablesPanel::hit_test has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RuntimeError::safe_diagnostic (cyclomatic 45) crates/op-collab-transport/src/error.rs:305— RuntimeError::safe_diagnostic has cyclomatic complexity 45 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_smoke::main (cyclomatic 43) crates/op-smoke/src/main.rs:214— op_smoke::main has cyclomatic complexity 43 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
deckkit.audit_document (cyclomatic 39) templates/step0/_generators/deckkit.py:240— deckkit.audit_document has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasViewport::paint (cyclomatic 38) crates/op-editor-ui/src/widgets/canvas_viewport.rs:165— CanvasViewport::paint has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
snapshot-extractor.vectorizeSvg (cyclomatic 38) crates/op-html/assets/snapshot-extractor.js:586— snapshot-extractor.vectorizeSvg has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous)::vectorizeSvg (cyclomatic 38) crates/op-html/assets/snapshot-extractor.js:586— (anonymous)::vectorizeSvg has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_preview_core::binding_overlay_apply::apply_value (cyclomatic 37) crates/op-preview-core/src/binding_overlay_apply.rs:12— op_preview_core::binding_overlay_apply::apply_value has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeSurface::hit_test (cyclomatic 34) crates/op-editor-ui/src/widgets/home_surface.rs:209— HomeSurface::hit_test 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.
design-evidence.sanitizeDesignEvidence (cyclomatic 31) packages/op-chrome-extension/design-evidence.js:125— design-evidence.sanitizeDesignEvidence has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 213, 146, 180, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
bridge.parseInboundFromPage (cyclomatic 29) packages/op-vscode/src/protocol/bridge.ts:58— bridge.parseInboundFromPage 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.
WorkspaceSurface::hit_test_layout (cyclomatic 28) crates/op-editor-ui/src/widgets/workspace_surface.rs:385— WorkspaceSurface::hit_test_layout has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_opmerge::merge_core (cyclomatic 26) crates/op-opmerge/src/lib.rs:167— op_opmerge::merge_core 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.
BrowserState::handle_action (cyclomatic 25) crates/op-collab-transport/src/discovery_bonjour_browser.rs:251— BrowserState::handle_action 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.
op_engine_napi::action::printable_char (cyclomatic 25) crates/op-engine-napi/src/action.rs:320— op_engine_napi::action::printable_char has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
freshcheck.audit (cyclomatic 25) templates/step0/_generators/qa/freshcheck.py:148— freshcheck.audit 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.
CollabRuntime::route_guest_output_inner (cyclomatic 24) crates/op-collab-host/src/runtime/effects.rs:348— CollabRuntime::route_guest_output_inner has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SceneTemplatePanel::hit_test (cyclomatic 24) crates/op-editor-ui/src/widgets/scene_template_hit.rs:100— SceneTemplatePanel::hit_test 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.
generateDesignMd (cyclomatic 24) packages/op-chrome-extension/client.js:287— generateDesignMd has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal 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.
op_collab::ticket_json::decode_ticket_string (cyclomatic 23) crates/op-collab/src/ticket_json.rs:127— op_collab::ticket_json::decode_ticket_string 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.
OpSurfaceViewEditorTouch.editorTouch (cyclomatic 23) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewEditorTouch.kt:45— OpSurfaceViewEditorTouch.editorTouch 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.
OpSurfaceViewShellBridge.pollShellAction (cyclomatic 23) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:201— OpSurfaceViewShellBridge.pollShellAction 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.
op_ck_image_cache.jpegFitsThumbnailBounds (cyclomatic 23) crates/op-host-web/src/op_ck_image_cache.js:22— op_ck_image_cache.jpegFitsThumbnailBounds 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.
cjkcheck.main (cyclomatic 22) templates/step0/_generators/qa/cjkcheck.py:65— cjkcheck.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.
picker.startPick (cyclomatic 22) packages/op-chrome-extension/picker.js:46— picker.startPick 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.
verify-rate-rules.verify_rules (cyclomatic 21) deploy/collab-relay-edge/verify-rate-rules.py:53— verify-rate-rules.verify_rules has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
figma_temp_worker.opStartFigmaTempImport (cyclomatic 21) crates/op-host-web/src/figma_temp_worker.js:344— figma_temp_worker.opStartFigmaTempImport has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 365, 388, 352). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
op_collab_relay_client::session::pump (cyclomatic 20) crates/op-collab-relay-client/src/session.rs:191— op_collab_relay_client::session::pump 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.
op_collab_smoke::fault_owner::retry_exactly_once (cyclomatic 20) crates/op-collab-smoke/src/fault_owner.rs:47— op_collab_smoke::fault_owner::retry_exactly_once has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BuiltInProvider::send (cyclomatic 20) crates/op-host-services/src/chat_runtime.rs:94— BuiltInProvider::send 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.
TransportConfig::validate (cyclomatic 19) crates/op-collab-transport/src/config.rs:183— TransportConfig::validate 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.
CollabGatePolicy::check (cyclomatic 19) crates/op-editor-core/src/collab_gate.rs:289— CollabGatePolicy::check has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: EditorCommand::collab_gate_action (cyclomatic 46) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
run_matrix.parse_corpus_yaml (cyclomatic 19) scripts/ab-v9/run_matrix.py:105— run_matrix.parse_corpus_yaml 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.
extract-op-auth-candidate.main (cyclomatic 19) tools/extract-op-auth-candidate.py:43— extract-op-auth-candidate.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.
AnthropicToolCollector::handle (cyclomatic 18) crates/op-ai/src/chat_tool_sse.rs:194— AnthropicToolCollector::handle 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.
op_codegen::codegen_html::emit_node_html (cyclomatic 18) crates/op-codegen/src/codegen_html.rs:40— op_codegen::codegen_html::emit_node_html 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.
ConfiguredBuiltinProvider::send_inner (cyclomatic 18) crates/op-host-services/src/chat_builtin_http.rs:257— ConfiguredBuiltinProvider::send_inner 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.
ClaudeCodeProvider::send_inner (cyclomatic 18) crates/op-host-services/src/chat_claude.rs:116— ClaudeCodeProvider::send_inner has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
OpEngineHost.drainShellActions (cyclomatic 18) packaging/ios/Sources/OpEngineHost.swift:432— OpEngineHost.drainShellActions 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.
codegen-prompt.parseCodegenOutput (cyclomatic 18) packages/op-vscode/src/vscode/codegen-prompt.ts:36— codegen-prompt.parseCodegenOutput has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
capturePage (cyclomatic 18) packages/op-chrome-extension/capture.js:233— capturePage 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.
SheetParser::at_block (cyclomatic 17) crates/op-html/src/css/cascade_parser.rs:256— SheetParser::at_block 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.
BatchGet::call (cyclomatic 17) crates/op-mcp/src/batch_get.rs:38— BatchGet::call has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: op_mcp::batch_get::node_type (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
scene_preview_cards.main (cyclomatic 17) templates/step0/_generators/scene_preview_cards.py:272— scene_preview_cards.main 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.
op_ck_bridge.opCkMakeRuntimeShader (cyclomatic 17) crates/op-host-web/src/op_ck_bridge.js:178— op_ck_bridge.opCkMakeRuntimeShader has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
snapshot-extractor.inlineSegments (cyclomatic 17) crates/op-html/assets/snapshot-extractor.js:968— snapshot-extractor.inlineSegments 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.
i18n.t (cyclomatic 17) packages/op-chrome-extension/i18n.js:242— i18n.t 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.
OpenAiToolCollector::handle (cyclomatic 16) crates/op-ai/src/chat_tool_sse.rs:78— OpenAiToolCollector::handle 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.
ExportItem::call (cyclomatic 16) crates/op-host-services/src/mcp_serve/export_item_tool.rs:21— ExportItem::call has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Parser::parse_compound (cyclomatic 16) crates/op-html/src/css/selectors_parser.rs:145— Parser::parse_compound has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: op_html::css::selectors_parser::parse_simple_pseudo (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_i18n::i18n::plural_category (cyclomatic 16) crates/op-i18n/src/i18n/mod.rs:405— op_i18n::i18n::plural_category has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
snapshot-extractor.shapeToPathData (cyclomatic 16) crates/op-html/assets/snapshot-extractor.js:485— snapshot-extractor.shapeToPathData has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal 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.
(anonymous) (cyclomatic 16) packages/op-chrome-extension/background.js:431— (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 442, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: failureMessage (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
op_ck_bridge.opCkInit (cognitive 469) crates/op-host-web/src/op_ck_bridge.js:308— op_ck_bridge.opCkInit has cognitive complexity 469 (threshold 15). Drivers by points: if/else 186 (258 pts), boolean chains 88, loops 33 (59 pts), ternaries 35 (54 pts), error handling 7 (10 pts) (nesting depth added 120). Of this number, 269 points are the body's own statements and 200 belong to 42 function literals 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.
design-capture.collectDesignEvidenceInPage (cognitive 249) packages/op-chrome-extension/design-capture.js:19— design-capture.collectDesignEvidenceInPage has cognitive complexity 249 (threshold 15). Drivers by points: if/else 76 (143 pts), boolean chains 63, ternaries 13 (22 pts), loops 9 (15 pts), error handling 3 (6 pts) (nesting depth added 85). Of this number, 77 points are the body's own statements and 172 belong to 25 function literals 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.
op_ck_bridge.opCkInit (cognitive 131) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:28— op_ck_bridge.opCkInit has cognitive complexity 131 (threshold 15). Drivers by points: if/else 51 (62 pts), boolean chains 36, ternaries 12 (18 pts), loops 12 (14 pts), error handling 1 (nesting depth added 19). Of this number, 52 points are the body's own statements and 79 belong to 22 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Orchestrator::run (cognitive 113) crates/op-orchestrator/src/run_orchestrator.rs:23— Orchestrator::run has cognitive complexity 113 (threshold 15). Drivers by points: if/else 40 (74 pts), loops 8 (19 pts), match/switch 5 (15 pts), boolean chains 5 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VariablesPanel::hit_test (cognitive 96) crates/op-editor-ui/src/widgets/variables_panel/hit.rs:11— VariablesPanel::hit_test has cognitive complexity 96 (threshold 15). Drivers by points: if/else 37 (84 pts), loops 4 (7 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 52). 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.
SubprocessProvider::send_inner (cognitive 85) crates/op-host-services/src/chat_subprocess.rs:280— SubprocessProvider::send_inner has cognitive complexity 85 (threshold 15). Drivers by points: if/else 25 (49 pts), match/switch 15 (27 pts), boolean chains 7, loops 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasViewport::paint (cognitive 76) crates/op-editor-ui/src/widgets/canvas_viewport.rs:165— CanvasViewport::paint has cognitive complexity 76 (threshold 15). Drivers by points: if/else 35 (63 pts), loops 3 (8 pts), boolean chains 5 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deckkit.audit_document (cognitive 75) templates/step0/_generators/deckkit.py:240— deckkit.audit_document has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (53 pts), boolean chains 12, loops 5 (10 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web.__wbg_get_imports (cognitive 68) crates/op-host-web/pkg-webgl/op_host_web.js:66— op_host_web.__wbg_get_imports has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 49 (50 pts), error handling 18 (nesting depth added 1). Most of this is not in the body itself: 0 of the 68 points are its own statements and the rest belongs to 60 function literals inside it that branch (lines 69, 89, 95, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkspaceSurface::hit_test_layout (cognitive 55) crates/op-editor-ui/src/widgets/workspace_surface.rs:385— WorkspaceSurface::hit_test_layout has cognitive complexity 55 (threshold 15). Drivers by points: if/else 25 (50 pts), loops 2 (5 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
createWebImageCaches (cognitive 55) crates/op-host-web/src/op_ck_image_cache.js:91— createWebImageCaches has cognitive complexity 55 (threshold 15). Drivers by points: if/else 35 (39 pts), boolean chains 9, error handling 5, loops 2 (nesting depth added 4). Most of this is not in the body itself: 0 of the 55 points are its own statements and the rest belongs to 15 function items inside it that branch (installRasterizedSvg, thumbnailImage, drawThumbnailCover, …). 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.
snapshot-extractor.vectorizeSvg (cognitive 49) crates/op-html/assets/snapshot-extractor.js:586— snapshot-extractor.vectorizeSvg has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 10, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
freshcheck.audit (cognitive 47) templates/step0/_generators/qa/freshcheck.py:148— freshcheck.audit has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 5, ternaries 3 (5 pts), loops 3 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeSurface::hit_test (cognitive 46) crates/op-editor-ui/src/widgets/home_surface.rs:209— HomeSurface::hit_test has cognitive complexity 46 (threshold 15). Drivers by points: if/else 25 (35 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web.__wbg_get_imports (cognitive 46) crates/op-host-web/pkg-ck/op_host_web.js:31— op_host_web.__wbg_get_imports has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 30, error handling 16. Most of this is not in the body itself: 0 of the 46 points are its own statements and the rest belongs to 40 function literals inside it that branch (lines 49, 55, 783, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
OpSurfaceViewEditorTouch.editorTouch (cognitive 42) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewEditorTouch.kt:45— OpSurfaceViewEditorTouch.editorTouch has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (38 pts), boolean chains 3, match/switch 1 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OpenAiToolCollector::handle (cognitive 37) crates/op-ai/src/chat_tool_sse.rs:78— OpenAiToolCollector::handle has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 1 (3 pts) (nesting depth added 22). 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.
cjkcheck.main (cognitive 36) templates/step0/_generators/qa/cjkcheck.py:65— cjkcheck.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (8 pts), boolean chains 6, ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
design-evidence.sanitizeDesignEvidence (cognitive 32) packages/op-chrome-extension/design-evidence.js:125— design-evidence.sanitizeDesignEvidence has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 12, ternaries 11 (12 pts), if/else 4 (7 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 213, 146, 180, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
generateDesignMd (cognitive 32) packages/op-chrome-extension/client.js:287— generateDesignMd has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, other 3, ternaries 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 30 points are the body's own statements and 2 belong 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.
BatchGet::call (cognitive 29) crates/op-mcp/src/batch_get.rs:38— BatchGet::call has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 7 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BoundedDocumentReader.read (cognitive 29) packaging/ios/Sources/BoundedDocumentReader.swift:45— BoundedDocumentReader.read has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicToolCollector::handle (cognitive 28) crates/op-ai/src/chat_tool_sse.rs:194— AnthropicToolCollector::handle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_cli::parse_args (cognitive 28) crates/op-cli/src/main.rs:278— op_cli::parse_args has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 9 (13 pts), loops 1 (nesting depth added 14). 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.
ClaudeCodeProvider::send_inner (cognitive 27) crates/op-host-services/src/chat_claude.rs:116— ClaudeCodeProvider::send_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 6 (10 pts), loops 3 (5 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.
op_util::image_dimensions::xml_attribute (cognitive 27) crates/op-util/src/image_dimensions.rs:234— op_util::image_dimensions::xml_attribute has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 4 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
run_matrix.main (cognitive 27) scripts/ab-v9/run_matrix.py:331— run_matrix.main has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 6 (10 pts), error handling 1 (4 pts), boolean chains 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.
extract-op-auth-candidate.main (cognitive 27) tools/extract-op-auth-candidate.py:43— extract-op-auth-candidate.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Toolbar::hit_test (cognitive 26) crates/op-editor-ui/src/widgets/toolbar.rs:241— Toolbar::hit_test has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListUiKits::call (cognitive 26) crates/op-mcp/src/ui_kit_tool.rs:45— ListUiKits::call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 4, loops 2 (3 pts), match/switch 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpEngineHost.drainShellActions (cognitive 26) packaging/ios/Sources/OpEngineHost.swift:432— OpEngineHost.drainShellActions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ck_image_cache.jpegFitsThumbnailBounds (cognitive 26) crates/op-host-web/src/op_ck_image_cache.js:22— op_ck_image_cache.jpegFitsThumbnailBounds has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
capturePage (cognitive 26) packages/op-chrome-extension/capture.js:233— capturePage has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 6 (8 pts), error handling 3 (5 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.
run_matrix.parse_corpus_yaml (cognitive 25) scripts/ab-v9/run_matrix.py:105— run_matrix.parse_corpus_yaml has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, error handling 1 (4 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scene_preview_cards.main (cognitive 25) templates/step0/_generators/scene_preview_cards.py:272— scene_preview_cards.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-sw-imports.stripComments (cognitive 25) packages/op-chrome-extension/scripts/check-sw-imports.mjs:44— check-sw-imports.stripComments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
t (cognitive 25) packages/op-chrome-extension/i18n.js:242— t has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (7 pts), boolean chains 4, 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.
(anonymous) (cognitive 25) packages/op-chrome-extension/background.js:431— (anonymous) has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 6). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 442, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CssVariables::generate (cognitive 24) crates/op-codegen/src/lib.rs:58— CssVariables::generate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 6 (10 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GestureTracker::handle (cognitive 24) crates/op-engine-ffi/src/input.rs:208— GestureTracker::handle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OpSurfaceViewShellBridge.pollShellAction (cognitive 24) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:201— OpSurfaceViewShellBridge.pollShellAction has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bridge.parseInboundFromPage (cognitive 24) packages/op-vscode/src/protocol/bridge.ts:58— bridge.parseInboundFromPage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, error handling 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuiltInProvider::send (cognitive 23) crates/op-host-services/src/chat_runtime.rs:94— BuiltInProvider::send has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (4 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.
LineStreamChild::kill_graceful (cognitive 23) crates/op-process-io/src/lib.rs:202— LineStreamChild::kill_graceful has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (4 pts) (nesting depth added 14). 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.
startPick (cognitive 23) packages/op-chrome-extension/picker.js:46— startPick has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, loops 3, error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 9 function items inside it that branch (elementAt, draw, teardown, …). 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.
ImageSearchSession::poll_into_with_optional_scene (cognitive 22) crates/op-host-desktop/src/image_search_session.rs:393— ImageSearchSession::poll_into_with_optional_scene has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 2, match/switch 1 (2 pts), 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.
ConfiguredBuiltinProvider::send_inner (cognitive 22) crates/op-host-services/src/chat_builtin_http.rs:257— ConfiguredBuiltinProvider::send_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 6 (7 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
oplib.text (cognitive 22) templates/step0/_generators/oplib.py:183— oplib.text has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 7 (9 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
background.chrome.runtime.onMessage.addListener() (cognitive 22) packages/op-chrome-extension/background.js:431— background.chrome.runtime.onMessage.addListener() has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 442). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
sync-version.skipJsoncValue (cognitive 22) packages/scripts/sync-version.mjs:179— sync-version.skipJsoncValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opStartFigmaTempImport (cognitive 22) crates/op-host-web/src/figma_temp_worker.js:344— opStartFigmaTempImport has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 2 (4 pts), error handling 2 (nesting depth added 2). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 9 function items inside it that branch (onmessage, finish, releaseWorker, …). 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.
op_engine_jni::engine_thread::run_loop (cognitive 21) crates/op-engine-jni/src/engine_thread.rs:448— op_engine_jni::engine_thread::run_loop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), match/switch 2 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyState::resolve (cognitive 21) crates/op-mcp/src/codegen_plan_store_dependencies.rs:19— DependencyState::resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AuthCodeFormOverlay.submit (cognitive 21) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:324— AuthCodeFormOverlay.submit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1 (nesting depth added 11). 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.
snapshot-extractor.buildImage (cognitive 21) crates/op-html/assets/snapshot-extractor.js:776— snapshot-extractor.buildImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (2 pts), 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.
snapshot-extractor.inlineSegments (cognitive 21) crates/op-html/assets/snapshot-extractor.js:968— snapshot-extractor.inlineSegments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
snapshot-extractor.buildInlineRun (cognitive 21) crates/op-html/assets/snapshot-extractor.js:1054— snapshot-extractor.buildInlineRun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TruncationScanner::step (cognitive 20) crates/op-chrome-extension-core/src/transfer.rs:254— TruncationScanner::step has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
UndoLedger::record_commit (cognitive 20) crates/op-collab/src/undo_ledger.rs:92— UndoLedger::record_commit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, 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.
Reassembler::push_inner (cognitive 20) crates/op-collab-transport/src/chunk.rs:354— Reassembler::push_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncrementalRecordDecoder::poll (cognitive 20) crates/op-collab-transport/src/driver_io.rs:53— IncrementalRecordDecoder::poll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 2 (5 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.
SecureConnection::receive_transfer_inner (cognitive 20) crates/op-collab-transport/src/runtime.rs:262— SecureConnection::receive_transfer_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MissingFontsPanel::hit_test (cognitive 20) crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:131— MissingFontsPanel::hit_test has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_render_export::scene_painter::ensure_images_decoded (cognitive 20) crates/op-render-export/src/scene_painter.rs:109— op_render_export::scene_painter::ensure_images_decoded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (5 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.
verify-rate-rules.verify_rules (cognitive 20) deploy/collab-relay-edge/verify-rate-rules.py:53— verify-rate-rules.verify_rules has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 2, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
snapshot-extractor.shapeToPathData (cognitive 20) crates/op-html/assets/snapshot-extractor.js:485— snapshot-extractor.shapeToPathData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 5). Of this number, 19 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.
op_acp::transport::read_frame_with_limit (cognitive 19) crates/op-acp/src/transport.rs:26— op_acp::transport::read_frame_with_limit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransportConfig::validate (cognitive 19) crates/op-collab-transport/src/config.rs:183— TransportConfig::validate has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ComponentBrowserPanel::filtered (cognitive 19) crates/op-editor-ui/src/widgets/component_browser_panel.rs:290— ComponentBrowserPanel::filtered 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.
McpLiveServer::pump (cognitive 19) crates/op-host-services/src/mcp_live.rs:239— McpLiveServer::pump has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 1 (2 pts), 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.
run_matrix.aggregate (cognitive 19) scripts/ab-v9/run_matrix.py:297— run_matrix.aggregate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
popup.onDownload (cognitive 19) packages/op-chrome-extension/popup.js:308— popup.onDownload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 1 (3 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignerConfig::validate (cognitive 18) crates/op-collab-relay-locator-hsm/src/config.rs:63— SignerConfig::validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CkInner::repaint (cognitive 18) crates/op-host-web/src/canvaskit/inner.rs:34— CkInner::repaint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SearchAllUniqueProperties::call (cognitive 18) crates/op-mcp/src/style_ops_tools.rs:37— SearchAllUniqueProperties::call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), match/switch 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
digest-op-auth-tree.tree_digest (cognitive 18) tools/digest-op-auth-tree.py:36— digest-op-auth-tree.tree_digest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
export-i18n-catalogs.parse_locale_source (cognitive 18) tools/export-i18n-catalogs.py:183— export-i18n-catalogs.parse_locale_source has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge-settings-i18n.main (cognitive 18) tools/merge-settings-i18n.py:873— merge-settings-i18n.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
snapshot-extractor.buildTextLines (cognitive 18) crates/op-html/assets/snapshot-extractor.js:359— snapshot-extractor.buildTextLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
client.readBoundedDesignResponse (cognitive 18) packages/op-chrome-extension/client.js:180— client.readBoundedDesignResponse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabJwksCache::verification_key_locked (cognitive 17) crates/op-auth-bridge/src/collab_jwks_cache.rs:276— CollabJwksCache::verification_key_locked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
op_builtin_model_discovery::parse_catalog (cognitive 17) crates/op-builtin-model-discovery/src/lib.rs:320— op_builtin_model_discovery::parse_catalog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuestRelayRuntime::start (cognitive 17) crates/op-collab-host/src/runtime/relay/guest_runtime.rs:112— GuestRelayRuntime::start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 3 (5 pts), loops 1 (nesting depth added 3). 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.
CollabGatePolicy::check (cognitive 17) crates/op-editor-core/src/collab_gate.rs:289— CollabGatePolicy::check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MobileDock::paint (cognitive 17) crates/op-editor-ui/src/widgets/mobile_chrome.rs:353— MobileDock::paint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter::emit (cognitive 17) crates/op-host-services/src/export_pptx.rs:212— Emitter::emit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectionDriver::poll_write_once (cognitive 16) crates/op-collab-transport/src/driver.rs:389— ConnectionDriver::poll_write_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileMenu::hit (cognitive 16) crates/op-editor-ui/src/widgets/file_menu.rs:288— FileMenu::hit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session::new (cognitive 16) crates/op-engine-ffi/src/lifecycle.rs:93— Session::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_git::remote::build_callbacks (cognitive 16) crates/op-git/src/remote.rs:456— op_git::remote::build_callbacks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageDecodeHost::pump (cognitive 16) crates/op-host-desktop/src/image_decode_host.rs:122— ImageDecodeHost::pump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BindingOverlay::consume_scroll_requests (cognitive 16) crates/op-preview-core/src/binding_overlay.rs:220— BindingOverlay::consume_scroll_requests has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), 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.
OpSurfaceView.surfaceCreated (cognitive 16) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt:234— OpSurfaceView.surfaceCreated has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-collab-bootstrap-urls.canonical_host (cognitive 16) tools/check-collab-bootstrap-urls.py:35— check-collab-bootstrap-urls.canonical_host has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
op_ck_bridge.opCkParseFontFamilyStack (cognitive 16) crates/op-host-web/src/op_ck_bridge.js:74— op_ck_bridge.opCkParseFontFamilyStack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_ck_bridge.opCkMakeRuntimeShader (cognitive 16) crates/op-host-web/src/op_ck_bridge.js:178— op_ck_bridge.opCkMakeRuntimeShader has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 3, if/else 2 (3 pts), loops 2 (3 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.
codegen-prompt.parseCodegenOutput (cognitive 16) packages/op-vscode/src/vscode/codegen-prompt.ts:36— codegen-prompt.parseCodegenOutput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 1, ternaries 1. Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 53). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D22 · Internal API Consistency· Redundant creation methods with unclear distinction. `new_session` likely creates a session with default options, while `new_session_with` takes explicit options. However, the naming convention is inconsistent with standard patterns like `create` vs `create_with` or `new` vs `new_from_options`. More critically, `NewSessionOptions` is a struct, suggesting `new_session` should just accept optional parameters or a builder pattern, rather than having two distinct entry points that do the same core action. · ×1
Redundant creation methods with unclear distinction. `new_session` likely creates a session with default options, while `new_session_with` takes explicit options. However, the naming convention is inconsistent with standard patterns like `create` vs `create_with` or `new` vs `new_from_options`. More critically, `NewSessionOptions` is a struct, suggesting `new_session` should just accept optional parameters or a builder pattern, rather than having two distinct entry points that do the same core action. — Unify into a single method `new_session(options: Option<NewSessionOptions>)` or use a builder pattern. If defaults are complex, keep `new_session` but rename `new_session_with` to `new_session_with_options` for clarity, or better yet, deprecate `new_session` in favor of `new_session_with(None)`. (signatures: op_acp.client.AcpConnection.new_session(): Result | op_acp.client.AcpConnection.new_session_with(options: NewSessionOptions): Result)
D22 · Internal API Consistency· Ambiguous semantic overlap between 'close' and 'delete'. In many session-based APIs, 'close' terminates the active session but may keep state, while 'delete' removes it entirely. However, the naming `close_session_if_supported` and `delete_session_if_supported` suggests these are capability-gated operations. If the underlying protocol treats them as distinct lifecycle stages, the names are okay, but if they are often used interchangeably or one implies the other, this is confusing. Given the presence of `supports_session_close` and `supports_session_delete`, they are likely distinct, but the API surface feels cluttered with capability checks that could be handled internally or via a single `terminate_session` method. · ×1
Ambiguous semantic overlap between 'close' and 'delete'. In many session-based APIs, 'close' terminates the active session but may keep state, while 'delete' removes it entirely. However, the naming `close_session_if_supported` and `delete_session_if_supported` suggests these are capability-gated operations. If the underlying protocol treats them as distinct lifecycle stages, the names are okay, but if they are often used interchangeably or one implies the other, this is confusing. Given the presence of `supports_session_close` and `supports_session_delete`, they are likely distinct, but the API surface feels cluttered with capability checks that could be handled internally or via a single `terminate_session` method. — If 'close' and 'delete' are semantically distinct in the protocol, keep them but consider if a higher-level `terminate_session` method that handles both cases based on availability would be cleaner. If they are truly distinct, the current naming is acceptable but verbose. (signatures: op_acp.client.AcpConnection.close_session_if_supported(session_id: str): Result | op_acp.client.AcpConnection.delete_session_if_supported(session_id: str): Result)
D22 · Internal API Consistency· Redundant send methods. `send_cancellable` is a specialized version of `send`. The existence of `supports_cancellable_send` suggests that `send` might not be cancellable, but the API user has to know which method to call. This splits the intent of 'sending a request' across two methods based on a capability flag, which is a common anti-pattern. · ×1
Redundant send methods. `send_cancellable` is a specialized version of `send`. The existence of `supports_cancellable_send` suggests that `send` might not be cancellable, but the API user has to know which method to call. This splits the intent of 'sending a request' across two methods based on a capability flag, which is a common anti-pattern. — Unify into a single `send` method that accepts an optional cancellation token or handles cancellation internally if supported. Alternatively, use a builder pattern for the request that includes cancellation options. (signatures: op_ai.chat_provider.ChatProvider.send(request: ChatRequest): Box | op_ai.chat_provider.ChatProvider.send_cancellable(request: ChatRequest, _cancel: AtomicBool): Box)
D22 · Internal API Consistency· Duplicate intent across different types. Both `OpenAiToolCollector` and `AnthropicToolCollector` have a `handle` method that takes a string and returns a `ChatDelta`. This suggests a common trait or interface should be defined for tool collectors to abstract away the provider-specific parsing logic. · ×1
Duplicate intent across different types. Both `OpenAiToolCollector` and `AnthropicToolCollector` have a `handle` method that takes a string and returns a `ChatDelta`. This suggests a common trait or interface should be defined for tool collectors to abstract away the provider-specific parsing logic. — Define a common trait `ToolCollector` with a `handle` method and implement it for both OpenAI and Anthropic collectors. This allows generic code to process tool calls without knowing the specific provider. (signatures: op_ai.chat_tool_sse.OpenAiToolCollector.handle(data: str): ChatDelta | op_ai.chat_tool_sse.AnthropicToolCollector.handle(data: str): ChatDelta)
D22 · Internal API Consistency· Inconsistent return types and naming for CRUD operations. `user_style_guides` returns a single `UserStyleGuide` (likely the last one or a default?), `set_user_style_guides` takes a single `UserStyleGuide` but the name implies plural, `remove_user_style_guide` returns a `UserStyleGuide` (the removed one?), and `load_user_style_guide` also returns a `UserStyleGuide`. The naming is inconsistent (`guides` vs `guide`) and the return types are unclear (is it the updated state, the removed item, or a success indicator?). · ×1
Inconsistent return types and naming for CRUD operations. `user_style_guides` returns a single `UserStyleGuide` (likely the last one or a default?), `set_user_style_guides` takes a single `UserStyleGuide` but the name implies plural, `remove_user_style_guide` returns a `UserStyleGuide` (the removed one?), and `load_user_style_guide` also returns a `UserStyleGuide`. The naming is inconsistent (`guides` vs `guide`) and the return types are unclear (is it the updated state, the removed item, or a success indicator?). — Standardize naming to singular/plural consistently based on the data structure (e.g., `get_style_guides` returning a list). Clarify return types: use `Option<UserStyleGuide>` for removal/load to indicate success/failure, or return a unit type `()` for mutations if the state is managed internally. (signatures: op_ai_skills.style_guide.user_registry.user_style_guides(): UserStyleGuide | op_ai_skills.style_guide.user_registry.set_user_style_guides(guides: UserStyleGuide) | op_ai_skills.style_guide.user_registry.remove_user_style_guide(id: str): UserStyleGuide | op_ai_skills.style_guide.user_registry.load_user_style_guide(guide: UserStyleGuide): UserStyleGuide)
D4 · Code Duplication· Near-duplicate member family (4 members, 13 shared lines) · ×1
Near-duplicate member family (4 members, 13 shared lines) crates/op-codegen/src/lib.rs:252— crates/op-codegen/src/lib.rs:252-274 | crates/op-design-lint/src/node_util.rs:413-435 | crates/op-editor-core/src/fills/access.rs:12-34 | crates/op-mcp/src/style_ops_tools.rs:432-454 — These 4 members are variants of one another: a block of 13 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member pair (144 shared lines) crates/op-chat-agent/src/chat_agent_loop/openai.rs:40— crates/op-chat-agent/src/chat_agent_loop/openai.rs:40-363 | crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:83-401 — These two members are variants of one another: 144 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (72 shared lines) packaging/ios/Sources/AuthCodeFormViewController.swift:68— packaging/ios/Sources/AuthCodeFormViewController.swift:68-267 | packaging/ios/Sources/NativeLoginViewController.swift:102-327 — These two members are variants of one another: 72 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (66 shared lines) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:73— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:73-244 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:164-351 — These two members are variants of one another: 66 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (64 shared lines) crates/op-collab-host/src/runtime/network/connection.rs:48— crates/op-collab-host/src/runtime/network/connection.rs:48-186 | crates/op-collab-host/src/runtime/network/connection.rs:195-353 — These two members are variants of one another: 64 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (49 shared lines) crates/op-collab-relay-locator-server/src/http.rs:400— crates/op-collab-relay-locator-server/src/http.rs:400-458 | crates/op-collab-relay-locator-server/src/http.rs:466-528 — These two members are variants of one another: 49 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (47 shared lines) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:243— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:243-361 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:218-311 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (44 shared lines) crates/op-host-services/src/web_canvas_server/run_loop.rs:28— crates/op-host-services/src/web_canvas_server/run_loop.rs:28-197 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:128-297 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crates/op-editor-core/src/svg_import/path_data.rs:12— crates/op-editor-core/src/svg_import/path_data.rs:12-192 | crates/op-editor-core/src/svg_path_data.rs:55-168 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) crates/op-codegen/src/codegen_html.rs:40— crates/op-codegen/src/codegen_html.rs:40-134 | crates/op-codegen/src/codegen_targets.rs:294-381 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (34 shared lines) crates/op-html/src/project_zip.rs:190— crates/op-html/src/project_zip.rs:190-284 | crates/op-html/src/project_zip_range.rs:163-326 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (31 shared lines) crates/op-editor-core/src/instance_override.rs:91— crates/op-editor-core/src/instance_override.rs:91-154 | crates/op-editor-core/src/ref_resolve.rs:225-321 — These two members are variants of one another: 31 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (30 shared lines) crates/op-orchestrator/src/finalize_enforce_status_bar.rs:143— crates/op-orchestrator/src/finalize_enforce_status_bar.rs:143-191 | crates/op-orchestrator/src/finalize_enforce_status_bar.rs:194-256 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (15 shared lines) crates/op-editor-core/src/fills/access.rs:89— crates/op-editor-core/src/fills/access.rs:89-111 | crates/op-mcp/src/style_ops_tools.rs:456-478 — These two members are variants of one another: 15 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) crates/op-editor-ui/src/widgets/drag_flow.rs:444— crates/op-editor-ui/src/widgets/drag_flow.rs:444-494 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:343-384 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) crates/op-editor-core/src/svg_import/path_data.rs:270— crates/op-editor-core/src/svg_import/path_data.rs:270-309 | crates/op-editor-core/src/svg_path_data.rs:416-455 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) crates/op-html/src/css/declaration_syntax.rs:169— crates/op-html/src/css/declaration_syntax.rs:169-213 | crates/op-html/src/css/declaration_syntax.rs:287-325 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) crates/op-editor-core/src/svg_import/lexer.rs:10— crates/op-editor-core/src/svg_import/lexer.rs:10-47 | crates/op-editor-core/src/svg_import/xml.rs:95-166 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) crates/op-pen-loader/src/style_payload.rs:467— crates/op-pen-loader/src/style_payload.rs:467-507 | crates/op-preview-core/src/session_paint.rs:533-566 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) crates/op-orchestrator/src/orchestration_self_check.rs:349— crates/op-orchestrator/src/orchestration_self_check.rs:349-361 | crates/op-orchestrator/src/role_post_pass/mobile_cards.rs:95-107 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) crates/op-orchestrator/src/loop_finalize.rs:180— crates/op-orchestrator/src/loop_finalize.rs:180-189 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:12-23 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/op-host-desktop/src/git_jobs.rs:94— crates/op-host-desktop/src/git_jobs.rs:94-107 | crates/op-host-desktop/src/git_jobs.rs:206-221 | crates/op-host-desktop/src/git_jobs.rs:244-263 | crates/op-host-desktop/src/git_jobs.rs:288-301 | crates/op-host-desktop/src/git_jobs.rs:344-357 | crates/op-host-desktop/src/iconify_host.rs:66-79 | crates/op-host-desktop/src/update_check.rs:102-115 | crates/op-host-services/src/acp_agent_probe_host.rs:106-121 | crates/op-host-services/src/provider_probe_host.rs:68-81 — These 9 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 9 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 9 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) templates/step0/_generators/tpl_infographic_challenge.py:247— templates/step0/_generators/tpl_infographic_challenge.py:247-265 | templates/step0/_generators/tpl_infographic_concept.py:299-317 | templates/step0/_generators/tpl_infographic_data.py:290-305 | templates/step0/_generators/tpl_infographic_faq.py:237-251 | templates/step0/_generators/tpl_infographic_map.py:246-264 | templates/step0/_generators/tpl_infographic_ranking.py:273-287 | templates/step0/_generators/tpl_infographic_steps.py:221-233 | templates/step0/_generators/tpl_infographic_timeline.py:268-286 — These 8 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 8 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 8 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/op-orchestrator/src/category_grid_reflow.rs:119— crates/op-orchestrator/src/category_grid_reflow.rs:119-179 | crates/op-orchestrator/src/geometry_bottom_gap.rs:79-108 | crates/op-orchestrator/src/geometry_validation.rs:220-243 | crates/op-orchestrator/src/geometry_validation.rs:385-408 | crates/op-orchestrator/src/radial_repair.rs:431-451 | crates/op-orchestrator/src/sidebar_archetype.rs:17-34 | crates/op-orchestrator/src/stub_repair.rs:9-32 — These 7 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 7 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 7 times.
Duplicated block (61–74 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:100— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:100-173 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:63-123 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (57 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint.rs:244— crates/op-editor-ui/src/widgets/home_surface_paint.rs:244-300 | crates/op-editor-ui/src/widgets/workspace_surface_paint.rs:274-330 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (45 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:636— crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:636-680 | crates/op-editor-ui/src/widgets/home_surface_paint_sections.rs:204-248 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (41 lines × 2) crates/op-editor-host-core/src/settings_io.rs:375— crates/op-editor-host-core/src/settings_io.rs:375-415 | crates/op-host-web/src/web_settings.rs:444-484 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (39–41 lines × 2) crates/op-mcp/src/write_tools.rs:67— crates/op-mcp/src/write_tools.rs:67-105 | crates/op-mcp/src/write_tools.rs:541-581 — both copies are in the same file, so extract the 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 (39 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:157— crates/op-host-native/src/widget_host/preview_slideshow.rs:157-195 | crates/op-host-web/src/widget_host/preview_slideshow.rs:308-346 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 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 (35–36 lines × 3) crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:178— crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:178-212 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:301-336 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:367-401 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (34–36 lines × 2) crates/op-host-services/src/doc_io/clean_copy.rs:21— crates/op-host-services/src/doc_io/clean_copy.rs:21-56 | crates/op-host-services/src/doc_io/clean_copy.rs:82-115 — both copies are in the same file, so extract the 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 (35 lines × 2) crates/op-editor-ui/src/theme.rs:106— crates/op-editor-ui/src/theme.rs:106-140 | crates/op-editor-ui/src/theme.rs:146-180 — both copies are in the same file, so extract the 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 (33–35 lines × 2) crates/op-host-native/src/widget_host/input.rs:249— crates/op-host-native/src/widget_host/input.rs:249-283 | crates/op-host-web/src/widget_host/node_drag.rs:145-177 — 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 (31–33 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:138— crates/op-host-native/src/widget_host/variables_preset_press.rs:138-170 | crates/op-host-web/src/widget_host/variables_preset_press.rs:88-118 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 (4–32 lines × 4) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:272— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:272-303 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:370-401 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:498-529 | crates/op-editor-ui/src/widgets/property_panel_layer.rs:237-240 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (32 lines × 2) crates/op-editor-ui/src/widgets/drag_flow.rs:456— crates/op-editor-ui/src/widgets/drag_flow.rs:456-487 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:346-377 — before extracting anything, compare `crates/op-editor-ui/src/widgets/drag_flow.rs` and `crates/op-editor-ui/src/widgets/drag_flow_index.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30 lines × 2) crates/op-mcp/src/parser.rs:238— crates/op-mcp/src/parser.rs:238-267 | crates/op-mcp/src/parser.rs:273-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.
Duplicated block (29–30 lines × 2) crates/op-orchestrator/src/plan.rs:499— crates/op-orchestrator/src/plan.rs:499-528 | crates/op-orchestrator/src/plan_fallback_card.rs:24-52 — before extracting anything, compare `crates/op-orchestrator/src/plan.rs` and `crates/op-orchestrator/src/plan_fallback_card.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 3) crates/op-collab-relay-locator-server/src/http.rs:333— crates/op-collab-relay-locator-server/src/http.rs:333-361 | crates/op-collab-relay-locator-server/src/http.rs:408-436 | crates/op-collab-relay-locator-server/src/http.rs:473-501 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (24–29 lines × 2) crates/op-engine-ffi/src/editor_chat_design.rs:100— crates/op-engine-ffi/src/editor_chat_design.rs:100-123 | crates/op-host-desktop/src/chat_session_launch.rs:687-715 — 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 (29 lines × 2) crates/op-image-enrich/src/apply.rs:72— crates/op-image-enrich/src/apply.rs:72-100 | crates/op-image-enrich/src/apply.rs:102-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–28 lines × 2) crates/op-image-enrich/src/net/downscale.rs:194— crates/op-image-enrich/src/net/downscale.rs:194-213 | crates/op-image-enrich/src/net/downscale.rs:243-270 — both copies are in the same file, so extract the 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 (27 lines × 3) crates/op-editor-ui/src/widgets/property_panel_fill.rs:531— crates/op-editor-ui/src/widgets/property_panel_fill.rs:531-557 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:203-229 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:392-418 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22–27 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:372— crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:372-393 | crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:477-503 — both copies are in the same file, so extract the 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 (27 lines × 2) crates/op-host-desktop/src/app_handler/scheduling.rs:108— crates/op-host-desktop/src/app_handler/scheduling.rs:108-134 | crates/op-host-desktop/src/app_handler/scheduling.rs:184-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:354— crates/op-auth-bridge/src/collab_claims.rs:354-379 | crates/op-auth-bridge/src/collab_relay_token.rs:168-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (25–26 lines × 2) crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:18— crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:18-42 | crates/op-editor-ui/src/widgets/property_panel_image_node.rs:156-181 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21–25 lines × 2) crates/op-editor-ui/src/widgets/property_panel_text.rs:168— crates/op-editor-ui/src/widgets/property_panel_text.rs:168-188 | crates/op-editor-ui/src/widgets/property_panel_text.rs:190-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–25 lines × 2) crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:97— crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:97-121 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:505-524 — both copies are in the same file, so extract the 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 (22–23 lines × 3) crates/op-editor-core/src/svg_import/lexer.rs:149— crates/op-editor-core/src/svg_import/lexer.rs:149-171 | crates/op-editor-core/src/svg_import/path_data.rs:280-301 | crates/op-editor-core/src/svg_path_data.rs:426-447 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 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 (23 lines × 3) crates/op-editor-core/src/path_bounds.rs:81— crates/op-editor-core/src/path_bounds.rs:81-103 | crates/op-editor-core/src/svg_path_bounds.rs:83-105 | crates/op-editor-core/src/svg_path_data.rs:307-329 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (20–23 lines × 2) crates/op-editor-ui/src/widgets/property_panel_typography.rs:142— crates/op-editor-ui/src/widgets/property_panel_typography.rs:142-161 | crates/op-figma/src/clipboard.rs:472-494 — 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 (19–23 lines × 2) crates/op-host-web/src/web_settings_storage.rs:99— crates/op-host-web/src/web_settings_storage.rs:99-117 | crates/op-host-web/src/web_settings_storage.rs:137-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 3) crates/op-html/src/css/declaration_syntax.rs:178— crates/op-html/src/css/declaration_syntax.rs:178-198 | crates/op-html/src/css/declaration_syntax.rs:294-314 | crates/op-html/src/css/declaration_syntax.rs:353-373 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18–21 lines × 2) crates/op-host-desktop/src/design_session_workers.rs:238— crates/op-host-desktop/src/design_session_workers.rs:238-258 | crates/op-host-desktop/src/design_session_workers.rs:271-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:178— crates/op-host-native/src/widget_host/variables_preset_press.rs:178-198 | crates/op-host-web/src/widget_host/variables_preset_press.rs:120-139 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 (16–20 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:257— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:257-276 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:206-221 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 3) crates/op-orchestrator/src/validation_fixes_apply.rs:666— crates/op-orchestrator/src/validation_fixes_apply.rs:666-684 | crates/op-orchestrator/src/validation_fixes_apply.rs:686-704 | crates/op-orchestrator/src/validation_fixes_apply.rs:706-724 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–19 lines × 3) crates/op-editor-core/src/color_picker_snapshot.rs:116— crates/op-editor-core/src/color_picker_snapshot.rs:116-125 | crates/op-editor-core/src/scene_vars.rs:74-79 | crates/op-editor-core/src/variables.rs:60-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (15–19 lines × 2) crates/op-engine-ffi/src/editor_chat.rs:377— crates/op-engine-ffi/src/editor_chat.rs:377-391 | crates/op-host-desktop/src/chat_session.rs:302-320 — before extracting anything, compare `crates/op-engine-ffi/src/editor_chat.rs` and `crates/op-host-desktop/src/chat_session.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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–19 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:143— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:143-161 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:35-51 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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–18 lines × 2) crates/op-editor-ui/src/widgets/property_panel_sections.rs:469— crates/op-editor-ui/src/widgets/property_panel_sections.rs:469-483 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:606-623 — both copies are in the same file, so extract the 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–18 lines × 2) crates/op-smoke/src/loop_seed.rs:73— crates/op-smoke/src/loop_seed.rs:73-90 | crates/op-smoke/src/loop_seed.rs:164-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 4) crates/op-editor-ui/src/widgets/property_panel_fill.rs:513— crates/op-editor-ui/src/widgets/property_panel_fill.rs:513-529 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:179-194 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:302-317 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:368-383 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 4) crates/op-html/src/css/selectors_parser.rs:557— crates/op-html/src/css/selectors_parser.rs:557-573 | crates/op-html/src/css/selectors_parser.rs:600-616 | crates/op-html/src/mapper_grid.rs:572-588 | crates/op-html/src/mapper_visual_syntax.rs:52-68 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (16 lines × 5) crates/op-html/src/css/selectors_parser.rs:412— crates/op-html/src/css/selectors_parser.rs:412-427 | crates/op-html/src/css/selectors_parser.rs:560-575 | crates/op-html/src/css/selectors_parser.rs:603-618 | crates/op-html/src/mapper_visual_syntax.rs:19-34 | crates/op-html/src/mapper_visual_syntax.rs:55-70 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (15–16 lines × 4) crates/op-editor-ui/src/widgets/property_panel_fill.rs:542— crates/op-editor-ui/src/widgets/property_panel_fill.rs:542-556 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:214-228 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:338-353 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:403-417 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 4) crates/op-host-services/src/chat_builtin_http.rs:293— crates/op-host-services/src/chat_builtin_http.rs:293-308 | crates/op-host-services/src/chat_http_server.rs:146-161 | crates/op-host-services/src/chat_runtime.rs:110-125 | crates/op-host-services/src/chat_subprocess.rs:306-321 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (14–16 lines × 2) crates/op-editor-core/src/ref_resolve.rs:226— crates/op-editor-core/src/ref_resolve.rs:226-241 | crates/op-editor-core/src/ref_resolve.rs:380-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 5) crates/op-editor-ui/src/widgets/property_panel_fill.rs:542— crates/op-editor-ui/src/widgets/property_panel_fill.rs:542-556 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:110-124 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:214-228 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:339-353 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:403-417 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 7) crates/op-host-services/src/chat_system_prompt.rs:204— crates/op-host-services/src/chat_system_prompt.rs:204-217 | crates/op-mcp/src/batch_get.rs:444-457 | crates/op-mcp/src/open_document.rs:171-184 | crates/op-mcp/src/tools.rs:44-57 | crates/op-orchestrator/src/validation_dump.rs:251-264 | crates/op-orchestrator/src/validation_fixes_apply.rs:649-661 | crates/op-orchestrator/src/validation_fixes_b3.rs:499-512 — before extracting anything, compare `crates/op-host-services/src/chat_system_prompt.rs` and `crates/op-mcp/src/batch_get.rs` 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 (13–14 lines × 6) crates/op-engine-jni/src/bindings_editor.rs:76— crates/op-engine-jni/src/bindings_editor.rs:76-89 | crates/op-engine-jni/src/bindings_editor.rs:119-131 | crates/op-engine-jni/src/bindings_editor.rs:159-172 | crates/op-engine-jni/src/bindings_editor.rs:204-217 | crates/op-engine-jni/src/bindings_editor.rs:370-382 | crates/op-engine-jni/src/bindings_editor.rs:427-439 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 5) crates/op-host-desktop/src/git_jobs.rs:95— crates/op-host-desktop/src/git_jobs.rs:95-107 | crates/op-host-desktop/src/git_jobs.rs:289-301 | crates/op-host-desktop/src/git_jobs.rs:345-357 | crates/op-host-desktop/src/iconify_host.rs:67-79 | crates/op-host-services/src/provider_probe_host.rs:69-81 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11–13 lines × 2) crates/op-design-lint/src/detectors/siblings.rs:79— crates/op-design-lint/src/detectors/siblings.rs:79-91 | crates/op-design-lint/src/detectors/siblings.rs:419-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 3) crates/op-html/src/mapper_box.rs:146— crates/op-html/src/mapper_box.rs:146-157 | crates/op-html/src/mapper_margin.rs:357-367 | crates/op-html/src/mapper_margin.rs:666-677 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6–11 lines × 3) crates/op-editor-core/src/instance_override.rs:130— crates/op-editor-core/src/instance_override.rs:130-136 | crates/op-editor-core/src/ref_resolve.rs:257-267 | crates/op-editor-core/src/ref_resolve.rs:405-410 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–11 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:191— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:191-197 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:143-153 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/op-ai-skills/src/style_guide/token_table.rs:496— crates/op-ai-skills/src/style_guide/token_table.rs:496-505 | crates/op-orchestrator/src/design_type.rs:162-171 | crates/op-orchestrator/src/plan.rs:501-510 | crates/op-orchestrator/src/plan_fallback_card.rs:26-35 — before extracting anything, compare `crates/op-orchestrator/src/plan.rs` and `crates/op-orchestrator/src/plan_fallback_card.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 4) crates/op-collab-smoke/src/fault_guest.rs:82— crates/op-collab-smoke/src/fault_guest.rs:82-91 | crates/op-collab-smoke/src/fault_guest.rs:157-166 | crates/op-collab-smoke/src/fault_guest.rs:395-404 | crates/op-collab-smoke/src/fault_guest.rs:460-468 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 3) crates/op-editor-core/src/instance_override.rs:121— crates/op-editor-core/src/instance_override.rs:121-129 | crates/op-editor-core/src/ref_resolve.rs:246-255 | crates/op-editor-core/src/ref_resolve.rs:395-404 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 3) crates/op-host-native/src/backend/skia.rs:390— crates/op-host-native/src/backend/skia.rs:390-397 | crates/op-host-native/src/backend/skia.rs:537-546 | crates/op-host-native/src/backend/skia.rs:566-573 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 10) crates/op-collab/src/diff_index.rs:122— crates/op-collab/src/diff_index.rs:122-130 | crates/op-editor-core/src/command_refine.rs:181-189 | crates/op-editor-core/src/export_name.rs:163-171 | crates/op-host-services/src/chat_system_prompt.rs:195-203 | crates/op-mcp/src/batch_get.rs:435-443 | crates/op-mcp/src/open_document.rs:162-170 | crates/op-orchestrator/src/validation_dump.rs:242-250 | crates/op-orchestrator/src/validation_fixes_apply.rs:641-648 | crates/op-orchestrator/src/validation_fixes_b3.rs:490-498 | crates/op-smoke/src/audit_rubric.rs:245-253 — before extracting anything, compare `crates/op-collab/src/diff_index.rs` and `crates/op-editor-core/src/command_refine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 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–9 lines × 4) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262-270 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:323-330 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:225-233 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:277-285 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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–8 lines × 4) crates/op-editor-core/src/image_crop.rs:225— crates/op-editor-core/src/image_crop.rs:225-232 | crates/op-editor-core/src/property_edit_mutators.rs:667-673 | crates/op-editor-core/src/property_edit_mutators.rs:703-709 | crates/op-editor-core/src/property_edit_mutators.rs:722-728 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 9) crates/op-mcp/src/import_common.rs:68— crates/op-mcp/src/import_common.rs:68-74 | crates/op-mcp/src/write_tools.rs:112-118 | crates/op-mcp/src/write_tools.rs:181-187 | crates/op-mcp/src/write_tools.rs:219-225 | crates/op-mcp/src/write_tools.rs:267-273 | crates/op-mcp/src/write_tools.rs:462-468 | crates/op-mcp/src/write_tools.rs:516-522 | crates/op-mcp/src/write_tools.rs:586-592 | crates/op-mcp/src/write_tools_import_svg.rs:64-70 — there are 9 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) crates/op-editor-core/src/host_image_panel_transitions.rs:257— crates/op-editor-core/src/host_image_panel_transitions.rs:257-263 | crates/op-editor-core/src/host_image_panel_transitions.rs:279-285 | crates/op-editor-core/src/host_image_panel_transitions.rs:304-310 | crates/op-editor-core/src/host_image_panel_transitions.rs:323-329 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–7 lines × 2) crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:210— crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:210-215 | crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:262-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–7 lines × 3) crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:219— crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:219-225 | crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:283-289 | crates/op-orchestrator/src/ring_repair.rs:259-261 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5–7 lines × 2) crates/op-pen-loader/src/lib.rs:152— crates/op-pen-loader/src/lib.rs:152-158 | crates/op-pen-loader/src/variables.rs:211-215 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 7) crates/op-mcp/src/reparent_tools.rs:78— crates/op-mcp/src/reparent_tools.rs:78-82 | crates/op-mcp/src/write_tools.rs:116-120 | crates/op-mcp/src/write_tools.rs:223-227 | crates/op-mcp/src/write_tools.rs:466-470 | crates/op-mcp/src/write_tools.rs:520-524 | crates/op-mcp/src/write_tools.rs:590-594 | crates/op-mcp/src/write_tools_import_svg.rs:68-72 — there are 7 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 6) crates/op-editor-core/src/svg_import/path_data.rs:124— crates/op-editor-core/src/svg_import/path_data.rs:124-128 | crates/op-editor-core/src/svg_import/path_data.rs:148-152 | crates/op-editor-core/src/svg_path_data.rs:126-130 | crates/op-editor-core/src/svg_path_data.rs:134-138 | crates/op-editor-core/src/svg_path_data.rs:141-145 | crates/op-editor-core/src/svg_path_data.rs:146-151 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 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 (3–5 lines × 3) crates/op-editor-core/src/command_node_attrs/slots.rs:129— crates/op-editor-core/src/command_node_attrs/slots.rs:129-133 | crates/op-editor-core/src/fills/access.rs:82-86 | crates/op-orchestrator/src/variable_binding.rs:323-325 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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 (24 lines × 3) crates/op-editor-core/src/fills/access.rs:183— crates/op-editor-core/src/fills/access.rs:183-206 | crates/op-html/src/mapper_node_access.rs:62-85 | crates/op-orchestrator/src/variable_binding.rs:332-355 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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) crates/op-editor-core/src/hoist_app_state.rs:21— crates/op-editor-core/src/hoist_app_state.rs:21-45 | crates/op-preview-core/src/binding_sites.rs:27-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 14) crates/op-chat-agent/src/design_agent_diagnostics.rs:449— crates/op-chat-agent/src/design_agent_diagnostics.rs:449-456 | crates/op-editor-core/src/uikit_io.rs:309-316 | crates/op-mcp/src/batch_program_exec_ops.rs:425-432 | crates/op-mcp/src/style_ops_tools.rs:480-487 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:176-183 | crates/op-orchestrator/src/cleanup_equalize_siblings.rs:498-505 | crates/op-orchestrator/src/cleanup_layout.rs:81-88 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:249-256 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:222-229 | crates/op-orchestrator/src/cleanup_section_margins.rs:272-279 | crates/op-orchestrator/src/cleanup_slide_padding.rs:412-419 | crates/op-orchestrator/src/mobile_content_rail_detect.rs:271-278 | crates/op-orchestrator/src/mobile_reflow.rs:328-335 | crates/op-pen-loader/src/layout_repair.rs:742-749 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 10) crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:484— crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:484-493 | crates/op-editor-ui/src/widgets/agent_settings_form_actions.rs:164-173 | crates/op-editor-ui/src/widgets/ai_chat_panel_controls.rs:128-137 | crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:565-574 | crates/op-editor-ui/src/widgets/ai_chat_transcript_tools.rs:529-538 | crates/op-editor-ui/src/widgets/component_browser_panel.rs:723-732 | crates/op-editor-ui/src/widgets/property_panel_code_generating.rs:300-309 | crates/op-editor-ui/src/widgets/property_panel_image_fill.rs:641-650 | crates/op-editor-ui/src/widgets/settings_form.rs:24-33 | crates/op-editor-ui/src/widgets/variables_preset_menu.rs:399-408 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 10 call sites, so a change lands once.
Duplicated block (6 lines × 4) crates/op-editor-ui/src/widgets/drag_flow.rs:496— crates/op-editor-ui/src/widgets/drag_flow.rs:496-501 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:386-391 | crates/op-editor-ui/src/widgets/slides_panel.rs:688-693 | crates/op-editor-ui/src/widgets/slideshow_toolbar.rs:221-226 — before extracting anything, compare `crates/op-editor-ui/src/widgets/drag_flow.rs` and `crates/op-editor-ui/src/widgets/drag_flow_index.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 5) crates/op-collab-relay-protocol/src/locator.rs:99— crates/op-collab-relay-protocol/src/locator.rs:99-104 | crates/op-collab-relay-protocol/src/sensitive.rs:14-19 | crates/op-collab-relay-protocol/src/sensitive.rs:43-48 | crates/op-collab-relay-protocol/src/sensitive.rs:84-89 | crates/op-collab-relay-protocol/src/sensitive.rs:106-111 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 6) crates/op-engine-napi/src/bindings_editor.rs:145— crates/op-engine-napi/src/bindings_editor.rs:145-151 | crates/op-engine-napi/src/bindings_editor.rs:184-190 | crates/op-engine-napi/src/bindings_editor.rs:193-199 | crates/op-engine-napi/src/bindings_media.rs:26-32 | crates/op-engine-napi/src/bindings_text.rs:43-49 | crates/op-engine-napi/src/bindings_text.rs:58-64 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 5) crates/op-pen-loader/src/widget_payload.rs:30— crates/op-pen-loader/src/widget_payload.rs:30-38 | crates/op-pen-loader/src/widget_payload.rs:50-58 | crates/op-pen-loader/src/widget_payload.rs:70-78 | crates/op-pen-loader/src/widget_payload.rs:140-148 | crates/op-pen-loader/src/widget_payload.rs:197-205 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (23–25 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:220— templates/step0/_generators/tpl_tutorial_skincare.py:220-242 | templates/step0/_generators/tpl_tutorial_storage.py:215-239 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl_tutorial_skincare.py:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) templates/step0/_generators/tpl_deck_dossier.py:164— templates/step0/_generators/tpl_deck_dossier.py:164-183 | templates/step0/_generators/tpl_deck_ledger.py:159-177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–17 lines × 8) templates/step0/_generators/tpl_infographic_challenge.py:252— templates/step0/_generators/tpl_infographic_challenge.py:252-265 | templates/step0/_generators/tpl_infographic_concept.py:301-317 | templates/step0/_generators/tpl_infographic_data.py:292-305 | templates/step0/_generators/tpl_infographic_faq.py:239-251 | templates/step0/_generators/tpl_infographic_map.py:248-264 | templates/step0/_generators/tpl_infographic_ranking.py:275-287 | templates/step0/_generators/tpl_infographic_steps.py:223-233 | templates/step0/_generators/tpl_infographic_timeline.py:274-286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `templates/step0/_generators/tpl_infographic_challenge.py:250` calls `rect`, `solid` and `templates/step0/_generators/tpl_infographic_concept.py:300` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–16 lines × 3) templates/step0/_generators/tpl_tutorial_onboarding.py:117— templates/step0/_generators/tpl_tutorial_onboarding.py:117-132 | templates/step0/_generators/tpl_tutorial_recipe.py:117-129 | templates/step0/_generators/tpl_tutorial_software.py:132-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 × 6) templates/step0/_generators/tpl_cards.py:87— templates/step0/_generators/tpl_cards.py:87-95 | templates/step0/_generators/tpl_journal_card.py:192-201 | templates/step0/_generators/tpl_lecture_light.py:156-165 | templates/step0/_generators/tpl_pitch_dark.py:144-153 | templates/step0/_generators/tpl_quote_card.py:90-99 | templates/step0/_generators/tpl_quote_card.py:108-116 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. 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 (4–5 lines × 5) templates/step0/_generators/tpl_bookreview_carousel.py:230— templates/step0/_generators/tpl_bookreview_carousel.py:230-234 | templates/step0/_generators/tpl_cityguide_carousel.py:251-261 | templates/step0/_generators/tpl_opinion_carousel.py:211-215 | templates/step0/_generators/tpl_story_carousel.py:214-218 | templates/step0/_generators/tpl_yearreview_carousel.py:311-314 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `templates/step0/_generators/tpl_yearreview_carousel.py:311` calls `frame` and `templates/step0/_generators/tpl_opinion_carousel.py:210` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 13) templates/step0/_generators/tpl_bookreview_carousel.py:137— templates/step0/_generators/tpl_bookreview_carousel.py:137-141 | templates/step0/_generators/tpl_cityguide_carousel.py:151-155 | templates/step0/_generators/tpl_compare_myth_truth.py:122-126 | templates/step0/_generators/tpl_compare_scenario_guide.py:126-130 | templates/step0/_generators/tpl_compare_time_shift.py:118-122 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:108-112 | templates/step0/_generators/tpl_datareport_carousel.py:142-146 | templates/step0/_generators/tpl_opinion_carousel.py:140-144 | templates/step0/_generators/tpl_qa_carousel.py:140-144 | templates/step0/_generators/tpl_story_carousel.py:142-146 | templates/step0/_generators/tpl_toolkit_carousel.py:144-148 | templates/step0/_generators/tpl_tutorial_carousel.py:139-143 | templates/step0/_generators/tpl_yearreview_carousel.py:189-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 13 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 8) templates/step0/_generators/tpl_bookreview_carousel.py:251— templates/step0/_generators/tpl_bookreview_carousel.py:251-255 | templates/step0/_generators/tpl_cityguide_carousel.py:287-291 | templates/step0/_generators/tpl_datareport_carousel.py:217-221 | templates/step0/_generators/tpl_qa_carousel.py:268-272 | templates/step0/_generators/tpl_story_carousel.py:230-234 | templates/step0/_generators/tpl_toolkit_carousel.py:248-252 | templates/step0/_generators/tpl_tutorial_carousel.py:306-310 | templates/step0/_generators/tpl_yearreview_carousel.py:333-337 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 22) templates/step0/_generators/tpl_brand_concept_sheet.py:71— templates/step0/_generators/tpl_brand_concept_sheet.py:71-79 | templates/step0/_generators/tpl_compare_do_dont.py:136-143 | templates/step0/_generators/tpl_compare_myth_truth.py:130-137 | templates/step0/_generators/tpl_compare_pricing_tiers.py:122-129 | templates/step0/_generators/tpl_compare_scenario_guide.py:134-141 | templates/step0/_generators/tpl_compare_spec_table.py:154-161 | templates/step0/_generators/tpl_compare_three_way.py:141-148 | templates/step0/_generators/tpl_compare_time_shift.py:126-133 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:116-123 | templates/step0/_generators/tpl_infographic_challenge.py:153-160 | templates/step0/_generators/tpl_infographic_concept.py:155-162 | templates/step0/_generators/tpl_infographic_data.py:121-128 | templates/step0/_generators/tpl_infographic_faq.py:150-157 | templates/step0/_generators/tpl_infographic_list.py:148-155 | templates/step0/_generators/tpl_infographic_map.py:150-157 | templates/step0/_generators/tpl_infographic_story.py:150-157 | templates/step0/_generators/tpl_infographic_timeline.py:151-158 | templates/step0/_generators/tpl_tutorial_photo.py:160-167 | templates/step0/_generators/tpl_tutorial_skincare.py:149-156 | templates/step0/_generators/tpl_tutorial_software.py:120-127 | templates/step0/_generators/tpl_tutorial_storage.py:156-163 | templates/step0/_generators/tpl_tutorial_workout.py:145-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 22 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 39) templates/step0/_generators/tpl_card_daily.py:72— templates/step0/_generators/tpl_card_daily.py:72-76 | templates/step0/_generators/tpl_card_metric.py:76-80 | templates/step0/_generators/tpl_card_metric.py:85-89 | templates/step0/_generators/tpl_card_notice.py:80-84 | templates/step0/_generators/tpl_card_notice.py:89-93 | templates/step0/_generators/tpl_card_price.py:83-87 | templates/step0/_generators/tpl_card_price.py:92-96 | templates/step0/_generators/tpl_card_quote.py:75-79 | templates/step0/_generators/tpl_card_spine.py:89-93 | templates/step0/_generators/tpl_compare_do_dont.py:119-123 | templates/step0/_generators/tpl_compare_do_dont.py:128-132 | templates/step0/_generators/tpl_compare_myth_truth.py:113-117 | templates/step0/_generators/tpl_compare_pricing_tiers.py:105-109 | templates/step0/_generators/tpl_compare_pricing_tiers.py:114-118 | templates/step0/_generators/tpl_compare_scenario_guide.py:117-121 | templates/step0/_generators/tpl_compare_spec_table.py:137-141 | templates/step0/_generators/tpl_compare_spec_table.py:146-150 | templates/step0/_generators/tpl_compare_three_way.py:116-120 | templates/step0/_generators/tpl_compare_three_way.py:125-129 | templates/step0/_generators/tpl_compare_time_shift.py:109-113 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:99-103 | templates/step0/_generators/tpl_compare_version_diff.py:99-103 | templates/step0/_generators/tpl_compare_version_diff.py:108-112 | templates/step0/_generators/tpl_infographic_challenge.py:145-149 | templates/step0/_generators/tpl_infographic_concept.py:147-151 | templates/step0/_generators/tpl_infographic_data.py:104-108 | templates/step0/_generators/tpl_infographic_data.py:113-117 | templates/step0/_generators/tpl_infographic_faq.py:142-146 | templates/step0/_generators/tpl_infographic_list.py:131-135 | templates/step0/_generators/tpl_infographic_list.py:140-144 | templates/step0/_generators/tpl_infographic_map.py:142-146 | templates/step0/_generators/tpl_infographic_ranking.py:146-150 | templates/step0/_generators/tpl_infographic_steps.py:116-120 | templates/step0/_generators/tpl_infographic_steps.py:125-129 | templates/step0/_generators/tpl_infographic_story.py:142-146 | templates/step0/_generators/tpl_infographic_timeline.py:143-147 | templates/step0/_generators/tpl_journal_card.py:124-128 | templates/step0/_generators/tpl_tutorial_software.py:103-107 | templates/step0/_generators/tpl_tutorial_software.py:112-116 — there are 39 copies across 27 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 39 sites; resolving a subset leaves the remainder to drift apart. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 5) templates/step0/_generators/tpl_compare_do_dont.py:276— templates/step0/_generators/tpl_compare_do_dont.py:276-289 | templates/step0/_generators/tpl_compare_pricing_tiers.py:230-243 | templates/step0/_generators/tpl_compare_time_shift.py:212-225 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:197-210 | templates/step0/_generators/tpl_compare_version_diff.py:178-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 5) templates/step0/_generators/tpl_compare_myth_truth.py:104— templates/step0/_generators/tpl_compare_myth_truth.py:104-108 | templates/step0/_generators/tpl_compare_scenario_guide.py:108-112 | templates/step0/_generators/tpl_compare_spec_table.py:128-132 | templates/step0/_generators/tpl_compare_three_way.py:133-137 | templates/step0/_generators/tpl_tutorial_workout.py:137-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 12) templates/step0/_generators/tpl_compare_myth_truth.py:152— templates/step0/_generators/tpl_compare_myth_truth.py:152-159 | templates/step0/_generators/tpl_compare_scenario_guide.py:156-163 | templates/step0/_generators/tpl_compare_spec_table.py:176-184 | templates/step0/_generators/tpl_compare_three_way.py:163-170 | templates/step0/_generators/tpl_infographic_challenge.py:176-183 | templates/step0/_generators/tpl_infographic_concept.py:178-185 | templates/step0/_generators/tpl_infographic_data.py:145-152 | templates/step0/_generators/tpl_infographic_faq.py:189-196 | templates/step0/_generators/tpl_infographic_list.py:171-178 | templates/step0/_generators/tpl_infographic_map.py:173-180 | templates/step0/_generators/tpl_infographic_steps.py:159-166 | templates/step0/_generators/tpl_infographic_steps.py:238-246 — there are 12 copies across 11 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 12 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 7) templates/step0/_generators/tpl_compare_scenario_guide.py:184— templates/step0/_generators/tpl_compare_scenario_guide.py:184-190 | templates/step0/_generators/tpl_compare_spec_table.py:205-211 | templates/step0/_generators/tpl_infographic_concept.py:230-238 | templates/step0/_generators/tpl_infographic_steps.py:251-259 | templates/step0/_generators/tpl_infographic_story.py:204-212 | templates/step0/_generators/tpl_infographic_story.py:278-293 | templates/step0/_generators/tpl_tutorial_workout.py:274-279 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 10) templates/step0/_generators/tpl_infographic_challenge.py:127— templates/step0/_generators/tpl_infographic_challenge.py:127-132 | templates/step0/_generators/tpl_infographic_concept.py:129-134 | templates/step0/_generators/tpl_infographic_data.py:94-99 | templates/step0/_generators/tpl_infographic_faq.py:124-129 | templates/step0/_generators/tpl_infographic_list.py:121-126 | templates/step0/_generators/tpl_infographic_map.py:124-129 | templates/step0/_generators/tpl_infographic_ranking.py:128-133 | templates/step0/_generators/tpl_infographic_steps.py:106-111 | templates/step0/_generators/tpl_infographic_story.py:124-129 | templates/step0/_generators/tpl_infographic_timeline.py:125-130 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 10 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (43–44 lines × 2) packaging/ios/Sources/AuthCodeFormViewController.swift:68— packaging/ios/Sources/AuthCodeFormViewController.swift:68-110 | packaging/ios/Sources/NativeLoginViewController.swift:102-145 — 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 `packaging/ios/Sources/AuthCodeFormViewController.swift:68` 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–18 lines × 4) packaging/ios/Sources/DocumentExportCoordinator.swift:249— packaging/ios/Sources/DocumentExportCoordinator.swift:249-262 | packaging/ios/Sources/DocumentSaveCoordinator.swift:401-414 | packaging/ios/Sources/ImageImportCoordinator.swift:169-186 | packaging/ios/Sources/OpPlayerView.swift:391-403 — before extracting anything, compare `packaging/ios/Sources/DocumentExportCoordinator.swift` and `packaging/ios/Sources/DocumentSaveCoordinator.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/ios/Sources/DocumentExportCoordinator.swift:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Near-duplicate member family (5 members, 15 shared lines) · ×1
Near-duplicate member family (5 members, 15 shared lines) crates/op-preview-core/src/tests_animation.rs:42— crates/op-preview-core/src/tests_animation.rs:42-59 | crates/op-preview-core/src/tests_debug_controls.rs:82-99 | crates/op-preview-core/src/tests_debug_trace.rs:69-89 | crates/op-preview-core/src/tests_effects.rs:219-238 | crates/op-preview-core/src/tests_ui_actions.rs:29-47 — These 5 members are variants of one another: a block of 15 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 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (15–16 lines × 5) crates/op-preview-core/src/tests_animation.rs:43— crates/op-preview-core/src/tests_animation.rs:43-57 | crates/op-preview-core/src/tests_debug_controls.rs:83-97 | crates/op-preview-core/src/tests_debug_trace.rs:70-84 | crates/op-preview-core/src/tests_effects.rs:220-234 | crates/op-preview-core/src/tests_ui_actions.rs:30-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
End-of-life runtime: Rust 1.94 — rust-toolchain.toml declares Rust 1.94 as this project's toolchain file, and Rust 1.94, superseded by 1.95 on 2026-04-16 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-04-16 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/op-web-sdk/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Duplication concentrated across 2 sibling directories (13 clone groups) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41— 13 of the duplicated blocks reported below have copies in at least two of the sibling directories pkg-ck, src under crates/op-host-web/. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplicated block (68 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41 · crates/op-host-web/src/op_ck_bridge.js:367 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (32 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202 · crates/op-host-web/src/op_ck_bridge.js:838 — the 2 copies are spread across 2 files, 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 (20 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340 · crates/op-host-web/src/op_ck_bridge.js:1308 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (19 lines × 2 locations) packages/op-chrome-extension/i18n.js:210— packages/op-chrome-extension/i18n.js:210 · packages/op-chrome-extension/i18n.js:255 — 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.
R10 · Code Duplication· Duplicated block with local edits (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) packages/op-vscode/src/vscode/configure-command.ts:52— packages/op-vscode/src/vscode/configure-command.ts:52 · packages/op-vscode/src/vscode/configure-command.ts:102 — the two spans are one implementation copied and then locally edited — 109 tokens are still identical, in the same order in both spans, 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.
Duplicated block (16 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118 · crates/op-host-web/src/op_ck_bridge.js:444 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (14 lines × 2 locations) crates/op-host-web/src/op_ck_image_cache.js:142— crates/op-host-web/src/op_ck_image_cache.js:142 · crates/op-host-web/src/op_ck_image_cache.js:271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (13 matched lines × 2 locations) · ×1
Duplicated block with local edits (13 matched lines × 2 locations) packages/op-vscode/src/session/pen-session.ts:412— packages/op-vscode/src/session/pen-session.ts:412 · packages/op-vscode/src/session/pen-session.ts:583 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, 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.
R10 · Code Duplication· Duplicated block with local edits (11 matched lines × 2 locations) · ×1
Duplicated block with local edits (11 matched lines × 2 locations) packages/op-web-sdk-react/vitest.config.ts:1— packages/op-web-sdk-react/vitest.config.ts:1 · packages/op-web-sdk-vue/vitest.config.ts:2 — the two spans are one implementation copied and then locally edited — 80 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.
R10 · Code Duplication· Duplicated block with local edits (8 matched lines × 2 locations) · ×1
Duplicated block with local edits (8 matched lines × 2 locations) packages/op-chrome-extension/capture.js:90— packages/op-chrome-extension/capture.js:90 · packages/op-chrome-extension/capture.js:193 — the two spans are one implementation copied and then locally edited — 59 tokens are still identical, in the same order in both spans, 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.
Complex function collectDesignEvidenceInPage (cyclomatic 47, cognitive 78) packages/op-chrome-extension/design-capture.js:19— collectDesignEvidenceInPage has cyclomatic complexity 47 and cognitive complexity 78; 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 measureParagraph (cyclomatic 39, cognitive 92) crates/op-host-web/src/op_ck_bridge.js:1609— measureParagraph has cyclomatic complexity 39 and cognitive complexity 92; 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 vectorizeSvg (cyclomatic 38, cognitive 49) crates/op-html/assets/snapshot-extractor.js:586— vectorizeSvg has cyclomatic complexity 38 and cognitive complexity 49; 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 drawImageWithOptions (cyclomatic 34, cognitive 53) crates/op-host-web/src/op_ck_bridge.js:1353— drawImageWithOptions has cyclomatic complexity 34 and cognitive complexity 53; 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 walkRules (cyclomatic 31, cognitive 71) packages/op-chrome-extension/design-capture.js:363— walkRules has cyclomatic complexity 31 and cognitive complexity 71; 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 parseInboundFromPage (cyclomatic 29, cognitive 25) packages/op-vscode/src/protocol/bridge.ts:58— parseInboundFromPage has cyclomatic complexity 29 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 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.
Complex function generateDesignMd (cyclomatic 23, cognitive 30) packages/op-chrome-extension/client.js:287— generateDesignMd has cyclomatic complexity 23 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 jpegFitsThumbnailBounds (cyclomatic 23, cognitive 26) crates/op-host-web/src/op_ck_image_cache.js:22— jpegFitsThumbnailBounds has cyclomatic complexity 23 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 failureMessage (cyclomatic 20, cognitive 6) packages/op-chrome-extension/background.js:257— failureMessage has cyclomatic complexity 20 and cognitive complexity 6; 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.
Complex function toHex (cyclomatic 19, cognitive 24) packages/op-chrome-extension/design-capture.js:104— toHex has cyclomatic complexity 19 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 componentSample (cyclomatic 19, cognitive 16) packages/op-chrome-extension/design-capture.js:311— componentSample has cyclomatic complexity 19 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 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.
Complex function capturePage (cyclomatic 18, cognitive 26) packages/op-chrome-extension/capture.js:233— capturePage has cyclomatic complexity 18 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.
R2 · Cyclomatic Complexity· Complex function t (cyclomatic 17, cognitive 25) · ×1
Complex function t (cyclomatic 17, cognitive 25) packages/op-chrome-extension/i18n.js:242— t has cyclomatic complexity 17 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 opCkMakeRuntimeShader (cyclomatic 17, cognitive 16) crates/op-host-web/src/op_ck_bridge.js:178— opCkMakeRuntimeShader has cyclomatic complexity 17 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 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.
Complex function textFirstBaseline (cyclomatic 16, cognitive 20) crates/op-host-web/src/op_ck_bridge.js:1504— textFirstBaseline has cyclomatic complexity 16 and cognitive complexity 20; 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 buildImage (cyclomatic 15, cognitive 21) crates/op-html/assets/snapshot-extractor.js:776— buildImage has cyclomatic complexity 15 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 buildInlineRun (cyclomatic 15, cognitive 21) crates/op-html/assets/snapshot-extractor.js:1054— buildInlineRun has cyclomatic complexity 15 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 shapeToPathData (cyclomatic 15, cognitive 19) crates/op-html/assets/snapshot-extractor.js:485— shapeToPathData has cyclomatic complexity 15 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 onDownload (cyclomatic 15, cognitive 19) packages/op-chrome-extension/popup.js:308— onDownload has cyclomatic complexity 15 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 buildTextLines (cyclomatic 15, cognitive 18) crates/op-html/assets/snapshot-extractor.js:359— buildTextLines has cyclomatic complexity 15 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.
Dead file (~404 LoC) crates/op-host-web/src/op_ck_image_cache.js— no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@iconify-json/feather' — Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@iconify-json/lucide' — Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@iconify-json/simple-icons' — Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Duplicated predicate templates/step0/_generators/qa/cjkcheck.py:73— `doc.get("children") or doc["pages"][0]["children"]` appears character-identically in 2 files — templates/step0/_generators/qa/cjkcheck.py, templates/step0/_generators/qa/freshcheck.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-mcp/src/batch_design_dsl.rs:153— `!call.starts_with("I(") || !call.ends_with(')')` appears character-identically in 2 files — crates/op-mcp/src/batch_design_dsl.rs, crates/op-mcp/src/batch_program_objects.rs. 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 crates/op-orchestrator/src/geometry_card_rail_fixes.rs:142— `!is_rail_card_sibling(c) || is_compact_status_badge_structure(c) || c.get("width").and_then(Value::as_str) != Some("fill_container")` appears character-identically in 2 files — crates/op-orchestrator/src/geometry_card_rail_fixes.rs, crates/op-orchestrator/src/geometry_diagnostics_collect.rs. 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 crates/op-auth-bridge/src/collab_claims.rs:425— `bytes.len() != 36 || bytes[8] != b'-' || bytes[13] != b'-' || bytes[18] != b'-' || bytes[23] != b'-'` appears character-identically in 2 files — crates/op-auth-bridge/src/collab_claims.rs, crates/op-collab-transport/src/admission.rs. 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 crates/op-editor-core/src/svg_import/lexer.rs:149— `c == b'-' || c == b'+' || c == b'.' || c.is_ascii_digit()` appears character-identically in 3 files — crates/op-editor-core/src/svg_import/lexer.rs, crates/op-editor-core/src/svg_import/path_data.rs, crates/op-editor-core/src/svg_path_data.rs. 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 crates/op-codegen/src/ai/parse.rs:199— `code.contains("<script") || code.contains("<template") || code.contains("<style")` appears character-identically in 2 files — crates/op-codegen/src/ai/parse.rs, crates/op-mcp/src/codegen_plan_store.rs. 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 crates/op-chat-agent/src/design_agent_diagnostics.rs:527— `compact.ends_with("img") || compact.ends_with("image") || compact.ends_with("photo") || compact.ends_with("cover") || compact.ends_with("thu…` appears character-identically in 2 files — crates/op-chat-agent/src/design_agent_diagnostics.rs, crates/op-image-enrich/src/targets.rs. 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 crates/op-editor-ui/src/widgets/ai_chat_model_picker.rs:84— `entry.builtin_provider_id.is_some() || entry.value.starts_with("builtin:")` appears character-identically in 2 files — crates/op-editor-ui/src/widgets/ai_chat_model_picker.rs, crates/op-editor-ui/src/widgets/ai_chat_panel_footer.rs. 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 crates/op-host-web/src/dom_io/html_directory_session.rs:487— `extension.eq_ignore_ascii_case("html") || extension.eq_ignore_ascii_case("htm")` appears character-identically in 2 files — crates/op-host-web/src/dom_io/html_directory_session.rs, crates/op-html/src/project.rs. 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 crates/op-orchestrator/src/geometry_overflow_fixes.rs:321— `fixed_width(c).is_some() || c.get("width").and_then(Value::as_str) == Some("fit_content") || c.get("width").is_none()` appears character-identically in 2 files — crates/op-orchestrator/src/geometry_overflow_fixes.rs, crates/op-orchestrator/src/geometry_row_fixes.rs. 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 crates/op-orchestrator/src/orchestration_self_check.rs:395— `has_descendant_type(node, "image") && has_text_descendant(node)` appears character-identically in 2 files — crates/op-orchestrator/src/orchestration_self_check.rs, crates/op-orchestrator/src/role_post_pass/mobile_cards.rs. 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 crates/op-editor-core/src/svg_import/lexer.rs:164— `i < bytes.len() && (bytes[i] == b'-' || bytes[i] == b'+')` appears character-identically in 3 files — crates/op-editor-core/src/svg_import/lexer.rs, crates/op-editor-core/src/svg_import/path_data.rs, crates/op-editor-core/src/svg_path_data.rs. 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 crates/op-figma/src/clipboard.rs:553— `img.url.starts_with("__blob:") || img.url.starts_with("__hash:")` appears character-identically in 2 files — crates/op-figma/src/clipboard.rs, crates/op-figma/src/image_resolver.rs. 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 crates/op-orchestrator/src/orchestration_self_check.rs:407— `label.contains("chip") || label.contains("category") || label.contains("类别")` appears character-identically in 2 files — crates/op-orchestrator/src/orchestration_self_check.rs, crates/op-orchestrator/src/role_post_pass/mobile_category_row.rs. 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 crates/op-host-services/src/provider_probe.rs:496— `lower.contains("not found") || lower.contains("enoent")` appears character-identically in 2 files — crates/op-host-services/src/provider_probe.rs, crates/op-host-services/src/provider_probe_copilot.rs. 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 crates/op-host-services/src/provider_probe.rs:499— `lower.contains("timed out") || lower.contains("timedout")` appears character-identically in 2 files — crates/op-host-services/src/provider_probe.rs, crates/op-host-services/src/provider_probe_copilot.rs. 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 crates/op-engine-ffi/src/editor_document.rs:604— `lower.ends_with(".op") || lower.ends_with(".pen")` appears character-identically in 2 files — crates/op-engine-ffi/src/editor_document.rs, crates/op-host-web/src/file_actions/drop_plan.rs. 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 crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:243— `lower.starts_with("http://") || lower.starts_with("https://")` appears character-identically in 2 files — crates/op-editor-ui/src/widgets/canvas_viewport_image.rs, crates/op-host-desktop/src/render_cli.rs. 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 crates/op-orchestrator/src/category_grid_density.rs:226— `node.get("type").and_then(Value::as_str) != Some("frame") || node.get("layout").and_then(Value::as_str) != Some("horizontal")` appears character-identically in 3 files — crates/op-orchestrator/src/category_grid_density.rs, crates/op-orchestrator/src/role_post_pass/mobile_category_row.rs, crates/op-orchestrator/src/role_post_pass/mobile_search_header.rs. 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 crates/op-mcp/src/batch_design_normalize.rs:437— `obj.contains_key("type") && !obj.contains_key("id")` appears character-identically in 3 files — crates/op-mcp/src/batch_design_normalize.rs, crates/op-mcp/src/batch_layered.rs, crates/op-mcp/src/insert_node_data.rs. 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 crates/op-editor-host-core/src/codegen_export.rs:408— `raw.contains("n1") && raw.contains("n2")` appears character-identically in 2 files — crates/op-editor-host-core/src/codegen_export.rs, crates/op-host-desktop/src/codegen_export.rs. 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 crates/op-chat-agent/src/chat_canvas_tools.rs:485— `src.starts_with("data:") || src.starts_with("http://") || src.starts_with("https://")` appears character-identically in 2 files — crates/op-chat-agent/src/chat_canvas_tools.rs, crates/op-host-services/src/export_html_structured/video.rs. 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 crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs:63— `trimmed.starts_with('<') && trimmed.contains("<svg")` appears character-identically in 2 files — crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs, crates/op-host-desktop/src/remote_image_host.rs. 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 crates/op-host-web/src/dom_io/html_directory_session.rs:473— `url.scheme() != "https" || url.host_str() != Some("openpencil.local") || !url.username().is_empty() || url.password().is_some()` appears character-identically in 2 files — crates/op-host-web/src/dom_io/html_directory_session.rs, crates/op-html/src/project.rs. 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 crates/op-host-services/src/profile_avatar_fetch.rs:187— `url.scheme() != "https" || url.host_str().is_none() || !url.username().is_empty() || url.password().is_some() || url.fragment().is_some() ||…` appears character-identically in 2 files — crates/op-host-services/src/profile_avatar_fetch.rs, crates/op-host-services/src/public_https_client.rs. 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.
Subsumed condition operand crates/op-orchestrator/src/plan_normalize_nav.rs:27— `hay.contains("without bottom navigation")` can never decide this `||` — every value satisfying `hay.contains("without bottom navigation")` also satisfies `hay.contains("without bottom nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/plan_normalize_nav.rs:46— `hay.contains("bottom-tab-bar")` can never decide this `||` — every value satisfying `hay.contains("bottom-tab-bar")` also satisfies `hay.contains("bottom-tab")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/mobile_content_rail_detect.rs:87— `name.contains("bottom navigation")` can never decide this `||` — every value satisfying `name.contains("bottom navigation")` also satisfies `name.contains("bottom nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/dashboard_columns.rs:151— `text.contains("navigation")` can never decide this `||` — every value satisfying `text.contains("navigation")` also satisfies `text.contains("nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/dashboard_columns.rs:253— `text.contains("topheader")` can never decide this `||` — every value satisfying `text.contains("topheader")` also satisfies `text.contains("header")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/cleanup_root_and_nav.rs:279— `hay.contains("bottom-navigation")` can never decide this `||` — every value satisfying `hay.contains("bottom-navigation")` also satisfies `hay.contains("bottom-nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/cleanup_root_and_nav.rs:344— `hay.contains("bottom-navigation")` can never decide this `||` — every value satisfying `hay.contains("bottom-navigation")` also satisfies `hay.contains("bottom-nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-host-services/src/provider_probe_copilot.rs:91— `lower.contains("authenticate first")` can never decide this `||` — every value satisfying `lower.contains("authenticate first")` also satisfies `lower.contains("auth")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-host-services/src/provider_probe_copilot.rs:93— `lower.contains("unauthenticated")` can never decide this `||` — every value satisfying `lower.contains("unauthenticated")` also satisfies `lower.contains("auth")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-host-services/src/chat_intent.rs:304— `upper.contains("DESIGN_NEW")` can never decide this `||` — every value satisfying `upper.contains("DESIGN_NEW")` also satisfies `upper.contains("DESIGN")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/lib_tests.rs:271— `content.contains("events.onTap")` can never decide this `||` — every value satisfying `content.contains("events.onTap")` also satisfies `content.contains("onTap")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/role_post_pass/mobile_search_header.rs:44— `label.contains("sliders")` can never decide this `||` — every value satisfying `label.contains("sliders")` also satisfies `label.contains("slider")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/role_post_pass/mobile_cards.rs:216— `label.contains("shopping cart")` can never decide this `||` — every value satisfying `label.contains("shopping cart")` also satisfies `label.contains("cart")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-design-lint/src/detectors/structure.rs:250— `label.contains("activity graph")` can never decide this `||` — every value satisfying `label.contains("activity graph")` also satisfies `label.contains("graph")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/style_guide/parser.rs:131— `l.contains("card surface")` can never decide this `||` — every value satisfying `l.contains("card surface")` also satisfies `l.contains("surface")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/style_guide/parser.rs:134— `l.contains("default border")` can never decide this `||` — every value satisfying `l.contains("default border")` also satisfies `l.contains("border")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/style_guide/parser.rs:143— `l.contains("primary accent")` can never decide this `||` — every value satisfying `l.contains("primary accent")` also satisfies `l.contains("accent")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 479 significant file(s) lose their only recent owner: crates/op-html/src/import_warning.rs, crates/op-host-services/src/web_canvas_server.rs, packaging/ios/Sources/OpEngineHost.swift, crates/op-html/src/css/selectors.rs, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt, crates/op-figma/src/instance.rs, crates/op-host-web/src/codegen_web.rs, crates/op-collab-host/src/runtime.rs (+471 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 223 significant file(s) lose their only recent owner: crates/op-orchestrator/src/run_orchestrator.rs, crates/op-orchestrator/src/cleanup.rs, crates/op-preview-core/src/session.rs, crates/op-orchestrator/src/prompt_subagent.rs, crates/op-preview-core/src/input.rs, crates/op-orchestrator/src/types.rs, crates/op-editor-ui/src/widgets/scene_template_panel.rs, crates/op-host-web/src/widget_host/preview_slideshow.rs (+215 more). Pair on, review, or document these before any departure.
Hand-rolled JSON/XML parsing via regex scripts/ab-v9/run_matrix.py:211— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex scripts/ab-v9/run_matrix.py:220— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 13/24 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/op-cli`, `crates/op-collab-host`, `crates/op-collab-relay-client`, `crates/op-collab-relay-control-plane` and 6 more.
No security response headers detected deploy/collab-relay-edge/global-nginx.conf:32— No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — defense in depth, even when a reverse proxy could set them. This is reported because `global-nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a0eefd-0ad3-7e8d-a383-41a1d4c29117 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 62 · Warnings: 3020 · Recommendations: 69 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-09-2026 @ 21:05 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.