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

ZSeven-W/openpencil

Measured 27 October 2026, 21:43 UTC, at code version 9a618ce

Regression: 1 dimension fell since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 57out of 100 At risk No change since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A very large codebase: 718,492 lines of product code in 58 projects, tests not counted · Estimated rebuild effort: about 6.2 person-years · Weakest lens: Accessibility, 48

Findings by how serious they are

74 critical 3041 serious 113 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 21:43 UTC

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

91of 91 dimensions measured by tools.
3188of 3228 findings point to an exact file and line, so you can open each one in the code. The other 40 concern the repository as a whole, such as missing documentation.
91dimensions across 9 lenses, read from 718,492 lines of product code in 58 projects.
Chapters

Executive summary

ZSeven-W/openpencil is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 57 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Accessibility, at 48, is the weakest lens and counts most in the score. The best first step is adding text alternatives, worth about 6 points. Automating accessibility checks comes next, worth about 4 points. Raising Accessibility to 65 would lift the score to about 63.

Thirty-six pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Thirty-two known security holes in the packages the code depends on can be used by attackers, and two settings leave the servers or containers unsafe. Pinning each tool to an exact version, updating the vulnerable packages and correcting the unsafe settings would close these risks. The password or key in the code needs replacing, with the old one switched off. The form field without a label needs a label.

The product code is 718,492 lines, about €900,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Accessibility 48 · counts for 45%Code Health 59 · counts for 25%Production Readiness 60 · counts for 14%Maturity 68 · counts for 8%Security and Compliance 71 · counts for 4%Performance 85 · counts for 2%Architecture 95 · counts for 1%Domain Modelling 100 · counts for 1%Event Sourcing 100 · counts for 0%

If Accessibility rose from 48 to 65, the lowest score rated Strong, the score would rise from 57 to about 63.

Code composition: what the lines of code are
Product code 73%Tests 27%
New since the last survey: 55 findings

These 55 critical or serious findings weren't in the previous survey, on 13 October 2026.

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 39 findings

These 39 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one.

  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) templates/step0/_generators/tpl_infographic_challenge.py
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) templates/step0/_generators/tpl_cards.py
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) templates/step0/_generators/tpl_bookreview_carousel.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) packaging/ios/Sources/DocumentExportCoordinator.swift
  • Code Duplication · Duplicated block (7 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-editor-ui/src/widgets/ai_chat_transcript.rs crates/op-editor-ui/src/widgets/ai_chat_transcript.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-orchestrator/src/radial_repair.rs crates/op-orchestrator/src/radial_repair.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-host-services/src/ai_proxy.rs crates/op-host-services/src/ai_proxy.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-editor-ui/src/widgets/ai_chat_transcript_hit.rs crates/op-editor-ui/src/widgets/ai_chat_transcript_hit.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-editor-core/src/instance_override.rs crates/op-editor-core/src/instance_override.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-orchestrator/src/validation_fixes_b3.rs crates/op-orchestrator/src/validation_fixes_b3.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-figma/src/image_resolver.rs crates/op-figma/src/image_resolver.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-editor-ui/src/widgets/layer_panel_hit.rs crates/op-editor-ui/src/widgets/layer_panel_hit.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-opmerge/src/lib.rs crates/op-opmerge/src/lib.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-orchestrator/src/role_layout_post_pass.rs crates/op-orchestrator/src/role_layout_post_pass.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-orchestrator/src/role_infer.rs crates/op-orchestrator/src/role_infer.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-editor-core/src/drag_mutators.rs crates/op-editor-core/src/drag_mutators.rs
  • Churn × Complexity Hotspots · Hotspot: crates/op-orchestrator/src/avatar_repair.rs crates/op-orchestrator/src/avatar_repair.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/op-orchestrator/src/lib.rs crates/op-orchestrator/src/lib.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/op-host-web/src/vscode_bridge.rs crates/op-host-web/src/vscode_bridge.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/op-host-desktop/src/chat_session_launch_design.rs crates/op-host-desktop/src/chat_session_launch_design.rs
  • Churn × Complexity Hotspots · Repeated repair: packages/op-vscode/src/vscode/webview-shell.ts packages/op-vscode/src/vscode/webview-shell.ts
  • Churn × Complexity Hotspots · Repeated repair: crates/op-mcp/src/batch_design_result.rs crates/op-mcp/src/batch_design_result.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/op-mcp/src/batch_direct_ops.rs crates/op-mcp/src/batch_direct_ops.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/op-host-web/src/web_credential_sync.rs crates/op-host-web/src/web_credential_sync.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/op-orchestrator/src/nav_issues.rs crates/op-orchestrator/src/nav_issues.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/op-host-web/src/widget_host/agent_settings_mcp_server.rs crates/op-host-web/src/widget_host/agent_settings_mcp_server.rs
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: RUSTSEC-2026-0344 REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
  • Change Coupling · Change coupling: canvaskit.rs ↔ vscode_bridge.rs crates/op-host-web/src/canvaskit.rs
  • Supply-chain Provenance & Signing REDACTED
  • Code Duplication · Duplicated block (6 lines × 2 locations) packages/op-vscode/src/session/pen-session.ts
  • Code Duplication · Duplicated block with local edits (6 matched lines × 2 locations) packages/op-vscode/src/vscode/codegen-command.ts
  • Code Duplication · Duplicated block (5 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js
  • Code Duplication · Duplicated block (5 lines × 4 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js
  • Code Duplication · Duplicated block (5 lines × 2 locations) REDACTED
Rebuild cost: about €900,000 · Estimate
Cost to rebuild€300,000 to €1,500,000, for 4,990 to 15,830 hours of work, about 6.2 person-years for 3 to 12 engineers
Difficulty of the problemLow, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 57. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 718,492 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Add a 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.
Raises the score by about 6 points · Medium effort · Text alternatives
2
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.
Raises the score by about 4 points · Medium effort · A11y enforcement
3
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 2 points · Low effort · Secret Scanning

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €900,000 to build again, about 6.2 person-years of work. Its weakest lens is Accessibility, at 48 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
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. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.1 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 1,017,357 lines over the last 90 days, which is about 4,125,948 lines a year. At that pace, the extra work comes to an estimated 238.4 to 1430.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch op-ai op-ai op-ai-skills op-ai-skills op-util op-util op-ai-skills->op-util op-auth-bridge op-auth-bridge op-chat-agent op-chat-agent op-chat-agent->op-ai op-chat-agent->op-ai-skills op-editor-core op-editor-core op-chat-agent->op-editor-core op-editor-host-core op-editor-host-core op-chat-agent->op-editor-host-core op-editor-ui op-editor-ui op-chat-agent->op-editor-ui op-mcp op-mcp op-chat-agent->op-mcp op-orchestrator op-orchestrator op-chat-agent->op-orchestrator op-pen-loader op-pen-loader op-chat-agent->op-pen-loader op-cli op-cli op-cli->op-ai-skills op-cli->op-editor-core op-cli->op-pen-loader op-cli->op-util op-collab-host op-collab-host op-collab-host->op-auth-bridge op-collab-relay-protocol op-collab-relay-protocol op-collab-host->op-collab-relay-protocol op-collab-host->op-editor-core op-collab-host->op-editor-host-core op-collab-host->op-editor-ui op-editor-core->op-ai op-editor-core->op-util op-editor-host-core->op-ai op-editor-host-core->op-ai-skills op-editor-host-core->op-editor-core op-editor-host-core->op-orchestrator op-editor-ui->op-ai-skills op-editor-ui->op-editor-core op-editor-ui->op-util op-engine-ffi op-engine-ffi op-engine-ffi->op-ai op-engine-ffi->op-ai-skills op-engine-ffi->op-chat-agent op-engine-ffi->op-collab-host op-engine-ffi->op-editor-core op-engine-ffi->op-editor-host-core op-engine-ffi->op-editor-ui op-host-native op-host-native op-engine-ffi->op-host-native op-engine-ffi->op-orchestrator op-engine-ffi->op-pen-loader op-host-desktop op-host-desktop op-host-desktop->op-ai op-host-desktop->op-ai-skills op-host-desktop->op-auth-bridge op-host-desktop->op-collab-host op-host-desktop->op-collab-relay-protocol op-host-desktop->op-editor-core op-host-desktop->op-editor-host-core op-host-desktop->op-editor-ui op-host-desktop->op-host-native op-host-services op-host-services op-host-desktop->op-host-services op-host-desktop->op-mcp op-host-desktop->op-orchestrator op-host-desktop->op-pen-loader op-host-native->op-auth-bridge op-host-native->op-collab-host op-host-native->op-editor-core op-host-native->op-editor-host-core op-host-native->op-editor-ui op-host-native->op-orchestrator op-host-native->op-pen-loader op-host-services->op-ai op-host-services->op-ai-skills op-host-services->op-auth-bridge op-host-services->op-chat-agent op-host-services->op-collab-host op-host-services->op-editor-core op-host-services->op-editor-host-core op-host-services->op-editor-ui op-host-services->op-mcp op-host-services->op-orchestrator op-host-services->op-pen-loader op-host-services->op-util op-host-web op-host-web op-host-web->op-ai op-host-web->op-editor-core op-host-web->op-editor-host-core op-host-web->op-editor-ui op-host-web->op-pen-loader op-host-web->op-util op-mcp->op-ai-skills op-mcp->op-editor-core op-mcp->op-pen-loader op-mcp->op-util op-orchestrator->op-ai-skills op-orchestrator->op-editor-core op-orchestrator->op-editor-ui op-orchestrator->op-mcp op-orchestrator->op-pen-loader op-orchestrator->op-util op-pen-loader->op-editor-core op-pen-loader->op-util op-smoke op-smoke op-smoke->op-ai op-smoke->op-ai-skills op-smoke->op-chat-agent op-smoke->op-editor-core op-smoke->op-host-services op-smoke->op-mcp op-smoke->op-orchestrator op-smoke->op-pen-loader __more__ +37 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

1915 modules, with 3803 dependencies between them. 22 loops run through 71 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1875 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 op_ai.agent_settings_state2 op_ai.chat_provider3 op_ai_skills.memory.document_context4 op_collab.protocol5 op_collab_relay_protocol.locator6 op_editor_core.codegen7 op_editor_core.collab_ui_state8 op_editor_core.command9 op_editor_core.editor_ui_state.chrome10 op_editor_core.node_id11 op_editor_core.property_panel_state12 op_editor_ui.theme13 op_figma.kiwi14 op_html.css.cascade15 op_i18n.locale16 op_mcp17 op_collab_host.runtime.relay18 op_editor_core.agent_settings.config_types19 op_editor_core.scene_vars20 op_editor_core.ui_draft21 op_editor_ui.widgets.property_panel_snapshot22 op_html.mapper23 op_html.snapshot24 op_collab_host.runtime25 op_editor_core.agent_settings26 op_editor_ui.widgets27 op_editor_ui.widgets.icons28 op_preview_core.session29 op_editor_core.editor_ui_state30 op_editor_core.state31 op_editor_ui.widgets.editor_state_ext32 op_editor_ui.widgets.property_panel_sections33 op_editor_ui.widgets.property_panel34 op_host_services.web_canvas_server35 op_orchestrator.types36 op_host_native.widget_host37 op_orchestrator.plan38 op_engine_ffi.lifecycle39 op_host_desktop40 op_host_web.widget_host
1 op_ai.agent_settings_state
2 op_ai.chat_provider
3 op_ai_skills.memory.document_context
4 op_collab.protocol
5 op_collab_relay_protocol.locator
6 op_editor_core.codegen
7 op_editor_core.collab_ui_state
8 op_editor_core.command
9 op_editor_core.editor_ui_state.chrome
10 op_editor_core.node_id
11 op_editor_core.property_panel_state
12 op_editor_ui.theme
13 op_figma.kiwi
14 op_html.css.cascade
15 op_i18n.locale
16 op_mcp
17 op_collab_host.runtime.relay36
18 op_editor_core.agent_settings.config_types11
19 op_editor_core.scene_vars1
20 op_editor_core.ui_draft2
21 op_editor_ui.widgets.property_panel_snapshot1
22 op_html.mapper1
23 op_html.snapshot1
24 op_collab_host.runtime14112
25 op_editor_core.agent_settings44
26 op_editor_ui.widgets3
27 op_editor_ui.widgets.icons1
28 op_preview_core.session12
29 op_editor_core.editor_ui_state31814112
30 op_editor_core.state11614241
31 op_editor_ui.widgets.editor_state_ext111
32 op_editor_ui.widgets.property_panel_sections2211121
33 op_editor_ui.widgets.property_panel261221252
34 op_host_services.web_canvas_server111
35 op_orchestrator.types1231
36 op_host_native.widget_host112212141111
37 op_orchestrator.plan11
38 op_engine_ffi.lifecycle11
39 op_host_desktop1122
40 op_host_web.widget_host121221111113
Uses a module listed above itPart of a loopThe module itself
1 op_ai.agent_settings_state2 op_ai.chat_provider3 op_ai_skills.memory.document_context4 op_collab.protocol5 op_collab_relay_protocol.locator6 op_editor_core.codegen7 op_editor_core.collab_ui_state8 op_editor_core.command9 op_editor_core.editor_ui_state.chrome10 op_editor_core.node_id11 op_editor_core.property_panel_state12 op_editor_ui.theme13 op_figma.kiwi14 op_html.css.cascade15 op_i18n.locale16 op_mcp17 op_collab_host.runtime.relay18 op_editor_core.agent_settings.config_types19 op_editor_core.scene_vars20 op_editor_core.ui_draft21 op_editor_ui.widgets.property_panel_snapshot22 op_html.mapper23 op_html.snapshot24 op_collab_host.runtime25 op_editor_core.agent_settings26 op_editor_ui.widgets27 op_editor_ui.widgets.icons28 op_preview_core.session29 op_editor_core.editor_ui_state30 op_editor_core.state31 op_editor_ui.widgets.editor_state_ext32 op_editor_ui.widgets.property_panel_sections33 op_editor_ui.widgets.property_panel34 op_host_services.web_canvas_server35 op_orchestrator.types36 op_host_native.widget_host37 op_orchestrator.plan38 op_engine_ffi.lifecycle39 op_host_desktop40 op_host_web.widget_hostop_ai.agent_settings_state1op_ai.chat_provider2op_ai_skills.memory.document_context3op_collab.protocol4op_collab_relay_protocol.locator5op_editor_core.codegen6op_editor_core.collab_ui_state7op_editor_core.command8op_editor_core.editor_ui_state.chrome9op_editor_core.node_id10op_editor_core.property_panel_state11op_editor_ui.theme12op_figma.kiwi13op_html.css.cascade14op_i18n.locale15op_mcp16op_collab_host.runtime.relay17op_editor_core.agent_settings.config_types18op_editor_core.scene_vars19op_editor_core.ui_draft20op_editor_ui.widgets.property_panel_snapshot21op_html.mapper22op_html.snapshot23op_collab_host.runtime24op_editor_core.agent_settings25op_editor_ui.widgets26op_editor_ui.widgets.icons27op_preview_core.session28op_editor_core.editor_ui_state29op_editor_core.state30op_editor_ui.widgets.editor_state_ext31op_editor_ui.widgets.property_panel_sections32op_editor_ui.widgets.property_panel33op_host_services.web_canvas_server34op_orchestrator.types35op_host_native.widget_host36op_orchestrator.plan37op_engine_ffi.lifecycle38op_host_desktop39op_host_web.widget_host403611121111411244311231814112116142411112211121261221252111123111221214111111111122121221111113+1875 more modules (most-connected shown)

At a glance — Code Health · 59% · Adequate · gated by D2, R3 ·

At a glance — Architecture · 95% · Exemplary ·

At a glance — Maturity · 68% · Adequate · gated by M2 ·

At a glance — Readiness · 60% · Adequate ·

At a glance — Security · 71% · Adequate · gated by D30 ·

At a glance — Domain Modelling · 100% · Exemplary ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Accessibility · 48% · Adequate · gated by AC1 ·

At a glance — Performance · 85% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures73High / Critical
A05:2025 — Injection53High / Critical
A02:2025 — Security Misconfiguration4High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Begin by ensuring all media elements have appropriate text alternatives and that every form control and button has a programmatic label. Strengthen the development workflow by enforcing accessibility rules in the linter and test suite, while simultaneously correcting page structure issues such as missing landmarks and language declarations. Finally, immediately resolve the identified secret leak to secure the codebase.

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

Do thisHelpsEffortDimension
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.+5.6 ptsMediumText alternatives
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.+3.9 ptsMediumA11y enforcement
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.+1.9 ptsLowSecret Scanning
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+3.2 ptsMediumPage structure
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+2.6 ptsMediumForms & labels
Resolve the 1 No ADRs found finding(s) in ADR Quality.+1.1 ptsLowADR Quality
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+1.4 ptsMediumLarge Files
Enable Dependabot/Renovate or a dependency-review gate.+1.0 ptsMediumSecurity & performance tooling

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
crates/op-cli/src/main.rs5.1MixedCyclomatic Complexity: op_cli::command_from_positionals (cyclomatic 52)
crates/op-editor-core/src/chat.rs5.1MixedGod Classes: TooManyMethods: ChatState
crates/op-editor-core/src/agent_settings.rs5.5MixedGod Classes: TooManyMethods: AgentSettings
crates/op-editor-ui/src/widgets/property_panel_fill.rs5.5MixedGod Classes: FunctionTooLong: op_editor_ui::widgets::property_panel_fill::paint_one_fill
crates/op-host-services/src/chat_builtin_http.rs5.7MixedCyclomatic Complexity: ConfiguredBuiltinProvider::send_inner (cyclomatic 18)
crates/op-host-native/src/backend/skia.rs5.7MixedGod Classes: TooManyMethods: NativeBackend
crates/op-host-native/src/widget_host/paint.rs5.9MixedCyclomatic Complexity: WidgetHostNative::paint (cyclomatic 86)
crates/op-editor-ui/src/widgets/property_panel_layout.rs5.9MixedCyclomatic Complexity: op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker (cyclomatic 36)
crates/op-orchestrator/src/subagent.rs5.9MixedCyclomatic Complexity: op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes (cyclomatic 23)
crates/op-host-desktop/src/main.rs5.9MixedCognitive Complexity: op_host_desktop::init_auth_runtime (cognitive 16)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 74

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

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

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

Could not be resolved — 11

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. 91 of 91 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 91 dimensions across the health lenses
D1D2D3D4D5D6D9D10D13D14D15D16D17D19D20D26D28D29D30D31D34D35D36D43D44AC1AC2AC3AC5AC6AC7AX10AX3AX5AX6AX9C2DM1DM2DM4DM5ES1ES2M1M2M3M4P1P10P2P3P4P5P6P7PF2PF3R1R10R2R3R4R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X20X21X22X23X24X25X26X27X28X29X3X30X4X5

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

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a17f51-828b-756e-b6e1-cfb033e3e8a3.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for packages/op-vscode/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 215 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 995 test source file(s) (.rb, .swift, .rs) 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-vscode/ 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 bun:test suite in packages/op-vscode/ was NOT MEASURED: the dependency install for packages/op-vscode/ 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/ 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. Not scored — 2 Maven/Gradle manifest(s) were read, stating a version for 9 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • 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.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (packaging/android/app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: uld not get resource 'https://artifact.bytedance.com/repository/AwemeOpenSDK/com/bytedance/ies/ugc/aweme/opensdk-common/0.2.0.10/opensdk-common-0.2.0.10.pom'. > Could not GET 'https://arti…; runtime evidence skipped (launch chosen because packaging/android/app/build.gradle.kts applies the Android application plugin and packaging/android/gradlew builds it).
  • 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 decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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.
  • 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. 13 further occurrence(s) are not listed individually; the score already reflects all 53.

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").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • 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.

Dimensions

D1 · Cyclomatic Complexity5.4 / 10Adequate✓ Tool-verified

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

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

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

424 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was EditorState::apply_with_allocator at 177. 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::en::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.

op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cyclomatic 103) · ×47crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118
op_orchestrator::role_defaults::role_defaults (cyclomatic 51) · ×46crates/op-orchestrator/src/role_defaults.rs:187
WidgetHostNative::dispatch_git_panel_press (cyclomatic 99) · ×43crates/op-host-native/src/widget_host/git_press.rs:26
WidgetHost::apply_cursor_move (cyclomatic 148) · ×22crates/op-host-web/src/widget_host/cursor_input.rs:17
op_host_services::mcp_serve::registry::rebuild_registry (cyclomatic 144) · ×21crates/op-host-services/src/mcp_serve/registry.rs:9

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with EditorState::apply_with_allocator (cyclomatic 177), WidgetHost::apply_cursor_move (cyclomatic 148), op_host_services::mcp_serve::registry::rebuild_registry (cyclomatic 144). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cyclomatic Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. 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.

D2 · Cognitive Complexity3.8 / 10Weak✓ Tool-verified

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

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

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

773 method(s) exceeded the cognitive complexity threshold of 15; the worst was WidgetHost::apply_cursor_move at 261.

op_orchestrator::validation_fixes_apply::apply_validation_fixes (cognitive 124) · ×108crates/op-orchestrator/src/validation_fixes_apply.rs:66
op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cognitive 177) · ×78crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118
WidgetHostNative::paint (cognitive 114) · ×50crates/op-host-native/src/widget_host/paint.rs:19
op_html::mapper_margin::finish_children (cognitive 50) · ×47crates/op-html/src/mapper_margin.rs:166
op_host_services::mcp_serve::registry::rebuild_registry (cognitive 147) · ×35crates/op-host-services/src/mcp_serve/registry.rs:9

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

What to do

  1. Bring the 8 bodies over 120 down to 120 or less in Cognitive Complexity — start with WidgetHost::apply_cursor_move (cognitive 261), op_figma::instance::apply_instance_overrides_cached (cognitive 248), op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cognitive 177). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cognitive Complexity from 3.8 to about 4.9/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. 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.

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.

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

363 god class(es) detected.

FunctionTooLong: op_ck_bridge.opCkInit · ×135crates/op-host-web/src/op_ck_bridge.js:308
MethodTooLong: EditorState.apply_with_allocator · ×81crates/op-editor-core/src/command_apply.rs:55
FileTooLong: src/op_ck_bridge.js · ×64crates/op-host-web/src/op_ck_bridge.js
TooManyMethods: WidgetHostNative · ×31crates/op-host-native/src/widget_host.rs:310
TooManyFunctions: op_chrome_extension_core::wasm_api · ×18crates/op-chrome-extension-core/src/wasm_api.rs:29

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

What to do

  1. Resolve the 135 FunctionTooLong finding(s) in God Classes — start with connection.rs (5), op_ck_bridge.js (3), home_surface_paint_art_screens.rs (3). — One of this dimension's main actionable groups (135 warning-level).
  2. 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).
  3. 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).
  4. 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.

D4 · Code Duplication9.3 / 10Stronggated by 1016 serious findings✓ Tool-verified

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.

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

973 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 1016 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (8 lines × 2) · ×77crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:258
Duplicated block (6 lines × 2) · ×76crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:387
Duplicated block (7 lines × 2) · ×70crates/op-acp/src/client.rs:656
Duplicated block (10 lines × 2) · ×66crates/op-auth-bridge/src/real_collab_ticket.rs:89
Duplicated block (9 lines × 2) · ×65crates/op-auth-bridge/src/collab_claims.rs:504

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

What to do

  1. 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).
  2. 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).
  3. Resolve the 70 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 (70 warning-level).
  4. 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.

D5 · Coupling7.0 / 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.

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

57 production modules (Gradle+Cargo+npm+XcodeGen), 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; an XcodeGen target's dependency on a local Swift package or on a target of another project is not visible there; 20 module(s) off the main sequence, with abstractness counted on 55 of the 57 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: @zseven-w/op-web-sdk · ×19
Unstable project op-engine-ffi
Unstable project op-host-web
Off the main sequence: op-preview-contracts

What to do

  1. Resolve the 19 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 1 Unstable project op-engine-ffi finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Unstable project op-host-web finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  4. 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.

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

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

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

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

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

8 of 474 classes have LCOM4 above 3.

Low cohesion: NativeBackend (LCOM4 28) · ×8crates/op-host-native/src/backend/skia.rs:91

What to do

  1. 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).
  2. 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.

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.

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

13340 test methods: 12833 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 13118 `#[test]` function(s) across 1732 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.

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.

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 215 tests. Measured on the JavaScript/TypeScript suite only — at least 995 test source file(s) (.rb, .swift, .rs) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D13 · Secret Scanning5.0 / 10Adequate✓ Tool-verified

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

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

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

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 743 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.7 / 10Stronggated by 255 serious findings✓ Tool-verified

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

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

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

Top hotspots: crates/op-host-native/src/widget_host/paint.rs (35×86=3010); crates/op-host-web/src/widget_host/cursor_input.rs (19×148=2812); crates/op-host-desktop/src/keyboard_input.rs (17×136=2312) Repeated repair below the complexity floor: crates/op-orchestrator/src/cleanup.rs (18 of 29 changes were fixes); crates/op-orchestrator/src/geometry_validation.rs (11 of 18 changes were fixes); crates/op-host-native/src/backend/skia.rs (7 of 13 changes were fixes)

Hotspot: crates/op-host-native/src/widget_host/paint.rs · ×193crates/op-host-native/src/widget_host/paint.rs:19
Repeated repair: crates/op-orchestrator/src/cleanup.rs · ×62crates/op-orchestrator/src/cleanup.rs:385

What to do

  1. Resolve the 193 Hotspot finding(s) in Churn × Complexity Hotspots — start with connection.rs (4), paint.rs (3), press.rs (2). — One of this dimension's main actionable groups (193 warning-level).
  2. Resolve the 62 Repeated repair finding(s) in Churn × Complexity Hotspots — start with cleanup.rs, geometry_validation.rs, skia.rs. — One of this dimension's main actionable groups (62 warning-level).

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

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.

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

714 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 2209 of the 2509 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
Further sole-owners (lower concentration)

What to do

  1. Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 11 serious findings✓ Tool-verified

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

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

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

11 deducted task-comment markers across 718492 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.

TodoComment · ×11crates/op-orchestrator/src/cleanup_nav_surface_tests.rs:105

What to do

  1. Resolve the 11 TodoComment finding(s) in Explicit Debt — start with validation_fixes_b3.rs (4), cleanup_nav_surface_tests.rs, cli_provider_probe.rs. — One of this dimension's main actionable groups (11 warning-level).
  2. 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

Method: 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.

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D26 · Project Cohesion7.6 / 10Strong✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

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

7 of 58 build units (Cargo, Gradle, XcodeGen, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)5.8 / 10Adequate✓ Tool-verified

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

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

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

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

53 finding(s): 0 critical, 36 high, 8 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

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

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. 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.

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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.

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

62 finding(s): 5 critical, 27 high, 27 medium, 3 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 26 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (13), REDACTED (12), REDACTED. — One of this dimension's main actionable groups (26 issue-level).
  2. Resolve the 5 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 issue-level).
  3. Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D31 · IaC & Container Security9.3 8.8 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 95% · ceiling Documented

4 finding(s): 0 critical, 2 high, 0 medium, 2 low.

REDACTED
REDACTED

What to do

  1. 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).
  2. 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.8 / 10Stronggated by 20 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: subagent.rs↔variables.rs 90%; prompt.rs↔variables.rs 80%; plan_normalize.rs↔variables.rs 80%

Change coupling: subagent.rs ↔ variables.rs · ×15crates/op-orchestrator/src/subagent.rs:1
Change-coupling hub: prompt.rs → plan_normalize.rs, run_tests_b4.rs, variables.rs · ×5crates/op-orchestrator/src/prompt.rs

What to do

  1. Resolve the 15 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 (15 warning-level).
  2. 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.

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

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.

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

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.94rust-toolchain.toml:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — 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.

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.
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.
AC3 · Page structure4.7 / 10Adequate✓ Tool-verified

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.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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.

AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

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.

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.
AX10 · Code composition9.9 / 10Exemplary✓ Tool-verified

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

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

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

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.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

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.

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

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

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

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

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

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

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

C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

DM1 · Aggregate boundaries10.0 / 10Exemplary✓ Tool-verified

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.

DM2 · Strongly-typed ids10.0 / 10Exemplary✓ Tool-verified

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.

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.

DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

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.

ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

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.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

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.

M1 · Documentation (README)8.5 / 10Exemplary✓ Tool-verified

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.
M2 · Architecture documentation2.0 / 10Weak✓ Tool-verified

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

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

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

What to do

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

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

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.

P2 · Observability6.6 / 10Strong✓ Tool-verified

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

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

  • 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.
  • `packages/op-vscode/src/extension.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/op-vscode/src/extension.ts:49
  • `packages/op-vscode/src/extension.ts` reports through `console.*` at line 53 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/op-vscode/src/extension.ts:53

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
  • Add OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling4.0 / 10Weak✓ Tool-verified

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

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

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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

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

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.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

P7 · Outbound HTTP resilience10.0 / 10Exemplary○ Nothing flagged

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.

PF2 · Allocation hygiene7.4 / 10Strong✓ Tool-verified

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.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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.
R10 · Code Duplication8.5 / 10Strong✓ Tool-verified

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
  • REDACTED:420 · REDACTED: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. — REDACTED: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
  • REDACTED:1071 · REDACTED: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. — REDACTED: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.
R2 · Cyclomatic Complexity5.2 / 10Adequate✓ Tool-verified

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. — REDACTED: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
  • 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. — REDACTED: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. — REDACTED: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. — REDACTED: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. — REDACTED:359

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
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.

  • crates/op-host-web/src/op_ck_bridge.js has 1873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/op-host-web/src/op_ck_bridge.js:1
  • REDACTED has 1193 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • packages/op-chrome-extension/popup.js has 697 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/popup.js:1
  • packages/op-chrome-extension/design-capture.js has 628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/design-capture.js:1
  • packages/op-vscode/src/vscode/pen-editor-provider.ts has 581 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-vscode/src/vscode/pen-editor-provider.ts:1
  • packages/op-vscode/src/session/pen-session.ts has 571 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-vscode/src/session/pen-session.ts:1
  • packages/op-chrome-extension/client.js has 496 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/client.js:1
  • crates/op-host-web/src/figma_temp_worker.js has 465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/op-host-web/src/figma_temp_worker.js:1
  • packages/op-chrome-extension/background.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/background.js:1
  • crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
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:1, REDACTED:1, packages/op-chrome-extension/popup.js:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
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.

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.
R8 · Dependency Hygiene8.5 / 10Exemplary✓ Tool-verified

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.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

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.

S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. This repository serves HTTP itself (`.serve_connection(` (crates/op-collab-relay-locator-server/src/http.rs:301)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `cn-federation-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-locator-edge/cn-federation-nginx.conf:32
  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (crates/op-collab-relay-locator-server/src/http.rs:301).

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.
  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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

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

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `bitmask_terms` is public and takes `value: Any` from its caller, and it calls itself at line 49 (`bitmask_terms`) with a piece of `value` — and nowhere in `bitmask_terms` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `bitmask_terms` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deploy/collab-relay-edge/verify-rate-rules.py:49

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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

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

X2 · Cancellation propagation7.8 / 10Strong✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 5/8 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `loadCatalog` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/op-chrome-extension/i18n.js:122
  • `__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — crates/op-host-web/pkg-webgl/op_host_web.js:1687, crates/op-host-web/pkg-ck/op_host_web.js:1206

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped5.0 / 10Adequate✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • `getStringFromWasm0(arg1,arg2)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — crates/op-host-web/pkg-ck/op_host_web.js:741

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

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

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

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

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

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

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

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

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

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

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

  • `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×10) — packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:41, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AlipayNativeSignIn.kt:62, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DeviceLoginRequest.kt:23, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×15) — packages/op-vscode/src/vscode/pen-editor-provider.ts:181, packages/op-vscode/src/vscode/pen-editor-provider.ts:368, packages/op-vscode/src/vscode/pen-editor-provider.ts:433, …
  • `.then(…, () => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — packages/op-vscode/src/vscode/pen-editor-provider.ts:549
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — packages/op-chrome-extension/account.js:120

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

X5 · Nullable reference types10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.

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

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).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 42 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

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

LensScoreRatingImpact
Code Health59%Adequate — gated by D2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture95%ExemplarySolid.
Maturity68%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness60%AdequateAcceptable, with room to improve.
Security71%Adequate — gated by D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplaryStrongest area.
Event Sourcing100%ExemplarySolid.
Accessibility48%Adequate — gated by AC1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance85%ExemplarySolid.
Unscored — 5 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.
  • X7 Silent fallback defaults — 40 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 included — 43 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 applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
  • 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 — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: uld not get resource 'https://artifact.bytedance.com/repository/AwemeOpenSDK/com/bytedance/ies/ugc/aweme/opensdk-common/0.2.0.10/opensdk-common-0.2.0.10.pom'. > Could not GET 'https://arti…; runtime evidence skipped (launch chosen because packaging/android/app/build.gradle.kts applies the Android application plugin and packaging/android/gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
  • D12 Dependency Hygiene — Not scored — 2 Maven/Gradle manifest(s) were read, stating a version for 9 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • 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.
  • D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Kotlin, Python, Rust, Swift, TypeScript, html not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. 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 — D24 reads C# and Visual Basic comments only — this repository's production source is .kt, .py, .rs, .swift, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 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 — JavaScript/TypeScript suite
  • 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 — Not assessed, and this one is on us: 2 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this 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#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.

Appendix A — Findings (grouped)

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

Critical — 74 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 11 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×26
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 1 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Critical CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
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.
AC3 · Page structure · <html> without a lang · ×1
  • <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>.
D13 · Secret Scanning · Leaked secret · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
Serious — 3041 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×193
  • 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 35 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 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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 19 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. 3 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-host-desktop/src/keyboard_input.rs crates/op-host-desktop/src/keyboard_input.rs:15 — crates/op-host-desktop/src/keyboard_input.rs changed 17 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. 6 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-editor-ui/src/widgets/icons.rs crates/op-editor-ui/src/widgets/icons.rs:294 — crates/op-editor-ui/src/widgets/icons.rs changed 11 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 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-editor-core/src/command_apply.rs crates/op-editor-core/src/command_apply.rs:55 — crates/op-editor-core/src/command_apply.rs changed 8 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. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in WidgetHost::paint_editor at line 49. 4 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 23 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. 3 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 12 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. 5 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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. 3 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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. 9 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-host-web/src/canvaskit/mount.rs crates/op-host-web/src/canvaskit/mount.rs:14 — crates/op-host-web/src/canvaskit/mount.rs changed 21 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 23 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 15 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 22 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. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-host-desktop/src/persistence.rs crates/op-host-desktop/src/persistence.rs:372 — crates/op-host-desktop/src/persistence.rs changed 20 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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_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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-host-services/src/mcp_serve.rs crates/op-host-services/src/mcp_serve.rs:403 — crates/op-host-services/src/mcp_serve.rs changed 24 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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.
  • 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 20 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-services/src/chat_subprocess.rs crates/op-host-services/src/chat_subprocess.rs:280 — crates/op-host-services/src/chat_subprocess.rs changed 11 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-editor-ui/src/widgets/property_panel_dispatch.rs crates/op-editor-ui/src/widgets/property_panel_dispatch.rs:186 — crates/op-editor-ui/src/widgets/property_panel_dispatch.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in op_editor_ui::widgets::property_panel_dispatch::apply_property_action at line 186. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/property_panel_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.
  • Hotspot: crates/op-orchestrator/src/prompt_subagent.rs crates/op-orchestrator/src/prompt_subagent.rs:148 — crates/op-orchestrator/src/prompt_subagent.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes at line 148. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/prompt_subagent.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 13 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 29 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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 10 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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.
  • + 168 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×135
  • 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 347 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 247 over it, 3.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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.
  • + 110 more in this group — see findings.md.
D2 · Cognitive Complexity · op_orchestrator · ×108
  • 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::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::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::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::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::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::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::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::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::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::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.
  • 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.
  • + 83 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×81
  • 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 223 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 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 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.
  • + 56 more in this group — see findings.md.
D2 · Cognitive Complexity · op_editor_ui · ×78
  • 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::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::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::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::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_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::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::property_panel_code_complete::syntax_tokens (cognitive 45) crates/op-editor-ui/src/widgets/property_panel_code_complete.rs:474 — 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::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::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::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::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::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.
  • 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.
  • + 53 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×77
  • 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-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-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-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/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-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-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/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-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-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/mode_transition_host.rs:130 — crates/op-host-native/src/widget_host/mode_transition_host.rs:130-138 | crates/op-host-web/src/widget_host/preview_slideshow.rs:224-231 — 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.
  • + 52 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×76
  • 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-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-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/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-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/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/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-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/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-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/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/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/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-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.
  • + 51 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×70
  • 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/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/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/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/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.
  • Duplicated block (7 lines × 2) crates/op-host-services/src/export_html.rs:117 — crates/op-host-services/src/export_html.rs:117-123 | crates/op-host-services/src/export_hyperframes.rs:344-350 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
  • + 45 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×66
  • 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/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 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-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-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-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/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/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-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-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/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-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/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-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/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-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.
  • + 41 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×65
  • 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-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 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-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-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-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-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 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/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.
  • + 40 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×65
  • 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-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-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-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/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/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/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/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-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-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/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-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-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/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-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-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.
  • + 40 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×64
  • 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: REDACTED REDACTED — 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.
  • + 39 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×62
  • Repeated repair: crates/op-orchestrator/src/cleanup.rs crates/op-orchestrator/src/cleanup.rs:385 — crates/op-orchestrator/src/cleanup.rs changed 29 times in last 90 days and 18 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-orchestrator/src/geometry_validation.rs crates/op-orchestrator/src/geometry_validation.rs:414 — crates/op-orchestrator/src/geometry_validation.rs changed 18 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 10 (its worst body is op_orchestrator::geometry_validation::table_columns_exceed_width at line 414), 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): shrink an over-wide pinned row to its parent with mirrored insets”; “fix(agent): inset fill_container children of none stacks and pad flush cards”; “fix(agent): give phone controls the 44px touch floor the corpus promises”; “fix(agent): shrink single-line text that outgrows its rail instead of clipping 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/geometry_validation.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/backend/skia.rs crates/op-host-native/src/backend/skia.rs:387 — crates/op-host-native/src/backend/skia.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 3 (its worst body is NativeBackend::clip_polygon at line 387), 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(renderer): stop double-applying fill and stroke alpha”; “fix(editor): resolve native font availability through FontMgr”; “fix(renderer): shape complex scripts instead of painting them in storage order (#194)”; “fix(renderer): register pan-cache strips to the layer anchor and refresh on decode”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-host-native/src/backend/skia.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/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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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_intent.rs crates/op-host-services/src/chat_intent.rs:333 — crates/op-host-services/src/chat_intent.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_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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-host-services/src/model_discovery.rs crates/op-host-services/src/model_discovery.rs:329 — crates/op-host-services/src/model_discovery.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 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-orchestrator/src/model_profile.rs crates/op-orchestrator/src/model_profile.rs:434 — crates/op-orchestrator/src/model_profile.rs changed 8 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 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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: crates/op-editor-ui/src/widgets/property_panel_overlay_hit.rs crates/op-editor-ui/src/widgets/property_panel_overlay_hit.rs:441 — crates/op-editor-ui/src/widgets/property_panel_overlay_hit.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 PropertyPanel::keyboard_owner_rect at line 441), 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): polish mobile and tablet players”; “fix(panels): fix color variable picker interaction routing”; “fix(editor): float the color-variable picker in a scrolling popover”; “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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/property_panel_overlay_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.
  • 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-orchestrator/src/scaffold.rs crates/op-orchestrator/src/scaffold.rs:640 — crates/op-orchestrator/src/scaffold.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 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-services/src/provider_probe.rs crates/op-host-services/src/provider_probe.rs:159 — crates/op-host-services/src/provider_probe.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 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-image-enrich/src/net/fetch.rs crates/op-image-enrich/src/net/fetch.rs:241 — crates/op-image-enrich/src/net/fetch.rs changed 7 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 12 (its worst body is op_image_enrich::net::fetch::fetch_judged_wikimedia at line 241), 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(agent): judge the wikimedia fallback instead of falling open to its first page”; “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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-image-enrich/src/net/fetch.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/cli_provider_probe.rs crates/op-host-services/src/cli_provider_probe.rs:280 — crates/op-host-services/src/cli_provider_probe.rs changed 7 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 7 (its worst body is op_host_services::cli_provider_probe::query_models at line 280), 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(services): parse the two-column antigravity model catalog”; “fix(agent): give networked model probes a budget past the cli's own error”; “fix(editor): async hygiene — safe block_on, bounded acp channels, thread teardown”; “fix(agent): share timeout diagnostics with model discovery probes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/cli_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-host-services/src/web_canvas_server/tenant.rs crates/op-host-services/src/web_canvas_server/tenant.rs:633 — crates/op-host-services/src/web_canvas_server/tenant.rs changed 7 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 TenantRegistry::update_acl at line 633), 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): request-time epoch snapshots, AI write admission, drain without ceiling”; “fix(web): credential partition hygiene, shutdown write barrier, seed lifecycle”; “fix(web): wire the review remedies end to end”; “fix(web): close the review's high-severity online gaps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server/tenant.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 6 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_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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-acp/src/client.rs crates/op-acp/src/client.rs:677 — crates/op-acp/src/client.rs changed 6 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 13 (its worst body is op_acp::client::connect_remote at line 677), 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(desktop): retry an acp agent spawn that hits etxtbsy”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”; “fix(services): carry cli output into failures as bounded redacted tails”; “fix(editor): async hygiene — safe block_on, bounded acp channels, thread teardown”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-acp/src/client.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 6 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 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-host-web/src/live_sync_conflict.rs crates/op-host-web/src/live_sync_conflict.rs:26 — crates/op-host-web/src/live_sync_conflict.rs changed 6 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 3 (its worst body is op_host_web::live_sync_conflict::preserve_local_document at line 26), 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): satisfy canvaskit clippy on the live-sync modules”; “fix(web): credential partition hygiene, shutdown write barrier, seed lifecycle”; “fix(web): wire the review remedies end to end”; “fix(web): recovery affordance, tenant-aware URLs, and restore isolation for online”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-host-web/src/live_sync_conflict.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-collab-transport/src/tcp.rs crates/op-collab-transport/src/tcp.rs:189 — crates/op-collab-transport/src/tcp.rs changed 6 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 7 (its worst body is op_collab_transport::tcp::wait_for_connect at line 189), 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(collab): clamp kernel keepalive to whole seconds”; “fix(web): unbreak linux CI — keepalive EINVAL and the bundle tripwire”; “fix(collab): close a gesture whose release never arrives”; “fix(collab): normalize blocking mode on accepted sockets”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-collab-transport/src/tcp.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 5 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 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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-host-services/src/web_canvas_server/collab_state.rs crates/op-host-services/src/web_canvas_server/collab_state.rs:343 — crates/op-host-services/src/web_canvas_server/collab_state.rs changed 5 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 6 (its worst body is WebCanvasState::ingest_document_in_session at line 343), 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): 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”; “fix(web): wire the review remedies end to end”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server/collab_state.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 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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/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 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 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-07-19..2026-10-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-19 19:08:33 +08:00' --until='2026-10-17 19:08:33 +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.
  • + 37 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×54
  • 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_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/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/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-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/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-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-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-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.
  • + 29 more in this group — see findings.md.
D2 · Cognitive Complexity · WidgetHostNative · ×50
  • 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.
  • + 25 more in this group — see findings.md.
D1 · Cyclomatic Complexity · op_editor_ui · ×47
  • 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::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::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_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::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::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::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::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_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_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::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::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.
  • + 22 more in this group — see findings.md.
D2 · Cognitive Complexity · op_html · ×47
  • 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::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::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::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::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::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::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::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::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::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_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::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.
  • + 22 more in this group — see findings.md.
D1 · Cyclomatic Complexity · op_orchestrator · ×46
  • 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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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.
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×46
  • 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-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-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-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/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-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-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_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-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-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-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-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/preview_slideshow.rs:248 — crates/op-host-native/src/widget_host/preview_slideshow.rs:248-259 | crates/op-host-web/src/widget_host/preview_slideshow.rs:399-410 — 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 (12 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:268 — crates/op-host-native/src/widget_host/preview_slideshow.rs:268-279 | crates/op-host-web/src/widget_host/preview_slideshow.rs:419-430 — 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.
  • + 21 more in this group — see findings.md.
D1 · Cyclomatic Complexity · WidgetHostNative · ×43
  • 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.
  • + 18 more in this group — see findings.md.
D2 · Cognitive Complexity · op_host_services · ×35
  • op_host_services::mcp_serve::registry::rebuild_registry (cognitive 147) crates/op-host-services/src/mcp_serve/registry.rs:9 — op_host_services::mcp_serve::registry::rebuild_registry has cognitive complexity 147 (threshold 15). Drivers by points: if/else 142 (145 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::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::cli_modes::run_cli_mode (cognitive 24) crates/op-host-services/src/cli_modes.rs:23 — op_host_services::cli_modes::run_cli_mode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 2 (3 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • 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::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::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::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::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::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::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::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.
  • + 10 more in this group — see findings.md.
D2 · Cognitive Complexity · WidgetHost · ×33
  • 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.
  • + 8 more in this group — see findings.md.
D2 · Cognitive Complexity · op_editor_core · ×33
  • 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_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::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::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_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::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::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::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::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::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::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::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::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::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::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::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::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.
  • + 8 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×31
  • 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 — 428 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 398 over it, 14.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: 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 — 98 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 68 over it, 3.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: 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, declared across 3 files: Sources/OpEngineHost.swift (40), Sources/OpEngineHost+Auth.swift (12), Sources/OpEngineHost+Pointer.swift (7). The bar is 30 methods; this is 29 over it, 1.97× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: 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, declared across 3 files: Sources/OpPlayerView.swift (44), Sources/OpPlayerView+ImeBridge.swift (5), Sources/OpPlayerView+Login.swift (3). The bar is 30 methods; this is 22 over it, 1.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: 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.
  • + 6 more in this group — see findings.md.
D2 · Cognitive Complexity · op_figma · ×30
  • 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::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_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::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::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::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::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::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::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::instance::assignment::seed_assignments_from_instances (cognitive 17) crates/op-figma/src/instance/assignment.rs:42 — op_figma::instance::assignment::seed_assignments_from_instances has cognitive complexity 17 (threshold 15). Drivers by points: if/else 20 (50 pts), loops 10 (24 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (op_figma::instance::assignment::seed_assignments_from_instances::collect, 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 (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.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×28
  • 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/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-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-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/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/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/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-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-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/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-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-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:216 — crates/op-html/src/project_zip.rs:216-229 | 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/finalize_enforce_status_bar.rs:90 — crates/op-orchestrator/src/finalize_enforce_status_bar.rs:90-103 | crates/op-orchestrator/src/unify_shared_status_bar.rs:192-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 3 more in this group — see findings.md.
D2 · Cognitive Complexity · op_mcp · ×26
  • 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_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::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_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::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::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::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_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.
  • op_mcp::style_ops_tools::parse_replacements (cognitive 16) crates/op-mcp/src/style_ops_tools.rs:256 — op_mcp::style_ops_tools::parse_replacements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×25
  • 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/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-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-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-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/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-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/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-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-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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×25
  • 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:427-439 — 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/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-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-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/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-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:243-255 — 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 7 separate duplicated blocks between them, totalling at least 81 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/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: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:161-173 — 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/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:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/popup.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/design-capture.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/client.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/op-host-web/src/figma_temp_worker.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/background.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/op-host-web/src/op_ck_image_cache.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/picker.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/capture.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/i18n.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/account.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/design-evidence.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/scripts/check-locales.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/scripts/check-design-evidence.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/popup-status.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/scripts/check-sw-imports.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/core-registry.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/design-md.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/wasm-core.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-vscode/build.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/op-chrome-extension/popup-worker-actions.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D1 · Cyclomatic Complexity · WidgetHost · ×22
  • 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.
D1 · Cyclomatic Complexity · op_host_services · ×21
  • op_host_services::mcp_serve::registry::rebuild_registry (cyclomatic 144) crates/op-host-services/src/mcp_serve/registry.rs:9 — op_host_services::mcp_serve::registry::rebuild_registry has cyclomatic complexity 144 (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::serve_options::parse_serve_web_args_managed (cyclomatic 19) crates/op-host-services/src/web_canvas_server/serve_options.rs:113 — op_host_services::web_canvas_server::serve_options::parse_serve_web_args_managed 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_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::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::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::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_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.
D1 · Cyclomatic Complexity · op_html · ×20
  • 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_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::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::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::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::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::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::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_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::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.
D5 · Coupling · Off the main sequence · ×19
  • 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-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.
D3 · God Classes · TooManyFunctions · ×18
  • 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.
D1 · Cyclomatic Complexity · op_editor_core · ×17
  • 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::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::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::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::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::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_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.
  • 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.
D3 · God Classes · TooManyFields · ×17
  • TooManyFields: EditorUiState crates/op-editor-core/src/editor_ui_state.rs:44 — TooManyFields — 221 stored fields beside 98 methods. The bar is 30 stored fields; this is 191 over it, 7.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: 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 428 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.
D3 · God Classes · ClassTooLong · ×17
  • 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×17
  • 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/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-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-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.
D2 · Cognitive Complexity · EditorState · ×16
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×16
  • 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-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-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.
X3 · Exception handling · Swallowed exception (empty catch) · ×16
  • Swallowed exception (empty catch) packages/op-vscode/src/vscode/pen-editor-provider.ts:181 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/vscode/pen-editor-provider.ts:368 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/vscode/pen-editor-provider.ts:433 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/vscode/pen-editor-provider.ts:549 — `.then(…, () => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/vscode/restart-source.ts:57 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/vscode/shell-messages.ts:41 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/vscode/shell-messages.ts:92 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/session/pen-session.ts:538 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-vscode/src/mcp/mcp-proxy.ts:152 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-chrome-extension/client.js:271 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-chrome-extension/design-capture.js:435 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-chrome-extension/design-capture.js:448 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-chrome-extension/i18n.js:162 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/op-chrome-extension/picker.js:143 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) crates/op-host-web/src/op_ck_bridge.js:1917 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:439 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D2 · Cognitive Complexity · op_host_desktop · ×15
  • 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::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::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::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.
D35 · Change Coupling · Change coupling · ×15
  • Change coupling: subagent.rs ↔ variables.rs crates/op-orchestrator/src/subagent.rs:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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: command.rs ↔ command_node.rs crates/op-editor-core/src/command.rs:1 — `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.
  • Change coupling: main.rs ↔ chat_runtime.rs crates/op-host-desktop/src/main.rs:1 — `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.
D1 · Cyclomatic Complexity · op_mcp · ×14
  • 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::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::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::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::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::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_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.
D2 · Cognitive Complexity · op_design_lint · ×14
  • 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::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.
  • 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.
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/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/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/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.
D1 · Cyclomatic Complexity · op_figma · ×12
  • 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::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_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::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.
D2 · Cognitive Complexity · op_host_web · ×12
  • 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_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::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::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:410 — 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.
  • op_host_web::codegen_host::receive (cognitive 16) crates/op-host-web/src/codegen_host.rs:128 — op_host_web::codegen_host::receive 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.
D2 · Cognitive Complexity · op_chat_agent · ×12
  • 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_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.
  • 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×12
  • 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/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-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-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.
D1 · Cyclomatic Complexity · op_host_desktop · ×11
  • 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_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_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_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::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::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::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.
D17 · Explicit Debt · TodoComment · ×11
  • 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.
  • 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-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-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-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-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-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-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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×11
  • 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/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-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-web/src/web_settings.rs:543 — crates/op-host-web/src/web_settings.rs:543-559 | 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×11
  • 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×11
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:41 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AlipayNativeSignIn.kt:62 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DeviceLoginRequest.kt:23 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DeviceLoginRequest.kt:48 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DouyinNativeSignIn.kt:45 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:513 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/SsoRegion.kt:112 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/WechatNativeSignIn.kt:51 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/wxapi/WXEntryActivity.kt:22 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/douyinapi/DouYinEntryActivity.kt:24 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packages/op-chrome-extension/account.js:120 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D2 · Cognitive Complexity · op_ai_skills · ×10
  • 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::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::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::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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×10
  • 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×9
  • 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/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-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-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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×9
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×9
  • 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.
D1 · Cyclomatic Complexity · DesktopApp · ×8
  • 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.
D1 · Cyclomatic Complexity · op_host_web · ×8
  • 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::web_settings::apply_payload (cyclomatic 16) crates/op-host-web/src/web_settings.rs:410 — 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.
  • 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.
D2 · Cognitive Complexity · GitPanel · ×8
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×8
  • 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×8
  • 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.
D1 · Cyclomatic Complexity · EditorState · ×7
  • 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.
D2 · Cognitive Complexity · DesktopApp · ×7
  • 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×7
  • 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.
D1 · Cyclomatic Complexity · op_pen_loader · ×6
  • 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::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_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.
D2 · Cognitive Complexity · op_image_enrich · ×6
  • 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::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::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::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.
D2 · Cognitive Complexity · op_engine_ffi · ×6
  • 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::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::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::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.
D36 · Supply-chain Provenance & Signing REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×6
  • 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-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-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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×6
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×6
  • 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.
D1 · Cyclomatic Complexity · op_chat_agent · ×5
  • 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_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_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.
D1 · Cyclomatic Complexity · op_design_lint · ×5
  • 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.
D1 · Cyclomatic Complexity · op_ai_skills · ×5
  • 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.
D2 · Cognitive Complexity · op_pen_loader · ×5
  • 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::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::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::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.
D2 · Cognitive Complexity · op_editor_host_core · ×5
  • 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×5
  • 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×5
  • 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:169 — crates/op-host-web/src/vscode_bridge.rs:169-184 | 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×5
  • 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.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×5
  • 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.
D1 · Cyclomatic Complexity · AIChatPlaceholder · ×4
  • 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.
D1 · Cyclomatic Complexity · op_collab_relay_server · ×4
  • 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.
D2 · Cognitive Complexity · op_collab_host · ×4
  • 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.
D2 · Cognitive Complexity · op_smoke · ×4
  • 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.
D2 · Cognitive Complexity · op_opmerge · ×4
  • 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.
D2 · Cognitive Complexity · op_codegen · ×4
  • 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.
D2 · Cognitive Complexity · op_collab · ×4
  • 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.
D2 · Cognitive Complexity · GuestSessionCore · ×4
  • 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • 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-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-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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×4
  • 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.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×4
  • 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) REDACTED:420 — REDACTED:420 · REDACTED: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.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×4
  • 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) REDACTED:1071 — REDACTED:1071 · REDACTED: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>.
D1 · Cyclomatic Complexity · GitPanel · ×3
  • 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.
D1 · Cyclomatic Complexity · CollabPanel · ×3
  • 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.
D1 · Cyclomatic Complexity · op_collab_host · ×3
  • 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.
D1 · Cyclomatic Complexity · TopBar · ×3
  • 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.
D1 · Cyclomatic Complexity · op_editor_host_core · ×3
  • 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::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_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.
D2 · Cognitive Complexity · AIChatPlaceholder · ×3
  • 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.
D2 · Cognitive Complexity · LayerPanel · ×3
  • 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.
D2 · Cognitive Complexity · CollabPanel · ×3
  • 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.
D2 · Cognitive Complexity · TopBar · ×3
  • 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.
D2 · Cognitive Complexity · op_preview_core · ×3
  • 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.
D2 · Cognitive Complexity · op_collab_relay_server · ×3
  • 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.
D2 · Cognitive Complexity · PreviewMotionState · ×3
  • 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.
D2 · Cognitive Complexity · PreviewSession · ×3
  • 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.
D29 · Static Analysis (SAST) · REDACTED
  • 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×3
  • 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:59-72 — 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 7 separate duplicated blocks between them, totalling at least 81 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.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (8–11 lines × 3) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • 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 (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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×3
  • 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.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×3
  • 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.
R10 · Code Duplication · Duplicated block (6 lines × 2 locations) · ×3
  • 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.
X2 · Cancellation propagation · Async function without AbortSignal · ×3
  • Async function without AbortSignal: loadCatalog packages/op-chrome-extension/i18n.js:122 — `loadCatalog` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: __wbg_init crates/op-host-web/pkg-webgl/op_host_web.js:1687 — `__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: __wbg_init crates/op-host-web/pkg-ck/op_host_web.js:1206 — `__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D1 · Cyclomatic Complexity · op_cli · ×2
  • 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.
D1 · Cyclomatic Complexity · PropertyPanel · ×2
  • 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.
D1 · Cyclomatic Complexity · LayerPanel · ×2
  • 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.
D1 · Cyclomatic Complexity · op_chrome_extension_core · ×2
  • 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.
D1 · Cyclomatic Complexity · design-capture.collectDesignEvidenceInPage · ×2
  • design-capture.collectDesignEvidenceInPage::walkRules (cyclomatic 31) packages/op-chrome-extension/design-capture.js:363 — design-capture.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. This shape REPEATS in the file: 2 other methods here (design-capture.collectDesignEvidenceInPage, design-capture.collectDesignEvidenceInPage::toHex) 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.
  • design-capture.collectDesignEvidenceInPage::toHex (cyclomatic 20) packages/op-chrome-extension/design-capture.js:104 — design-capture.collectDesignEvidenceInPage::toHex 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 shape REPEATS in the file: 2 other methods here (design-capture.collectDesignEvidenceInPage, design-capture.collectDesignEvidenceInPage::walkRules) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · op_auth_bridge · ×2
  • 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.
D1 · Cyclomatic Complexity · op_engine_ffi · ×2
  • 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.
D1 · Cyclomatic Complexity · OwnerSessionCore · ×2
  • 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.
D1 · Cyclomatic Complexity · GuestSessionCore · ×2
  • 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.
D1 · Cyclomatic Complexity · PromptCenterPanel · ×2
  • 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.
D1 · Cyclomatic Complexity · PreviewSession · ×2
  • 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.
D1 · Cyclomatic Complexity · op_host_web.debugString (cyclomatic 18) · ×2
  • 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.
D1 · Cyclomatic Complexity · op_image_enrich · ×2
  • 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.
D2 · Cognitive Complexity · PropertyPanel · ×2
  • 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.
D2 · Cognitive Complexity · BrowserState · ×2
  • 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.
D2 · Cognitive Complexity · SceneTemplatePanel · ×2
  • 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.
D2 · Cognitive Complexity · GitRepo · ×2
  • 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.
D2 · Cognitive Complexity · op_chrome_extension_core · ×2
  • 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.
D2 · Cognitive Complexity · op_auth_bridge · ×2
  • 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.
D2 · Cognitive Complexity · op_collab_relay_client · ×2
  • 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.
D2 · Cognitive Complexity · PromptCenterPanel · ×2
  • 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.
D2 · Cognitive Complexity · SheetParser · ×2
  • 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.
D2 · Cognitive Complexity · Parser · ×2
  • 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.
D2 · Cognitive Complexity · CodegenPipeline · ×2
  • 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.
D2 · Cognitive Complexity · SlidesPanelTabs · ×2
  • 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.
D2 · Cognitive Complexity · op_host_web.debugString (cognitive 24) · ×2
  • 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.
D2 · Cognitive Complexity · collectDesignEvidenceInPage · ×2
  • 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.
D2 · Cognitive Complexity · DesignMdPanel · ×2
  • 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.
D2 · Cognitive Complexity · CollabRuntime · ×2
  • 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.
D2 · Cognitive Complexity · op_collab_smoke · ×2
  • 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.
D2 · Cognitive Complexity · op_collab_transport · ×2
  • 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.
D2 · Cognitive Complexity · op_process_io · ×2
  • 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.
D2 · Cognitive Complexity · op_host_web.__wbg_load (cognitive 19) · ×2
  • 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). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent 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). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OwnerSessionCore · ×2
  • 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.
D2 · Cognitive Complexity · NativeBackend · ×2
  • 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.
D2 · Cognitive Complexity · op_ck_bridge.opCkInit.systemTypefaceFor (cognitive 16) · ×2
  • op_ck_bridge.opCkInit.systemTypefaceFor (cognitive 16) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:214 — op_ck_bridge.opCkInit.systemTypefaceFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • op_ck_bridge.opCkInit.systemTypefaceFor (cognitive 16) crates/op-host-web/src/op_ck_bridge.js:850 — op_ck_bridge.opCkInit.systemTypefaceFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (28–30 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (18–22 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×2
  • 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 (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.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 9) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (4–6 lines × 4) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • 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.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×2
  • 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.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×2
  • 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.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×2
  • 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.
R7 · Dead Code · Dead file (~6 LoC) · ×2
  • 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.
D1 · Cyclomatic Complexity · op_host_web.__wbg_get_imports (cyclomatic 69) · ×1
  • 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.
D1 · Cyclomatic Complexity · SubprocessProvider · ×1
  • 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.
D1 · Cyclomatic Complexity · Orchestrator · ×1
  • 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.
D1 · Cyclomatic Complexity · op_host_web.__wbg_get_imports (cyclomatic 47) · ×1
  • 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.
D1 · Cyclomatic Complexity · design-capture.collectDesignEvidenceInPage (cyclomatic 47) · ×1
  • design-capture.collectDesignEvidenceInPage (cyclomatic 47) packages/op-chrome-extension/design-capture.js:19 — design-capture.collectDesignEvidenceInPage 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. This shape REPEATS in the file: 2 other methods here (design-capture.collectDesignEvidenceInPage::toHex, design-capture.collectDesignEvidenceInPage::walkRules) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · VariablesPanel · ×1
  • 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.
D1 · Cyclomatic Complexity · RuntimeError · ×1
  • 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.
D1 · Cyclomatic Complexity · op_smoke · ×1
  • 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.
D1 · Cyclomatic Complexity · deckkit.audit_document (cyclomatic 39) · ×1
  • 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.
D1 · Cyclomatic Complexity · op_ck_bridge.opCkInit.measureParagraph (cyclomatic 39) · ×1
  • op_ck_bridge.opCkInit.measureParagraph (cyclomatic 39) crates/op-host-web/src/op_ck_bridge.js:1609 — op_ck_bridge.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.
D1 · Cyclomatic Complexity · opCkInit.measureParagraph (cyclomatic 39) · ×1
  • 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.
D1 · Cyclomatic Complexity · CanvasViewport · ×1
  • 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.
D1 · Cyclomatic Complexity · snapshot-extractor.vectorizeSvg (cyclomatic 38) · ×1
  • snapshot-extractor.vectorizeSvg (cyclomatic 38) REDACTED: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.
D1 · Cyclomatic Complexity · op_preview_core · ×1
  • 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.
D1 · Cyclomatic Complexity · HomeSurface · ×1
  • 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.
D1 · Cyclomatic Complexity · op_ck_bridge.opCkInit.drawImageWithOptions (cyclomatic 34) · ×1
  • op_ck_bridge.opCkInit.drawImageWithOptions (cyclomatic 34) crates/op-host-web/src/op_ck_bridge.js:1353 — op_ck_bridge.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.
D1 · Cyclomatic Complexity · opCkInit.drawImageWithOptions (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · design-evidence.sanitizeDesignEvidence (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · bridge.parseInboundFromPage (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · WorkspaceSurface · ×1
  • 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.
D1 · Cyclomatic Complexity · op_ck_bridge.opCkInit.textFirstBaseline (cyclomatic 28) · ×1
  • op_ck_bridge.opCkInit.textFirstBaseline (cyclomatic 28) crates/op-host-web/src/op_ck_bridge.js:1504 — op_ck_bridge.opCkInit.textFirstBaseline has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · opCkInit.textFirstBaseline (cyclomatic 28) · ×1
  • opCkInit.textFirstBaseline (cyclomatic 28) crates/op-host-web/src/op_ck_bridge.js:1504 — opCkInit.textFirstBaseline has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · op_opmerge · ×1
  • 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.
D1 · Cyclomatic Complexity · BrowserState · ×1
  • 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.
D1 · Cyclomatic Complexity · op_engine_napi · ×1
  • 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.
D1 · Cyclomatic Complexity · freshcheck.audit (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · CollabRuntime · ×1
  • 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.
D1 · Cyclomatic Complexity · SceneTemplatePanel · ×1
  • 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.
D1 · Cyclomatic Complexity · generateDesignMd (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · op_collab · ×1
  • 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.
D1 · Cyclomatic Complexity · OpSurfaceViewEditorTouch.editorTouch (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · OpSurfaceViewShellBridge.pollShellAction (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · op_ck_image_cache.jpegFitsThumbnailBounds (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · cjkcheck.main (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · picker.startPick (cyclomatic 22) · ×1
  • picker.startPick (cyclomatic 22) packages/op-chrome-extension/picker.js:46 — picker.startPick has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 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.
D1 · Cyclomatic Complexity · verify-rate-rules.verify_rules (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · figma_temp_worker.opStartFigmaTempImport (cyclomatic 21) · ×1
  • 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 items inside it that branch (finish, a function literal at line 388, releaseWorker). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · op_collab_relay_client · ×1
  • 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.
D1 · Cyclomatic Complexity · op_collab_smoke · ×1
  • 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.
D1 · Cyclomatic Complexity · BuiltInProvider · ×1
  • 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.
D1 · Cyclomatic Complexity · TransportConfig · ×1
  • 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.
D1 · Cyclomatic Complexity · CollabGatePolicy · ×1
  • 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.
D1 · Cyclomatic Complexity · run_matrix.parse_corpus_yaml (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · extract-op-auth-candidate.main (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · collectDesignEvidenceInPage · ×1
  • 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.
D1 · Cyclomatic Complexity · AnthropicToolCollector · ×1
  • 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.
D1 · Cyclomatic Complexity · op_codegen · ×1
  • 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.
D1 · Cyclomatic Complexity · ConfiguredBuiltinProvider · ×1
  • 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.
D1 · Cyclomatic Complexity · ClaudeCodeProvider · ×1
  • 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.
D1 · Cyclomatic Complexity · OpEngineHost.drainShellActions (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · codegen-prompt.parseCodegenOutput (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · capturePage (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · SheetParser · ×1
  • 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.
D1 · Cyclomatic Complexity · BatchGet · ×1
  • 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.
D1 · Cyclomatic Complexity · scene_preview_cards.main (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · op_ck_bridge.opCkMakeRuntimeShader (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · snapshot-extractor.inlineSegments (cyclomatic 17) · ×1
  • snapshot-extractor.inlineSegments (cyclomatic 17) REDACTED:968 — snapshot-extractor.inlineSegments has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (addText). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · i18n.t (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · OpenAiToolCollector · ×1
  • 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.
D1 · Cyclomatic Complexity · ExportItem · ×1
  • 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.
D1 · Cyclomatic Complexity · Parser · ×1
  • 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.
D1 · Cyclomatic Complexity · op_i18n · ×1
  • 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.
D1 · Cyclomatic Complexity · snapshot-extractor.shapeToPathData (cyclomatic 16) · ×1
  • snapshot-extractor.shapeToPathData (cyclomatic 16) REDACTED: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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 16) · ×1
  • (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.
D2 · Cognitive Complexity · Orchestrator · ×1
  • 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.
D2 · Cognitive Complexity · VariablesPanel · ×1
  • 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.
D2 · Cognitive Complexity · opCkInit.measureParagraph (cognitive 92) · ×1
  • 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.
D2 · Cognitive Complexity · SubprocessProvider · ×1
  • 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.
D2 · Cognitive Complexity · op_ck_bridge.opCkInit.measureParagraph (cognitive 78) · ×1
  • op_ck_bridge.opCkInit.measureParagraph (cognitive 78) crates/op-host-web/src/op_ck_bridge.js:1609 — op_ck_bridge.opCkInit.measureParagraph has cognitive complexity 78 (threshold 15). Drivers by points: if/else 19 (49 pts), loops 8 (20 pts), boolean chains 8, ternaries 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collectDesignEvidenceInPage (cognitive 78) · ×1
  • collectDesignEvidenceInPage (cognitive 78) packages/op-chrome-extension/design-capture.js:19 — collectDesignEvidenceInPage has cognitive complexity 78 (threshold 15). Drivers by points: if/else 76 (143 pts), boolean chains 65, ternaries 15 (26 pts), loops 9 (15 pts), error handling 3 (6 pts), other 2 (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CanvasViewport · ×1
  • 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.
D2 · Cognitive Complexity · deckkit.audit_document (cognitive 75) · ×1
  • 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.
D2 · Cognitive Complexity · design-capture.collectDesignEvidenceInPage · ×1
  • design-capture.collectDesignEvidenceInPage::walkRules (cognitive 71) packages/op-chrome-extension/design-capture.js:363 — design-capture.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.
D2 · Cognitive Complexity · op_host_web.__wbg_get_imports (cognitive 68) · ×1
  • 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). None of this is in the body itself: all 68 points belong 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.
D2 · Cognitive Complexity · WorkspaceSurface · ×1
  • 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.
D2 · Cognitive Complexity · op_ck_bridge.opCkInit.drawImageWithOptions (cognitive 53) · ×1
  • op_ck_bridge.opCkInit.drawImageWithOptions (cognitive 53) crates/op-host-web/src/op_ck_bridge.js:1353 — op_ck_bridge.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.
D2 · Cognitive Complexity · opCkInit.drawImageWithOptions (cognitive 53) · ×1
  • 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.
D2 · Cognitive Complexity · snapshot-extractor.vectorizeSvg (cognitive 49) · ×1
  • snapshot-extractor.vectorizeSvg (cognitive 49) REDACTED: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.
D2 · Cognitive Complexity · freshcheck.audit (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · HomeSurface · ×1
  • 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.
D2 · Cognitive Complexity · op_host_web.__wbg_get_imports (cognitive 46) · ×1
  • 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. None of this is in the body itself: all 46 points belong 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.
D2 · Cognitive Complexity · OpSurfaceViewEditorTouch.editorTouch (cognitive 40) · ×1
  • OpSurfaceViewEditorTouch.editorTouch (cognitive 40) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewEditorTouch.kt:45 — OpSurfaceViewEditorTouch.editorTouch has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 3, match/switch 1 (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.
D2 · Cognitive Complexity · OpenAiToolCollector · ×1
  • 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.
D2 · Cognitive Complexity · cjkcheck.main (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · opCkInit.textFirstBaseline (cognitive 33) · ×1
  • opCkInit.textFirstBaseline (cognitive 33) crates/op-host-web/src/op_ck_bridge.js:1504 — opCkInit.textFirstBaseline has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 8, boolean chains 7, loops 2 (3 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · design-evidence.sanitizeDesignEvidence (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · generateDesignMd (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · BatchGet · ×1
  • 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.
D2 · Cognitive Complexity · BoundedDocumentReader.read (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · op_ck_bridge.opCkInit.textFirstBaseline (cognitive 29) · ×1
  • op_ck_bridge.opCkInit.textFirstBaseline (cognitive 29) crates/op-host-web/src/op_ck_bridge.js:1504 — op_ck_bridge.opCkInit.textFirstBaseline has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7, ternaries 4, loops 2 (3 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AnthropicToolCollector · ×1
  • 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.
D2 · Cognitive Complexity · op_cli · ×1
  • 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.
D2 · Cognitive Complexity · ClaudeCodeProvider · ×1
  • 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.
D2 · Cognitive Complexity · op_util · ×1
  • 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.
D2 · Cognitive Complexity · run_matrix.main (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · extract-op-auth-candidate.main (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · Toolbar · ×1
  • 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.
D2 · Cognitive Complexity · ListUiKits · ×1
  • 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.
D2 · Cognitive Complexity · OpEngineHost.drainShellActions (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · op_ck_image_cache.jpegFitsThumbnailBounds (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · capturePage (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · OpSurfaceViewShellBridge.pollShellAction (cognitive 25) · ×1
  • OpSurfaceViewShellBridge.pollShellAction (cognitive 25) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:201 — OpSurfaceViewShellBridge.pollShellAction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 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.
D2 · Cognitive Complexity · run_matrix.parse_corpus_yaml (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · scene_preview_cards.main (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · check-sw-imports.stripComments (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 25) · ×1
  • (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.
D2 · Cognitive Complexity · t (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · CssVariables · ×1
  • 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.
D2 · Cognitive Complexity · GestureTracker · ×1
  • 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.
D2 · Cognitive Complexity · AuthCodeFormOverlay.submit (cognitive 24) · ×1
  • AuthCodeFormOverlay.submit (cognitive 24) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:324 — AuthCodeFormOverlay.submit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bridge.parseInboundFromPage (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · BuiltInProvider · ×1
  • 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.
D2 · Cognitive Complexity · LineStreamChild · ×1
  • 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.
D2 · Cognitive Complexity · startPick (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · ImageSearchSession · ×1
  • 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.
D2 · Cognitive Complexity · ConfiguredBuiltinProvider · ×1
  • 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.
D2 · Cognitive Complexity · oplib.text (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · op_ck_bridge.opCkInit.registeredCoverageSegments (cognitive 22) · ×1
  • op_ck_bridge.opCkInit.registeredCoverageSegments (cognitive 22) crates/op-host-web/src/op_ck_bridge.js:917 — op_ck_bridge.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.
D2 · Cognitive Complexity · background.chrome.runtime.onMessage.addListener() (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · sync-version.skipJsoncValue (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · opStartFigmaTempImport (cognitive 22) · ×1
  • 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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · opCkInit.registeredCoverageSegments (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · op_engine_jni · ×1
  • 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.
D2 · Cognitive Complexity · DependencyState · ×1
  • 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.
D2 · Cognitive Complexity · snapshot-extractor.buildImage (cognitive 21) · ×1
  • snapshot-extractor.buildImage (cognitive 21) REDACTED: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.
D2 · Cognitive Complexity · snapshot-extractor.inlineSegments (cognitive 21) · ×1
  • snapshot-extractor.inlineSegments (cognitive 21) REDACTED: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). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (addText). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · snapshot-extractor.buildInlineRun (cognitive 21) · ×1
  • snapshot-extractor.buildInlineRun (cognitive 21) REDACTED: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.
D2 · Cognitive Complexity · TruncationScanner · ×1
  • 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.
D2 · Cognitive Complexity · UndoLedger · ×1
  • 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.
D2 · Cognitive Complexity · Reassembler · ×1
  • 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.
D2 · Cognitive Complexity · IncrementalRecordDecoder · ×1
  • 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.
D2 · Cognitive Complexity · SecureConnection · ×1
  • 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.
D2 · Cognitive Complexity · MissingFontsPanel · ×1
  • 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.
D2 · Cognitive Complexity · op_render_export · ×1
  • 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.
D2 · Cognitive Complexity · verify-rate-rules.verify_rules (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · snapshot-extractor.shapeToPathData (cognitive 20) · ×1
  • snapshot-extractor.shapeToPathData (cognitive 20) REDACTED: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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · op_acp · ×1
  • 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.
D2 · Cognitive Complexity · TransportConfig · ×1
  • 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.
D2 · Cognitive Complexity · ComponentBrowserPanel · ×1
  • 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.
D2 · Cognitive Complexity · McpLiveServer · ×1
  • 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.
D2 · Cognitive Complexity · run_matrix.aggregate (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · popup.onDownload (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · SignerConfig · ×1
  • 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.
D2 · Cognitive Complexity · CkInner · ×1
  • 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.
D2 · Cognitive Complexity · SearchAllUniqueProperties · ×1
  • 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.
D2 · Cognitive Complexity · OpSurfaceView.surfaceCreated (cognitive 18) · ×1
  • OpSurfaceView.surfaceCreated (cognitive 18) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt:234 — OpSurfaceView.surfaceCreated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · digest-op-auth-tree.tree_digest (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · export-i18n-catalogs.parse_locale_source (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · merge-settings-i18n.main (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · snapshot-extractor.buildTextLines (cognitive 18) · ×1
  • snapshot-extractor.buildTextLines (cognitive 18) REDACTED: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.
D2 · Cognitive Complexity · client.readBoundedDesignResponse (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · CollabJwksCache · ×1
  • 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.
D2 · Cognitive Complexity · op_builtin_model_discovery · ×1
  • 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.
D2 · Cognitive Complexity · GuestRelayRuntime · ×1
  • 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.
D2 · Cognitive Complexity · CollabGatePolicy · ×1
  • 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.
D2 · Cognitive Complexity · MobileDock · ×1
  • 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.
D2 · Cognitive Complexity · Emitter · ×1
  • 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.
D2 · Cognitive Complexity · ConnectionDriver · ×1
  • 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.
D2 · Cognitive Complexity · FileMenu · ×1
  • 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.
D2 · Cognitive Complexity · Session · ×1
  • 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.
D2 · Cognitive Complexity · op_git · ×1
  • 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.
D2 · Cognitive Complexity · ImageDecodeHost · ×1
  • 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.
D2 · Cognitive Complexity · BindingOverlay · ×1
  • 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.
D2 · Cognitive Complexity · check-collab-bootstrap-urls.canonical_host (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · op_ck_bridge.opCkParseFontFamilyStack (cognitive 16) · ×1
  • 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 item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · op_ck_bridge.opCkMakeRuntimeShader (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · codegen-prompt.parseCodegenOutput (cognitive 16) · ×1
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · 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.
D4 · Code Duplication · Near-duplicate member pair (144 shared lines) · ×1
  • Near-duplicate member pair (144 shared lines) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:83 — crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:83-401 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:40-363 — 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.
D4 · Code Duplication · Near-duplicate member pair (72 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (66 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (64 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (49 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (47 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) 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:128-297 | crates/op-host-services/src/web_canvas_server/run_loop.rs:28-198 — 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.
D4 · Code Duplication · Near-duplicate member pair (41 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (35 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (34 shared lines) · ×1
  • Near-duplicate member pair (34 shared lines) crates/op-html/src/project_zip.rs:190 — crates/op-html/src/project_zip.rs:190-287 | 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.
D4 · Code Duplication · Near-duplicate member pair (31 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (30 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (15 shared lines) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (61–74 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • 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:456-496 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (39–41 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (35–36 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (34–36 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (33–35 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (31–33 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (4–32 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (29–30 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (29 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (24–29 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20–28 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (27 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (22–27 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (21–25 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20–25 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (22–23 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19–23 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6–19 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–18 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6–11 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7–11 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 10) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 9) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (3–7 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (3–5 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 14) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 10) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11–17 lines × 8) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–16 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 13) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 22) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 39) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 12) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 10) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (43–44 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–18 lines × 4) · ×1
  • 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 | REDACTED: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.
D4 · Code Duplication · Duplicated block (15–16 lines × 5) · ×1
  • 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 | REDACTED: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.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.94 rust-toolchain.toml:1 — 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.
D5 · Coupling · Unstable project op-engine-ffi · ×1
  • Unstable project op-engine-ffi — op-engine-ffi has instability 0.89 with 2 dependents.
D5 · Coupling · Unstable project op-host-web · ×1
  • Unstable project op-host-web — op-host-web has instability 0.92 with 1 dependents.
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.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (13 clone groups) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (68 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (32 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (19 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function collectDesignEvidenceInPage (cyclomatic 47, cognitive 78) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function measureParagraph (cyclomatic 39, cognitive 92) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function vectorizeSvg (cyclomatic 38, cognitive 49) · ×1
  • Complex function vectorizeSvg (cyclomatic 38, cognitive 49) REDACTED: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.
R2 · Cyclomatic Complexity · Complex function drawImageWithOptions (cyclomatic 34, cognitive 53) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function walkRules (cyclomatic 31, cognitive 71) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function parseInboundFromPage (cyclomatic 29, cognitive 25) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function generateDesignMd (cyclomatic 23, cognitive 30) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function jpegFitsThumbnailBounds (cyclomatic 23, cognitive 26) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function toHex (cyclomatic 19, cognitive 24) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function componentSample (cyclomatic 19, cognitive 16) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function capturePage (cyclomatic 18, cognitive 26) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function opCkMakeRuntimeShader (cyclomatic 17, cognitive 16) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function textFirstBaseline (cyclomatic 16, cognitive 20) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function buildImage (cyclomatic 15, cognitive 21) · ×1
  • Complex function buildImage (cyclomatic 15, cognitive 21) REDACTED: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.
R2 · Cyclomatic Complexity · Complex function buildInlineRun (cyclomatic 15, cognitive 21) · ×1
  • Complex function buildInlineRun (cyclomatic 15, cognitive 21) REDACTED: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.
R2 · Cyclomatic Complexity · Complex function shapeToPathData (cyclomatic 15, cognitive 19) · ×1
  • Complex function shapeToPathData (cyclomatic 15, cognitive 19) REDACTED: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.
R2 · Cyclomatic Complexity · Complex function onDownload (cyclomatic 15, cognitive 19) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function buildTextLines (cyclomatic 15, cognitive 18) · ×1
  • Complex function buildTextLines (cyclomatic 15, cognitive 18) REDACTED: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.
R3 · Large Files · crates/op-host-web/src/op_ck_bridge.js · ×1
  • crates/op-host-web/src/op_ck_bridge.js: 1873 lines of code crates/op-host-web/src/op_ck_bridge.js:1 — crates/op-host-web/src/op_ck_bridge.js has 1873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1193 lines of code REDACTED:1 — REDACTED has 1193 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/op-chrome-extension/popup.js · ×1
  • packages/op-chrome-extension/popup.js: 697 lines of code packages/op-chrome-extension/popup.js:1 — packages/op-chrome-extension/popup.js has 697 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/op-chrome-extension/design-capture.js · ×1
  • packages/op-chrome-extension/design-capture.js: 628 lines of code packages/op-chrome-extension/design-capture.js:1 — packages/op-chrome-extension/design-capture.js has 628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/op-vscode/src/vscode/pen-editor-provider.ts · ×1
  • packages/op-vscode/src/vscode/pen-editor-provider.ts: 581 lines of code packages/op-vscode/src/vscode/pen-editor-provider.ts:1 — packages/op-vscode/src/vscode/pen-editor-provider.ts has 581 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/op-vscode/src/session/pen-session.ts · ×1
  • packages/op-vscode/src/session/pen-session.ts: 571 lines of code packages/op-vscode/src/session/pen-session.ts:1 — packages/op-vscode/src/session/pen-session.ts has 571 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/op-chrome-extension/client.js · ×1
  • packages/op-chrome-extension/client.js: 496 lines of code packages/op-chrome-extension/client.js:1 — packages/op-chrome-extension/client.js has 496 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · crates/op-host-web/src/figma_temp_worker.js · ×1
  • crates/op-host-web/src/figma_temp_worker.js: 465 lines of code crates/op-host-web/src/figma_temp_worker.js:1 — crates/op-host-web/src/figma_temp_worker.js has 465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/op-chrome-extension/background.js · ×1
  • packages/op-chrome-extension/background.js: 452 lines of code packages/op-chrome-extension/background.js:1 — packages/op-chrome-extension/background.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js · ×1
  • crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js: 428 lines of code crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:1 — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~404 LoC) · ×1
  • 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
R8 · Dependency Hygiene · Unused dependency '@iconify-json/feather' · ×1
  • 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.
R8 · Dependency Hygiene · Unused dependency '@iconify-json/lucide' · ×1
  • 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.
R8 · Dependency Hygiene · Unused dependency '@iconify-json/simple-icons' · ×1
  • 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap deploy/collab-relay-edge/verify-rate-rules.py:49 — `bitmask_terms` is public and takes `value: Any` from its caller, and it calls itself at line 49 (`bitmask_terms`) with a piece of `value` — and nowhere in `bitmask_terms` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `bitmask_terms` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×1
  • Untrusted text written into markup unescaped crates/op-host-web/pkg-ck/op_host_web.js:741 — `getStringFromWasm0(arg1,arg2)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Minor — 112 finding(s)
X7 · Silent fallback defaults · Silent fallback default on Err · ×40
  • Silent fallback default on Err crates/op-ai/src/chat_tool_sse.rs:82 — `handle` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-ai/src/chat_tool_sse.rs:195 — `handle` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-chat-agent/src/chat_canvas_tools.rs:304 — `parse_design_modification_ops_arg` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-chat-agent/src/design_agent_tools/root_seed.rs:316 — `apply_mobile_status_bar` turns every `Err` into `MobileStatusBarChange::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-cli/src/skill_install_cli.rs:459 — `timestamp_string` turns every `Err` into `"0".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-core/src/clipboard.rs:60 — `paste_clipboard` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-core/src/page_mutators.rs:236 — `append_components_page_masters` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-core/src/svg_import.rs:180 — `import_svg_named` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-core/src/scene_template_palette.rs:104 — `extract_palette` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-core/src/theme_presets.rs:211 — `presets_from_json` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-core/src/theme_presets.rs:235 — `preset_file_to_json` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-core/src/web_sync.rs:536 — `selection_push_body` turns every `Err` into `r#"{"selectedIds":[]}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-host-core/src/chat.rs:80 — `unfilled_report_from_ack` turns every `Err` into `UnfilledScreensReport::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-host-core/src/chat.rs:101 — `quality_summary_from_ack` turns every `Err` into `QualitySummary::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-host-core/src/chat.rs:165 — `blocker_report_from_ack` turns every `Err` into `BlockerReport::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-host-core/src/codegen.rs:138 — `input_from_nodes` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:159 — `take_remote_image_requests` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-editor-ui/src/widgets/canvas_viewport_image/decode_registry.rs:54 — `take_pending_decodes` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-engine-jni/src/callbacks.rs:303 — `credential_load` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-engine-jni/src/callbacks.rs:362 — `credential_store_if_absent` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-git/src/merge.rs:218 — `conflict_stages` turns every `Err` into `ConflictStages::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-git/src/remote.rs:343 — `auth_env` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-host-desktop/src/agent_connect_store.rs:44 — `load` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-host-desktop/src/update_check.rs:359 — `parts` (in `is_newer`) turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/op-host-services/src/web_canvas_server/tenant_store.rs:237 — `load_acl` turns every `Err` into `BTreeSet::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate packages/op-chrome-extension/background.js:259 — `(error && (error.detail || error.message)) || error` appears character-identically in 2 files — packages/op-chrome-extension/background.js, packages/op-chrome-extension/popup-status.js. 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/pkg-ck/op_host_web.js:964 — `builtInMatches && builtInMatches.length > 1` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. 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/pkg-ck/op_host_web.js:1000 — `cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && …` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. 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/pkg-ck/op_host_web.js:1008 — `cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. 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/pkg-ck/op_host_web.js:1021 — `cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/op-chrome-extension/design-capture.js:602 — `left.name.localeCompare(right.name) || left.value.localeCompare(right.value)` appears character-identically in 2 files — packages/op-chrome-extension/design-capture.js, packages/op-chrome-extension/design-evidence.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/op-chrome-extension/capture.js:63 — `pick && typeof pick.teardown === 'function'` appears character-identically in 2 files — packages/op-chrome-extension/capture.js, packages/op-chrome-extension/design-capture.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/op-chrome-extension/design-capture.js:554 — `right.count - left.count || JSON.stringify(left).localeCompare(JSON.stringify(right))` appears character-identically in 2 files — packages/op-chrome-extension/design-capture.js, packages/op-chrome-extension/design-evidence.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/op-chrome-extension/design-capture.js:595 — `right.count - left.count || left.kind.localeCompare(right.kind)` appears character-identically in 2 files — packages/op-chrome-extension/design-capture.js, packages/op-chrome-extension/design-evidence.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/op-chrome-extension/account.js:205 — `typeof csrfToken !== 'string' || csrfToken === ''` appears character-identically in 2 files — packages/op-chrome-extension/account.js, packages/op-chrome-extension/client.js. 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/pkg-ck/op_host_web.js:1223 — `typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && …` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. 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/pkg-ck/op_host_web.js:942 — `typeof name == 'string' && name.length > 0` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. 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 packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewImeCoordinator.kt:31 — `!view.editorMode() || view.editorEngine() == 0L` appears character-identically in 2 files — packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewImeCoordinator.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt. 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 packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AndroidAuthRuntime.kt:65 — `status != 0 && status != OpNative.STATUS_CLOSING` appears character-identically in 4 files — packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AndroidAuthRuntime.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DocumentSaveBridge.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DocumentSaveCoordinator.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt. 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 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 templates/step0/_generators/tpl_deck_dossier.py:173 — `not isinstance(width, (int, float)) or not isinstance(content, str)` appears character-identically in 2 files — templates/step0/_generators/tpl_deck_dossier.py, templates/step0/_generators/tpl_deck_ledger.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 templates/step0/_generators/deckkit.py:332 — `soft and line and line[0] in NO_LINE_START` appears character-identically in 2 files — templates/step0/_generators/deckkit.py, templates/step0/_generators/qa/cjkcheck.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-host-native/src/backend/skia/path.rs:724 — `!bounds.is_finite() || !rect.size.x.is_finite() || !rect.size.y.is_finite() || rect.size.x <= 0.0 || rect.size.y <= 0.0` appears character-identically in 2 files — crates/op-host-native/src/backend/skia/path.rs, crates/op-host-native/src/boolean_ops.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_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-host-native/src/widget_host/scroll.rs:71 — `!chat.transcript_pinned || chat.transcript_scroll.offset != 0.0` appears character-identically in 2 files — crates/op-host-native/src/widget_host/scroll.rs, crates/op-host-web/src/widget_host/wheel_pan.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_chat.rs:375 — `!check_only && !allow_ai_bulk_write(host)` appears character-identically in 2 files — crates/op-engine-ffi/src/editor_chat.rs, crates/op-host-desktop/src/chat_session.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-native/src/widget_host/input.rs:214 — `!drag.moved && (x - drag.press_screen_x).abs() <= NODE_DRAG_THRESHOLD_PX && (y - drag.press_screen_y).abs() <= NODE_DRAG_THRESHOLD_PX` appears character-identically in 2 files — crates/op-host-native/src/widget_host/input.rs, crates/op-host-web/src/widget_host/node_drag.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-orchestrator/src/radial_repair.rs:198 — `!min_arc.is_finite() || max_arc <= 0.0 || min_arc / max_arc < MIN_SAFE_ARC_DIAMETER_RATIO` appears character-identically in 2 files — crates/op-orchestrator/src/radial_repair.rs, crates/op-orchestrator/src/ring_repair.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/command_node_attrs/state_ops.rs:89 — `!node_id.is_real() || !self.is_editable(node_id)` appears character-identically in 2 files — crates/op-editor-core/src/command_node_attrs/state_ops.rs, crates/op-editor-core/src/video_node_props.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.
X9 · Subsumed condition operand · Subsumed condition operand · ×17
  • 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-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/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/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/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-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-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-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-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/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-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.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 443 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-collab-host/src/runtime.rs, crates/op-host-web/src/collab_sync.rs (+435 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 269 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 (+261 more). Pair on, review, or document these before any departure.
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×2
  • REDACTED
  • REDACTED
P2 · Observability · Console output used as the logging channel · ×2
  • Console output used as the logging channel packages/op-vscode/src/extension.ts:49 — `packages/op-vscode/src/extension.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/op-vscode/src/extension.ts:53 — `packages/op-vscode/src/extension.ts` reports through `console.*` at line 53 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×2
  • 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.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (714 single-owned of 2209 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2209 of the 2509 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/op-host-services/src/web_image_generate_atlas.rs, crates/op-host-desktop/src/window_resize.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 7 of 58 project(s) overshoot their size bounds, lowering Project Cohesion to 7.6/10. The most over is `crates/op-editor-ui` (121415 LoC, 531 module-visible types across 16 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • 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.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected deploy/collab-relay-locator-edge/cn-federation-nginx.conf:32 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `cn-federation-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.)
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (crates/op-collab-relay-locator-server/src/http.rs:301).
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 5/8 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Minor — 1 finding(s)
D5 · Coupling · Off the main sequence · ×1
  • 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.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-73a3ae44c5204f1d91fa71fa57701d2e/history.json --exit-code 0 --source .2artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-73a3ae44c5204f1d91fa71fa57701d2e/tree.json --exit-code 0 --source .2artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude crates/op-design-lint/tests/fixtures/golden --exclude crates/op-web-sdk/bindings .53artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update62artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .4artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a17f51-828b-756e-b6e1-cfb033e3e8a3 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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